Jump to content

bangabob

Member
  • Content Count

    593
  • Joined

  • Last visited

  • Medals

Everything posted by bangabob

  1. Trigger Condition - Anybody !(VIP in thisList)
  2. 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.
  3. 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];
  4. So using a mixture of triggers and addaction scripts would be much more efficient for addactions that are attached to the player?
  5. 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).
  6. You could also setvariable the _gun into the _newUnit and retrieve it using getvariable inside the killed EV.
  7. 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?
  8. 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; };
  9. 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
  10. 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; }; };
  11. 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;
  12. 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.
  13. Passing BOOLEANS shouldn't cause lag. But to help you optimize the script we really need a better understanding of the script purpose.
  14. 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.
  15. 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))"];
  16. 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]}];
  17. 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; }
  18. Check out Live feed Control. It's linked below this post.
  19. bangabob

    Live feed control (LFC)

    Have you enabled PIP in your video settings?
  20. bangabob

    Live feed control (LFC)

    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.
  21. 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"];
  22. You will have to wait a few seconds to allow EOS to complete its initialization.
  23. Yeah _eosMarkers=server getvariable "EOSmarkers"
  24. "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; }];
  25. bangabob

    Drag Dead Body Script

    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'.
×