-
Content Count
93 -
Joined
-
Last visited
-
Medals
Posts posted by Sgt. Dennenboom
-
-
@pierremgi You create a new forum reply with a code block and paste in the code with corrupted characters, then cancel the new reply.
- 1
- 1
-
forEach returns the value of the last codeblock it runs which is why it returns true if your BMP cannot move.
Like gc8 says: use the count command so your condition looks like this:
{canMove _x} count [ZU_1,zu_2,ZU_3,BMP_ISIS] == 0
-
Maybe try replacing this:
obj1 setpos (_unit modelToWorld [0,_SpawnDist,0]); obj1 setdir (getdir player); obj1 setPosATL (getPosATL obj1);
With this:
obj1 setDir getDir player; obj1 setPos (player getRelPos [_SpawnDist,0]);
-
I'm sure that what you are asking for is possible, I'm just not sure I understand what you are asking...
In your example, what is "coolstuff"?- Is it a classname which you use to retrieve all objects with that class?
- Is it a variable name that refers to a (pre-made) array of objects?
- Or is it a string parameter that is used inside SomeFunction to run specific functionality?
-
I'm not sure how your graphical interface works, but I guess if both admins place flags there will be two pairs of flags.
You could either make it so the other admin cannot place flags when they already exist, or so that the new pair of flags replace the old pair.
Determining the best solution would require your interface I guess.
-
The problem is the arrayFlags variable. That global variable only exists on the client that created the flags (your PC), not on everybody elses.
Let's restructure your code by passing along the teleport target flag as an argument in the addAction parameters.
_actionCode = { params ["_actionObject","_actionCaller","_actionID","_teleportTarget"]; _actionCaller setPos getPos _teleportTarget; }; // flag 1 to flag 2 [arrayFlags # 0, [_arrayTextFlag # 1, _actionCode, arrayFlags # 1]] remoteExec ["addAction",0,false]; // "#" is the same as a simple "select" // flag 2 to flag 1 [arrayFlags # 1, [_arrayTextFlag # 0, _actionCode, arrayFlags # 0]] remoteExec ["addAction",0,false];
And beyond the scope of your question just for fun, let's make it so you can have many flags instead of 2, all allowing teleportation to every other one:
arrayFlags = [flag1,flag2,flag3,flag4]; _arrayTextFlag = ["flag 1","flag 2","flag 3","flag 4"]; _actionCode = { params ["_actionObject","_actionCaller","_actionID","_teleportTarget"]; _actionCaller setPos getPos _teleportTarget; }; { _currentFlag = _x; { _targetFlag = _x; if (_targetFlag != _currentFlag) then { [_currentFlag, [_arrayTextFlag # _forEachIndex, _actionCode, _targetFlag]] remoteExec ["addAction",0,false]; }; } forEach arrayFlags; } forEach arrayFlags;
You could also make this entire thing a function that is called locally to reduce network traffic (not really important for this tbh), but to cleanly do that you need some knowledge of the Functions Library.
-
You could do something like this:
_multiplier = if (count allPlayers >= 4) then {2} else {1}; // You could make a mathematical equation instead of just an if statement SP_Missions_Squad_Members = (3 + (floor random 3 + 4)) * _multiplier; // random results in a decimal value instead of an integer, which is wonky to use in a loop so it is rounded for "_x" from 0 to SP_Missions_Squad_Members do ....
There are many ways to achieve what you want, but this snippet uses the number of in-game players at the moment the script runs to increase the amount of spawned enemies.
- 2
-
Definitely possible, how are the AI created?
- 1
-
BIS_fnc_holdActionAdd needs to be executed on every client.
If you let the server handle this from init.sqf it would look something like this (the isServer check is critical here, or you'd end up with the same problem of having duplicate actions):
Spoiler// init.sqf if (isServer) then { [ Truck, "<t color='#58D68D'>Enganchar UH60</t>", "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_loaddevice_ca.paa", "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_loaddevice_ca.paa", "(_this distance _target < 3) && (Truck_Bar distance Heli_1 < 10)", "(_caller distance _target < 3) && (Truck_Bar distance Heli_1 < 10)", {}, {}, { params ["_target","_caller","_actionId","_arguments","_progress","_maxProgress"]; [Truck,_actionId] call BIS_fnc_holdActionRemove; _null = ["Scripts\Interacciones\Remolcador\Soltar_Heli_1.sqf","BIS_fnc_execVM",false,false] spawn BIS_fnc_MP; }, {}, [], 5, 6, true, false ] remoteExec ["BIS_fnc_holdActionAdd",0,Truck]; };
If you let the client handle this from init.sqf it would look something like this:
Spoiler// init.sqf [ Truck, "<t color='#58D68D'>Enganchar UH60</t>", "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_loaddevice_ca.paa", "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_loaddevice_ca.paa", "(_this distance _target < 3) && (Truck_Bar distance Heli_1 < 10)", "(_caller distance _target < 3) && (Truck_Bar distance Heli_1 < 10)", {}, {}, { params ["_target","_caller","_actionId","_arguments","_progress","_maxProgress"]; [Truck,_actionId] call BIS_fnc_holdActionRemove; _null = ["Scripts\Interacciones\Remolcador\Soltar_Heli_1.sqf","BIS_fnc_execVM",false,false] spawn BIS_fnc_MP; }, {}, [], 5, 6, true, false ] call BIS_fnc_holdActionAdd;
There are better/more elegant solutions for how to call your function and what is happening inside it, but this should quickly do the trick using your own script.
-
The server and every client calls init.sqf when joining, and your script broadcasts the command to everyone so you get duplicates.
You could either remoteExec your command from the server (with the JIP parameter set to true), or call it from init.sqf or initPlayerLocal.sqf instead of remoteExec.
-
You are using the isNil command wrong. You can use it to check the existence of variables by supplying the variable name, or the existing of the result of code by supplying a code block.
So using the former:
("-----Test-----") call BIS_fnc_log; _b = '< my valid steam UID>' call fn_getUIDPermissions; _c = if (isNil "_b") then {false} else {true}; // essentially the same as _c = !isNil "_b"; (format ["-----Test %1 ...", _c]) call BIS_fnc_log;
And using the latter:
("-----Test-----") call BIS_fnc_log; _c = !isNil {'< my valid steam UID>' call fn_getUIDPermissions}; (format ["-----Test %1 ...", _c]) call BIS_fnc_log;
Format also takes care of converting boolean _c into a string, so no need to do the weird string "true"/"false" definition.
- 1
-
Adding vehicle weapons to infantry was disabled in the last patch 😭
-
You're going to have to create a graph model of your maze, after which you can apply shortest pathfinding algorithms such as A*.
These algorithms can be quite resource-intensive so you definitely do not want to run them on each frame.I'm actually working on a dynamic graph-model representation of Arma's road systems, but my scripts are so specific for that that I don't think they'd be of much use for you.
-
You can use the moveOut command to safely kick a unit from a vehicle, but then you need a way to determine which units need to be kicked.
The fullCrew command returns an array which also gives the cargo index for each unit in the vehicle.
You can compare that to your list of cargo indexes like such (quick and dirty):
_ZamakTrans = nearestObjects [ _this select 0,["Truck_02_transport_base_F"],25]; if (count _ZamakTrans > 0) then { target = _ZamakTrans select 0; // Kick units from cargo slots and lock them _lockIndexes = [2,3,4,5,6,7]; {if ((_x select 2) in _lockIndexes) then {moveOut (_x select 0)};} forEach fullCrew target; {target lockCargo [_x,true];} forEach _lockIndexes // Attach box box attachTo [target,[0,0.25,-0.15]]; box setVectorDirAndUp [[1,0,0],[0,0,1]]; };
- 1
- 1
-
Wait you used something else than map markers to indicate where you wanted to spawn enemies @voidbyte?
The "getMarkerPos" command only works for map markers, not for objects. If you're using some kind of helper object to indicate the spots do:
_spawnObjectArray = [opfor_0,opfor_1,opfor_2,opfor_3,opfor_4,opfor_5]; _unitClass = "O_Survivor_F"; { (createGroup EAST) createUnit [_unitClass,getPos _x,[],0,"NONE"]; } forEach _spawnObjectArray;
The createUnit command with the "NONE" special argument places the unit on an approximate position at a free spot near that position.
To make the command spawn the unit exactly where you want, either change "NONE" to "CAN_COLLIDE", or set the position of the unit after it was spawned, like such:
_spawnObjectArray = [opfor_0,opfor_1,opfor_2,opfor_3,opfor_4,opfor_5]; _unitClass = "O_Survivor_F"; { _unit = (createGroup EAST) createUnit [_unitClass,[0,0,0],[],0,"NONE"]; _unit setPosASL getPosASL _x; (getPosASL is used because it's accurate inside buildings too, unlike the standard getPos) } forEach _spawnObjectArray;
- 1
-
I don't think any of these mods would affect this extremely basic script, so what I'm currently thinking of is that your markers are defined wrong.
Execute the following script in the debug console so you can see the positions of your markers:
["opfor_0", "opfor_1", "opfor_2", "opfor_3", "opfor_4", "opfor_5"] apply {getMarkerPos _x};
If these positions are [0,0,0], then the markers don't actually exist and your units spawn there.
-
My script works just fine for me.
Where/how do you execute it?
How did you create your markers?
-
You're making small but different syntax errors with everything you're trying to do, read the createUnit page more carefully.
Your first code-block is nonsense, but you figured that out yourself too.
Your second code-block uses "O_Survivor" as the class, which doesn't exist (It's ""O_Survivor_F")
Your third code-block has uses a marker as the spawn point instead of a position.
Here's how you achieve what you want to achieve:
_markerArray = ["opfor_0", "opfor_1", "opfor_2", "opfor_3", "opfor_4", "opfor_5"]; _unitClass = "O_Survivor_F"; { (createGroup EAST) createUnit [_unitClass,getMarkerPos _x,[],0,"NONE"]; } forEach _markerArray;
- 3
-
But to correct the code you're using (without regarding whether it's the best solution or not):
In editor object init field:
_null = this spawn {while {alive _this} do {_this setFuel 1; sleep 60;};};
- 4
- 1
-
SpoilerIt is a little puzzle to get the alien to communicate with you.
You have to hit their signal peaks with whatever noise/music to get them to switch frequency.
Transmitting at their new signal, and then stopping will then make them transmit a different frequency.
Use trial-and-error to find which of their peaks you need to hit. If you choose the wrong one, their pattern resets and you can try anew.
When you complete this little frequency hopping dance, you'll get the vision
-
As people have been saying: that second bit of code cannot possibly work, the syntax is completely out of whack
-
You're actually pretty close:
_caller addAction ["Turm 1",{(_this select 0) setPosASL getPosASL telPort_Parkour_tower1; removeAllActions (this select 0);}];
- 1
-
SpoilerWhen you see the EMP pulses that disable your device continuously, it means you're standing too close.
You don't need to be extremely close to be able to communicate with the aliens- 1
-
You made a small mistake in the vehicle init box, so for your situation it would be:
_null = [this] execVM "scripts\Auto_Rearm.sqf";
- 1
- 1
Taking a screenshot with an action
in ARMA 3 - MISSION EDITING & SCRIPTING
Posted
Take a look at the screenshot command.