-
Content Count
431 -
Joined
-
Last visited
-
Medals
Everything posted by BEAKSBY
-
Custom Menu <optional icon path> issue
BEAKSBY replied to BEAKSBY's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I just want to add the icon beside the name in the custom menu list, similarly to what we had in the addAction command. player addAction ["<img size='2' shadow='5' image='SlammerUp1_CA.paa'/> <t color='#00dd00'>M2A4 Slammer UP $1200</t>", "ObjectPositionAndDirectionD.sqf",[],0,true,true,"","sector1 getVariable 'owner' == side _this and vehicle _this == _target"] ; This is a better solution to the addAction as it has submenus built in and the ability to diasable items (gray out). This should work nicely with my money script, so if you can't afford something it remains grayed out. I just don't know how to set conditions to activate or deactivate the "isActive" portion, yet. https://community.bistudio.com/wiki/showCommandingMenu // ["Title_in_menu", [assigned_key], "Submenu_name", CMD, [["expression",script-string]], "isVisible", "isActive" <, optional icon path> ] // isActive - Boolean 1 or 0 for yes or no - if "player does not have enough money" item is not active, it appears gray. ["M2A4 Slammer UP $1200", [2], "", -5, [["expression", "player sidechat ""Second"" "]], "1", "1", "\SlammerUp2_ca.paa"], -
Health, Food, Water & Money - script and gui icons
BEAKSBY replied to BEAKSBY's topic in ARMA 3 - MISSION EDITING & SCRIPTING
See link to , from Jester814, bottom right corner of screen. I've seen several games with this and DayZ also. -
how do I run addEventHandler effects on a specific machine, server or client?
BEAKSBY replied to BEAKSBY's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Thanks DnA_UK When a unit (including the player) kills an enemy unit, the side that made the kill should receive $100 in their account (I.e. BLUmoney or OPPmoney). This $100 should be displayed as a hint on the machine of the player's side that made the kill only. This is for MP. -
How do I disguish the _x from WEST vs. EAST side? I tried to incorporate private but couldn't figure out how to place it in the script, thinking this would solve the problem. { if ((side player == WEST) && (side _x != side player)) then { _x addEventHandler ["Killed", {[100] execVM "BLUaddMoney.sqf";}]; }; if ((side player == EAST) && (side _x != side player)) then { _x addEventHandler ["Killed", {[100] execVM "OPPaddMoney.sqf";}]; }; } forEach allUnits; I noticed that in LAN the EAST side addEventHandler won't work because of the shared _x.
-
Hi Tajin, I tried this as addMoney.sqf along with this in my init.sqf Still not working properly. It works fine as WEST but when I reload and play as EAST only the WEST side's team money is registered and displayed when they make a kill. This should not appear as the intent is that only the player's side that makes an enemy kill generates money which is diplayed on the killing side(s) screen only. ---------- Post added at 22:45 ---------- Previous post was at 21:28 ---------- I think this all has to do with addEventHandler effects of the given scripting command are not broadcasted over the network and remain local to the client the command is executed on. Check Locality in Multiplayer for more information about locality of objects. I'm not sure how to check which machine it is run on server or client then run the addEventHandler on the appropriate machine. SO how do I run addEventHandler effects on a specific machine, server or client? Starting a new thread.
-
I'll try that. I had in my init.sqf but forgot to add to my post the following: BLUmoney = 5000 OPPmoney = 1000 BUT, I suspect that hint message will still appear on the host's (local?) screen. I want the hint only to be displayed on the machine that earns the money (by killing the enemy).
-
This is exactly what I want, but then, what do I add in the "addMoney.sqf". Each side has there own account. I.e. Oppaddmoney.sqf _sum = _this select 0; OPPmoney = OPPmoney + _sum; hint format ["You have %1$", OPPmoney]; BLUaddmoney.sqf _sum = _this select 0; BLUmoney = BLUmoney + _sum; hint format ["You have %1$", BLUmoney]; I feel I'm getting closer! ---------- Post added at 12:32 ---------- Previous post was at 11:53 ---------- I created this for your script Tajin but... init.sqf { _x addEventHandler ["Killed", { private ["_unit","_killer"]; _unit = _this select 0; _killer = _this select 1; if ( (_killer countEnemy [_unit]) > 0 ) then { [side _killer,100] execVM "addMoney.sqf"; }; }]; } forEach allUnits; addMoney.sqf _side = _this select 0; _sum = _this select 1; If (_side == WEST) then {// for west units BLUmoney = BLUmoney + _sum; hint format ["You have %1$", BLUmoney]; }; If (_side == EAST) then {// for east units OPPmoney = OPPmoney + _sum; hint format ["You have %1$", OPPmoney]; }; My game slows down to a crawl, and OPPmoney is not being displayed or even registered when EAST kills a unit.
-
Has anyone used this funtion yet? If so how to I use it to run the following on a clients machine _sum = _this select 0; OPPmoney = OPPmoney + _sum; if (hint format ["You have %1$", OPPmoney]; // DID NOT WORK ON LAN
-
Hint message problem with my MP money script
BEAKSBY replied to BEAKSBY's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I found the problem but don't know how to resolve it. It has to do with both _x variables from the addEventHandler from WEST and EAST sides conflicting. { if ((side player == WEST) && (side _x != side player)) then { _x addEventHandler ["Killed", {[100] execVM "BLUaddMoney.sqf";}]; }; if ((side player == EAST) && (side _x != side player)) then { _x addEventHandler ["Killed", {[100] execVM "OPPaddMoney.sqf";}]; }; } forEach allUnits; How do I disguish the _x from WEST vs. EAST side? I tried to incorporate private but couldn't figure out how to place it in the script. I will start this on a new thread. -
Hint message problem with my MP money script
BEAKSBY posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi Folks, I'm building a multiplayer money script so when a player kills a unit from the opposing team they generate money for their side. Similarly, this is done for the opposite side. But for some reason the hint is being displayed on both screens when I test this on LAN. How do I ensure the hint is only displayed on for the player that generated the money? init.sqf /*Before you use the player object (usually to avoid JIP issues) all you need is to run: waitUntil {!isNull player}; Anything else you see in other scripts is equivalent and/or redundant. Of course JIP players may need more than just the player to point at the actual JIP player unit, but that's script/mission-specific. https://community.bistudio.com/wiki/player*/ waitUntil {!isNull player}; BLUmoney = 5000; OPPmoney = 5000; call compile preProcessFileLineNumbers "scripts\UIFunctions.sqf"; { if ((WEST == playerSide) && (side _x != playerSide)) then { _x addMPEventHandler ["MPKilled", {[100] execVM "BLUaddMoney.sqf";}]; }; if ((EAST == playerSide) && (side _x != playerSide)) then { _x addMPEventHandler ["MPKilled", {[100] execVM "OPPaddMoney.sqf";}]; }; } forEach allUnits; _menu = player addAction ["<t color=""#3399FF"">" +"Weapons", {call FUS_fnc_dialogInit;}]; BLUaddMoney.sqf waitUntil {!isNull player}; _sum = _this select 0; BLUmoney = BLUmoney + _sum; hint format ["You have %1$",BLUmoney]; OPPaddMoney.sqf waitUntil {!isNull player}; _sum = _this select 0; OPPmoney = OPPmoney + _sum; hint format ["You have %1$",OPPmoney]; Thanks -
Thanks everyone, I'm loving all the support for all my script help BTW! From my other post, see http://forums.bistudio.com/showthread.php?178199-Hint-message-problem-with-my-MP-money-script I tried to incorporate spawn BIS_fnc_MP in the following, but it only managed to display the WEST money generated on the EAST side's player's screen. PHP Code: { switch (side _x) do { case WEST: {if (side _x != playerSide) then {_x addEventHandler ["Killed", {[[[100],"BLUaddMoney.sqf"],"BIS_fnc_execVM", WEST,true] spawn BIS_fnc_MP;}];};}; case EAST: {if (side _x != playerSide) then {_x addEventHandler ["Killed", {[[[100],"OPPaddMoney.sqf"],"BIS_fnc_execVM", EAST,true] spawn BIS_fnc_MP;}];};}; default {}; }; } foreach allUnits; How do MP games, like Stratis life, display hints to only the client players? ---------- Post added at 17:16 ---------- Previous post was at 17:11 ---------- So _x is the array of players? How did you address them [player1, player2...etc.] I don't have names for them as my players can respawn throught the game or I simply don't know where to find their names, in the mission file? I'm using the respawn template from BIS. Also, I'm not sure what I should put in for this "foreach _myunit_array;" Thanks for your help also!
-
Hint message problem with my MP money script
BEAKSBY replied to BEAKSBY's topic in ARMA 3 - MISSION EDITING & SCRIPTING
This did not work either for either side. based on I tried to incorporate the following, but it only managed to display the WEST money generated on the EAST side's player's screen. { switch (side _x) do { case WEST: {if (side _x != playerSide) then {_x addEventHandler ["Killed", {[[[100],"BLUaddMoney.sqf"],"BIS_fnc_execVM", WEST,true] spawn BIS_fnc_MP;}];};}; case EAST: {if (side _x != playerSide) then {_x addEventHandler ["Killed", {[[[100],"OPPaddMoney.sqf"],"BIS_fnc_execVM", EAST,true] spawn BIS_fnc_MP;}];};}; default {}; }; } foreach allUnits; How do MP games, like Stratis life, display hints to only the client players? -
Hint message problem with my MP money script
BEAKSBY replied to BEAKSBY's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Closer, for the EAST side the money generated is being displayed on the WEST's screen. The WEST side still works fine. I tried this too and still displays both money generated from either side on the WEST side's player's screen. { switch (side _x) do { case WEST: {_x addEventHandler ["Killed", {[100] execVM "BLUaddMoney.sqf";}];}; case EAST: {_x addEventHandler ["Killed", {[[[100], "OPPaddMoney.sqf"], "BIS_fnc_execVM",EAST, true] spawn BIS_fnc_MP;}];}; default {}; }; } foreach allUnits; -
Hint message problem with my MP money script
BEAKSBY replied to BEAKSBY's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Thanks, but for some reason now BLUaddMoney.sqf is not being executed as the hint message is not being displayed. BLUaddMoney.sqf _sum = _this select 0; BLUmoney = BLUmoney + _sum; hint format ["You have %1$", BLUmoney]; ---------- Post added at 16:35 ---------- Previous post was at 16:21 ---------- I added forEach but now it only only displays the hint for WEST side. init.sqf { if ((WEST == playerSide) && (side _x != playerSide)) then { _x addEventHandler ["Killed", {[100] execVM "BLUaddMoney.sqf";}]; }; } forEach allUnits; { if ((EAST == playerSide) && (side _x != playerSide)) then { _x addEventHandler ["Killed", {[100] execVM "OPPaddMoney.sqf";}]; }; } forEach allUnits; BLUaddMoney.sqf _sum = _this select 0; BLUmoney = BLUmoney + _sum; hint format ["You have %1$", BLUmoney]; OPPaddMoney.sqf _sum = _this select 0; OPPmoney = OPPmoney + _sum; hint format ["You have %1$", OPPmoney]; -
How do I select smoke to be thrown instead of grenades in my player is carrying both? I can't find this anywhere.
-
How would I modify the example above to have separate money scripts for opposing player sides? Do I need distnct variables and functions for each side like BLUmoney and OPPmoney and FUS_fnc_BLUaddmoney and FUS_fnc_OPPaddmoney for example?
-
Dialog ListBox and Mouse Scroll Wheel
BEAKSBY replied to BEAKSBY's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Yeah I noticed it seems to stutter and affect the cost of abnormally. I've downloaded this example and will try to incorportate the images associated with the vehicles in the list box similar to what is done here with the weapon and uniform dialog: ARMA 3 Alpha GUI Test Weapon Outfit: http://www.filefactory.com/file/51rmi34pnhgf/n/Z5_GUI_Stratis_7z -
Dialog ListBox and Mouse Scroll Wheel
BEAKSBY posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
HI All, Does anyone know or have ever tried incorporating into a dialog script a way to select items from a ListBox using the mouse wheel instead of the mouse cursor? This would be helpful and faster for the game I'm creating, where the player can access the list and quickly select the weapon or vehicle to purchase from the listbox. Thanks -
Dialog ListBox and Mouse Scroll Wheel
BEAKSBY replied to BEAKSBY's topic in ARMA 3 - MISSION EDITING & SCRIPTING
That worked! I just changed the idc to match mine. ...and to select it by pressing the middle mouse button I can use onMouseButtonDown? Is it better to run this as an sqf or function? ---------- Post added at 22:16 ---------- Previous post was at 21:01 ---------- I've tried this in the init: onMouseButtonDown = "_this execVM 'bm.sqf'"; Then this for the bm.sqf: _bwheel = _this select 1; _curindex = lbCurSel 15001; if (_bwheel == 1) Then { lbSetCurSel [15001,(_curindex)], "; }; "[15001] call FUS_fnc_LBDblClick"; and this is in the FUS_fnc_LBDblClick: FUS_fnc_LBDblClick = {// >> Function Start _listBox = _this select 0; _selection = lbCurSel _listBox; _text = lbText [_listBox, _selection]; switch (_selection) do { case 0: {if (money >= 400) then {[400, "B_Heli_Transport_01_F"] call FUS_fnc_addItem;} else {hint "You don't have enough money.";};}; case 1: {if (money >= 500) then {[500, "B_MBT_01_TUSK_F"] call FUS_fnc_addItem;} else {hint "You don't have enough money.";};}; case 2: {if (money >= 1000) then {[1000, "B_MRAP_01_F"] call FUS_fnc_addItem;} else {hint "You don't have enough money.";};}; }; };// << Function End -
How do I edit a Dialog box from GUI EDITOR that already exists
BEAKSBY posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
How do I call up a diaglog box from a mission I downloaded and edit it from the GUI EDITOR. I want to reposition, frames, texts, and modify other things like that but from the GUI EDITOR, not from Notepad. THanks -
Positioning and Orient Object Script while in game?
BEAKSBY posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Does anyone know of a script that allows me to postion and orient an object, static or vehicle down while in game. I want the player to see an outline of the object, static or vehicle (shaded in all one colour like green, or blue...whatever), be able to position and orient it in the direction they desire before it is spawned in, all in game. This will be similar to what Zeus does, except it would be in MP mode. -
Positioning and Orient Object Script while in game?
BEAKSBY replied to BEAKSBY's topic in ARMA 3 - MISSION EDITING & SCRIPTING
What is MCC? -
Iceman77, I'm getting into dialogs based on your helpful tutorial. But I would like to modify you GUI script in the Example Mission above, with the GUI EDITOR, instead of tediously modifing it through the resource scripts. At the GUI EDITOR, once I press CTRL + I, what do I place in the field under Config path instead of the default "configfile" to edit your GUI?
-
onEachFrame and findDisplay script question
BEAKSBY replied to BEAKSBY's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Me neither... ...I think this is the first scripting limitation I've found in Arma3 so far. -
onEachFrame and findDisplay script question
BEAKSBY posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi Folkes, 1a) How do I get ArmorDrop.sqf to execute only after the onEachFrame {} is complete? I would like the last _pos from the onEachFrame loop to be passed to the ArmorDrop.sqf ...1b) how do I pass the _pos array? 2) How do I change the direction of _heli while in the onEachFrame loop by using the up arrow key? (or preferably mouse wheel) See script below: onEachFrame { _pos = screenToWorld [0.5,0.5];// land position _heli = createVehicle [ "B_MBT_01_TUSK_F", [(_pos select 0), (_pos select 1), 0], [], 0, "CANNOT_COLLIDE" ]; waituntil {!(IsNull (findDisplay 46))}; _keyDown1 = (findDisplay 46) displayAddEventHandler ["KeyDown1", "if (_this select 1 == 200) then {_yy = 10}"]; _heli setDir (direction player -_yy); _heli setVectorUp surfaceNormal position _heli; _heli setObjectTexture [0, "#(rgb,8,8,3)color(0,0.5,0,1)"]; _heli setObjectTexture [1, "#(rgb,8,8,3)color(0,0.5,0,1)"]; _heli setObjectTexture [2, "#(rgb,8,8,3)color(0,0.5,0,1)"]; deleteVehicle _heli; waituntil {!(IsNull (findDisplay 46))}; _keyDown = (findDisplay 46) displayAddEventHandler ["KeyDown", "if (_this select 1 == 33) then {onEachFrame {};}"]; }; waituntil {!(IsNull (findDisplay 46))}; _keyDown = (findDisplay 46) displayAddEventHandler ["KeyDown", "if (_this select 1 == 33) then {_this = execVM "ArmorDrop.sqf";}"];