-
Content Count
769 -
Joined
-
Last visited
-
Medals
Posts posted by Schatten
-
-
You can do it the same way I did.
-
Just get unit class name and use it in the title:
_Object addAction [format ["How do I add the %1 here", typeOf _x], "Scripts\Blah.sqf"];
-
4 minutes ago, Babylon1984 said:The trigger will activate only if all three mentioned units are absent from its radius. I am using this condition:
!(unit1 inArea thisTrigger) && !(unit2 inArea thisTrigger) && !(unit3 inArea thisTrigger)
You can use this instead:
([unit1, unit2, unit3] findIf { _x inArea thisTrigger }) < 0
8 minutes ago, Babylon1984 said: But if I want to use a command like this one:
x_ inArea thisTrigger
to do the same thing. I had thought of that:[unit1, unit2, unit3] all {!(_x inArea thisTrigger)}
Unfortunately, it doesn't work...
There is no command all.
-
Be careful, findIf returns index of the unit found, not quantity! So your condition,
([unit1, unit2, unit3] findIf {!(_x inArea thisTrigger)}) isEqualTo 0
will be true if only the first unit is not in area.
-
1
-
-
18 minutes ago, pierremgi said:condition: {vehicle _x == CHINOOK} count thisList >0
Slight improvement:
(thisList findIf { (objectParent _x) == CHINOOK }) >= 0
😁
-
1
-
-
10 minutes ago, Babylon1984 said:unit1 inArea thisTrigger && unit2 inArea thisTrigger && unit3 inArea thisTrigger
What if another unit appears? Better solution:
([unit1, unit2, unit3] findIf { !(_x inArea thisTrigger) }) < 0
😉
-
1
-
-
17 hours ago, kibaBG said:The only question I have is how to delete the players data on the server to restart all players positions?
Just remotely execute your function on server side whenever you need this.
-
1
-
-
You can set your CHINOOK to trigger owner and change trigger activation condition to
this and { player in (thisList select 0) }
-
1
-
-
1 hour ago, kibaBG said:Its working fine in editor, but refuse to work on dedicated server ... I wonder where is the problem?
The problem is that a server and clients have their own profile namespaces, therefore you should request data from the server:
// initServer.sqf sendDataToClient = { private ["_data", "_varNames"]; params ["_player"]; _data = []; _varNames = switch (vehicleVarName _player) do { case "kiba3x": { ["KIB_kibaPos", "KIB_kibaRating"] }; case "kavhan": { ["KIB_kavhanPos", "KIB_kavhanRating"] }; default { ["KIB_konalPos", "KIB_konalRating"] }; }; { _data pushBack (profileNamespace getVariable _x); } forEach _varNames; missionNamespace setVariable ["clientData", _data, if (_player == player) then { false } else { owner _player }]; }; // initPlayerLocal.sqf if (isServer) then { [player] call sendDataToClient; } else { [player] remoteExecCall ["sendDataToClient", 2]; }; waitUntil { !(isNil "clientData") }; clientData params ["_position", "_rating"]; clientData = nil; player setPosATL _position; player addRating _rating;
-
1
-
1
-
-
I didn't quite understand what you want, but this is simplified version of your code:
_varName = format ["Pos_Reh_Namuvaka_%1", (floor (random 9)) + 1]; (leader CIV_REHEN_NAMUVAKA_1) setPos (getPos (missionNamespace getVariable _varName));
-
26 minutes ago, hectrol said:forEach CIV_REHEN_NAMUVAKA_1;
CIV_REHEN_NAMUVAKA_1 is not an array, but a group. Revert this code as it was originally.
-
13 hours ago, hectrol said:The addAction does not work
That's because your code is wrong. I guess it should be like this (pay attention to the formatting and readability):
_x addAction [ ":: Rescue - Rescatar :: ", { ["Task_CIV_REHEN_NAMUVAKA_1", "SUCCEEDED"] call BIS_fnc_taskSetState; { _x setCaptive false; _x enableAI "PATH"; _x setUnitPos "AUTO"; } forEach (units CIV_REHEN_NAMUVAKA_1); (units CIV_REHEN_NAMUVAKA_1) joinSilent (group player); } ];
-
-
1 hour ago, avibird 1 said:I would like to add this code to the above removing the red part
If you were able to highlight the code, then you can remove it.
1 hour ago, avibird 1 said:addMissionEventHandler ["entityRespawned",{ params ["_new","_old"]; if (_new isKindOf "CAManBase") then { [_new,face _old] remoteExec ["setFace"]; [_new,speaker _old] remoteExec ["setSpeaker"]; } }];
This code should be executed once, therefore it should be placed, for instance, in initServer.sqf event script.
2 hours ago, avibird 1 said:I can't seem to get the right bracket arrangement to see if this works.
Make the code readable, don't use strings with code (since code highlighting doesn't work in strings), as I demonstrated, and use programmer's editor with code highlighting.
-
-
-
I guess that's because of quotes and apostrophes. Try to invert them.
-
1
-
-
31 minutes ago, Tankbuster said:but the vehicle doesn't get the camonet.
That's because BIS_fnc_initVehicle doesn't work with string.
Try this code snippet:
if (_initstring isEqualType "") then { ([_cargo] + (parseSimpleArray (format ["[%1]", _initstring]))) call BIS_fnc_initVehicle; };
-
1
-
1
-
-
23 minutes ago, avibird 1 said:remove the red and add the blue
You already did so in the second piece of code, just change other params.
24 minutes ago, avibird 1 said:I don't know if it is possible to have to two,"INIT=", toString in the same code
The same for me.
-
1
-
-
@avibird 1, just modify my code:
[ this, "DELAY=", 300, "START=", 60, "PAUSE=", 100, "EXIT=", myExitTrigger2, "INIT=", toString { { doStop _x; } forEach (units _proxyThis); } ] spawn jebus_fnc_main;
-
https://community.bistudio.com/wiki/Arma_3:_Server_Config_File#Server_Options -- forceRotorLibSimulation parameter.
-
[ this, "DELAY=", 300, "START=", 60, "PAUSE=", 100, "EXIT=", myExitTrigger2, "INIT=", toString { _actionParameters = [ "On Knees", { (_this select 0) playMove "Acts_ExecutionVictim_Loop"; }, nil, 1.5, true, true, "", "true", 1.5 ]; { _x disableAI "PATH"; _x addAction _actionParameters; } forEach (units _proxyThis); } ] spawn jebus_fnc_main;
-
1
-
-
Don't know for sure -- I just write scripts in accordance to the BIKI, and it says that if radius is zero or positive, then you should use PositionAGL, otherwise you should use PositionASL.
-
2 minutes ago, redarmy said:Can i ask.. "-1" is signaling a random distance in the area from centre point?
No, according to the BIKI:
Quote-1 can be used for exact waypoint placement
Just noticed, that PositionASL should be used if radius is negative, so this is fixed version:
_wp = BB addWaypoint [AGLToASL (randomPoint call BIS_fnc_randomPosTrigger), -1];
How to use unit classname in addaction title
in ARMA 3 - MISSION EDITING & SCRIPTING
Posted
Looks like you haven't tried my code. Try it -- replace forEach's body.
Pay attention to the second arg for addAction -- just passing the path to the script is enough.