Jump to content

Sgt. Dennenboom

Member
  • Content Count

    79
  • Joined

  • Last visited

  • Medals

Community Reputation

87 Excellent

3 Followers

About Sgt. Dennenboom

  • Rank
    Corporal

Profile Information

  • Gender
    Male
  • 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. 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]]; };
  2. Sgt. Dennenboom

    Helping with Syntax for CreateUnit

    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;
  3. Sgt. Dennenboom

    Helping with Syntax for CreateUnit

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

    Helping with Syntax for CreateUnit

    My script works just fine for me. Where/how do you execute it? How did you create your markers?
  5. Sgt. Dennenboom

    Helping with Syntax for CreateUnit

    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;
  6. 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;};};
  7. As people have been saying: that second bit of code cannot possibly work, the syntax is completely out of whack
  8. You're actually pretty close: removeAllActions _caller addAction ["Turm 1",{(_this select 0) setPosASL getPosASL telPort_Parkour_tower1; removeAllActions (this select 0);}];
  9. Sgt. Dennenboom

    Simple script shows error

    You made a small mistake in the vehicle init box, so for your situation it would be: _null = [this] execVM "scripts\Auto_Rearm.sqf";
  10. If the unit is in a vehicle, the vehicle command will return the vehicle. If the unit is NOT in a vehicle, the vehicle command will return the unit. _veh = vehicle _unit; if (_veh != _unit) exitWith {hint "The selected player is not in a vehicle!";}; Will therefore exit when the player is currently in a vehicle. Fix: _veh = vehicle _unit; if (_veh == _unit) exitWith {hint "The selected player is not in a vehicle!";};
  11. Sgt. Dennenboom

    making parameter optional with isNil

    These two commands do exactly what you want: param params So the "param" command would be used as such: _adminPlayer = param [0,<DEFAULTVALUE>]; The reason why your second example doesn't work is because "_this" is nil there, so "_this select 0" results in nonsense.
  12. Sgt. Dennenboom

    Move boat into boat rack with script?

    Alright, so "setVehicleCargo" is the proper command, but it returns a boolean value when it's run to show whether the cargo loading was successful. Code run in the init box of an object may never return a value, so just putting the following code in the init box will result in an error: BR1 setvehiclecargo B1; To prevent your code from returning a value, you simply assign it to a local variable that's not used: _null = BR1 setVehicleCargo B1; This code doesn't return a value, so it can be used in an init box. This should work give the result you're looking for PS. You can load vehicles into other vehicles (including racks) in the editor, by just dragging the icon of the cargo vehicle on top of the icon of the carrier vehicle.
  13. {this addMagazineTurret ["140Rnd_30mm_MP_shells_Tracer_Green",[0]];} forEach [1,2]; {this addMagazineTurret ["60Rnd_30mm_APFSDS_shells_Tracer_Green",[0]];} forEach [1,2,3,4]; Adds 2 magazines of MP ammo and 4 magazines of APFSDS ammo to the main turret
×