-
Content Count
593 -
Joined
-
Last visited
-
Medals
Everything posted by bangabob
-
Trigger triggers if vip leaves trigger area
bangabob replied to clawhammer's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Trigger Condition - Anybody !(VIP in thisList) -
Do triggers run sequentially or parallel?
bangabob replied to Heeeere's johnny!'s topic in ARMA 3 - MISSION EDITING & SCRIPTING
I read that all triggers are local anyway. Meaning that a trigger placed in the editor is spawned on each machine and doesn't cause network traffic unless variables are made public via publicvariable. -
How to access private variables in setTriggerStatements?
bangabob replied to Heeeere's johnny!'s topic in ARMA 3 - MISSION EDITING & SCRIPTING
I use setvariable on the trigger itself and save local variables into the trigger itself. So you could use something like this as a trigger condition. _trg settriggerstatement ["(thistrigger getvariable 'myvar' ) distance thistrigger", "",""]; _trg setvariable ['myvar', chopper1]; -
Which is more efficient - addAction condition or trigger condition?
bangabob replied to Heeeere's johnny!'s topic in ARMA 3 - MISSION EDITING & SCRIPTING
So using a mixture of triggers and addaction scripts would be much more efficient for addactions that are attached to the player? -
Which is more efficient - addAction condition or trigger condition?
bangabob replied to Heeeere's johnny!'s topic in ARMA 3 - MISSION EDITING & SCRIPTING
This is a good point and i am interested to know the answer. Logically it is best to begin with a distance check (A trigger can do this). And process the complicated code when required (Or the trigger is activated). -
How to pass a variable into an EH?
bangabob replied to BEAKSBY's topic in ARMA 3 - MISSION EDITING & SCRIPTING
You could also setvariable the _gun into the _newUnit and retrieve it using getvariable inside the killed EV. -
How to get addAction assigend to an object to broadcast over the network
bangabob replied to BEAKSBY's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Unless you preprocess the function then the BIS_fnc_MP call must be after the function. Is your BEAKS_Addaction stored in the init where all clients can access it or in the initserver? -
How to get addAction assigend to an object to broadcast over the network
bangabob replied to BEAKSBY's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Addaction is local. So you must send the add action to every client. One solution is BIS_FNC_MP. Fnc_addaction = { _gun1 = (_this select 0); _gun1 addaction ["bla bla", {call script}] }; If isserver then { [[_gun1],"fnc_addaction", true] call BIS_fnc_MP; }; -
Get/Set Variable in trigger statements
bangabob posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
I am spawning a trigger for each unit. The trigger is supposed to activate and deactivate every 10 seconds. This works with units named in the editor. (eg. s1). However my code throws an error with unnamed and spawned units. I think it is a problem with the format command and _unit object name. Error in expression <((B Alpha 1-1:2 getVariable 'plusTime') < ti> Error position: <Alpha 1-1:2 getVariable 'plusTime') < ti> Error Missing ) script.sqf H8_fnc_sortPrey = { _trigList = (_this select 0); _unit = (_this select 1); _trigger = (_this select 2); _unit setVariable ['plusTime',(time + _refresh)]; }; _unit = (_this select 0); _statement = [(format ["((%1 getVariable 'plusTime') < time)",_unit]), // TRIGGER CONDITION (format ["0 = [thisList,%1,thisTrigger] spawn H8_fnc_sortPrey;",_unit]), // TRIGGER ACTIVATION (format ["%1 setVariable ['plusTime',(time + %2)];",_unit,_refresh])]; // TRIGGER DEACTIVATION _trg=createTrigger["EmptyDetector",getPos _unit]; _trg setTriggerArea[50,50,0,false]; _trg setTriggerActivation["ANY","PRESENT",TRUE]; _trg setTriggerStatements _statements; Picture of input into the trigger -
Flashing / Blinking Markers?
bangabob replied to meatball's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Server side script that changes the Alpha of markers. if isServer then { _mkrArray = ["mkr_1","mkr_2","mkr_3"]; while {true} do { { _x setMarkerAlpha 0.5; }forEach _mkrArray ; sleep 0.3; { _x setMarkerAlpha 1; }forEach _mkrArray; sleep 0.3; }; }; -
What's the difference between spawn and call?
bangabob replied to Maurdekye's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Calls can also be used to return values. This function will return half of any number input. My_fnc= { _N=(_this select 0); _N=_N * 0.5; _N }; _newVal = [5] call my_fnc; Hint str _newVal; -
objectName setVariable [name, value, (public)] ...help with (public) broadcast
bangabob replied to BEAKSBY's topic in ARMA 3 - MISSION EDITING & SCRIPTING
If you are spawning the unit using a script then something like this will work _unit = group player createUnit ["B_soldier_F", Position player, [], 0, "FORM"]; _unit setVariable ["addAction",true,true]; And 'vehicle player' is referring to the object that a client (player) is controlling. Most of the time this object is a unit. And 'Player' just a local command, not a name that other players can see. So to send variables to other clients using set/GetVariable we need to use the object name. -
objectName setVariable [name, value, (public)] ...help with (public) broadcast
bangabob replied to BEAKSBY's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Passing BOOLEANS shouldn't cause lag. But to help you optimize the script we really need a better understanding of the script purpose. -
objectName setVariable [name, value, (public)] ...help with (public) broadcast
bangabob replied to BEAKSBY's topic in ARMA 3 - MISSION EDITING & SCRIPTING
You have set the variable to the player. Not the player vehicle. (Which must be named). Which means that the condition will always be local to the player even if you make it public. Try giving the player a name like p1 and set the variable to p1. Such as p1 getvariable/set variable. -
addAction and BIS_fnc_MP...help with script
bangabob replied to BEAKSBY's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Im glad you found the video useful :D Try replacing your addaction arguments with this. Priority is Max 6 (Not 9). And you don't want 'hide-on-use' TRUE. So i have replaced that argument with FALSE. Give it a go. _gun1 addAction ["REINFORCE EMPLACEMENT",{call BEAKS_ReinforceStaticWeapon}, nil, 6, true, FALSE, "","(_target getVariable ""reinforce"") && (_target distance _this ) < 5 && !(alive ((crew _target) select 0))"]; -
addAction that plays sounds on units?
bangabob replied to DutchVidya's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Just change the addaction code. So add it to different units and change the sound names as needed and the Text to whatever. unit2 addAction ["Play sound UP",{[["up",(_this select 0)],"glb_fnc_PlaySound",true] call BIS_fnc_MP]}]; unit4 addAction ["Play sound UP",{[["shutup",(_this select 0)],"glb_fnc_PlaySound",true] call BIS_fnc_MP]}]; unit3 addAction ["Play sound UP",{[["shutit",(_this select 0)],"glb_fnc_PlaySound",true] call BIS_fnc_MP]}]; -
addAction that plays sounds on units?
bangabob replied to DutchVidya's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Try using BIS_fnc_MP. Something like this (untested) unit1 addAction ["Play sound UP",{[["up",(_this select 0)],"glb_fnc_PlaySound",true] call BIS_fnc_MP]}]; In the init.sqf glb_fnc_PlaySound = { _sound = (_this select 0); _unit = (_this select 1); _unit say3D _sound; } -
Helmet cam - PIP, anyone?
bangabob replied to fortun's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Check out Live feed Control. It's linked below this post. -
Live feed control (LFC)
bangabob replied to bangabob's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Have you enabled PIP in your video settings? -
Live feed control (LFC)
bangabob replied to bangabob's topic in ARMA 3 - MISSION EDITING & SCRIPTING
It doesn't matter what the name is. But it must be referenced correctly in the script. However it should work fine even if another script is using the SERVER GL. -
addAction dynamically to a vehicle.
bangabob replied to cael817's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Why not add an action to the player that uses the CURSORTARGET to detect vehicles and then the variable. Something like player addAction ["action",{hint "worked"},[cursosTarget],6,false,false,"","cursorTarget isKindOf ""LandVehicle"" and cursorTarget getVariable 'UID' == getPlayerUID"]; -
Enemy occupation system (eos)
bangabob replied to bangabob's topic in ARMA 3 - MISSION EDITING & SCRIPTING
You will have to wait a few seconds to allow EOS to complete its initialization. -
Enemy occupation system (eos)
bangabob replied to bangabob's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Yeah _eosMarkers=server getvariable "EOSmarkers" -
Why won't this eventhandler work?...please help
bangabob replied to BEAKSBY's topic in ARMA 3 - MISSION EDITING & SCRIPTING
"Killed" EH passes 2 arguments in the _this command. _vehKilledEH = _cas addEventHandler ["Killed",{ _unitKilled = _this select 0; _killer = _this select 1; _killer spawn BEAKS_fnc_reward_veh; }]; -
Thats very strange since no actions are on the player. I tested it in dedicated too. Maybe it's some crazy locality issue when the player is also a server. Anyway! Sit tight. I had an epiphany and i think i can make this script much more flexible and 'light'.