Jump to content

Sgt. Dennenboom

  • Content Count

  • Joined

  • Last visited

  • Medals

Community Reputation

98 Excellent


About Sgt. Dennenboom

  • Rank

Profile Information

  • Gender
  • Location
    Knee-deep in UXO
  • Interests
    Physics & Scripting

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Sgt. Dennenboom

    Taking a screenshot with an action

    Take a look at the screenshot command.
  2. Sgt. Dennenboom

    Launch of supplies by parachute

    @pierremgi You create a new forum reply with a code block and paste in the code with corrupted characters, then cancel the new reply.
  3. Sgt. Dennenboom

    Problem with the array

    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
  4. Sgt. Dennenboom

    setting object to terrain height

    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]);
  5. Sgt. Dennenboom

    Help with creating a array.

    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?
  6. 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.
  7. 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.
  8. Sgt. Dennenboom

    AI multiplier

    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.
  9. Sgt. Dennenboom

    AI multiplier

    Definitely possible, how are the AI created?
  10. 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): If you let the client handle this from init.sqf it would look something like this: 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.
  11. 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.
  12. Sgt. Dennenboom

    [Solved] Debugging with IF statement & isNil

    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.
  13. Sgt. Dennenboom

    Can't we put vehicle weapons in Infantry?

    Adding vehicle weapons to infantry was disabled in the last patch 😭
  14. 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.
  15. 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]]; };