[1.8.4.1] TrapTripwireGrenade - How to place Armed Traps via SQF ?

I have a .sqf file for an Ai base on the map which contains some TrapTripwireGrenade in it.
These traps do spawn on every restart but they do not explode if stepped on.

How can I make these TrapTripwireGrenade armed ?


Example from .sqf:
Code:
_vehicle_518 = objNull;
if (true) then
{
  _this = createVehicle ["TrapTripwireGrenade", [11496.147, 11443.168, 0.00039672852], [], 0, "CAN_COLLIDE"];
  _vehicle_518 = _this;
  _this setPos [11496.147, 11443.168, 0.00039672852];
};

I see within the database, if I manually place a trap 'in-game' it comes up as having inventory [["armed",false]] so perhaps I need to set something within the above code to state that it is armed ?


Many thanks for any help you can offer :)
 
Using the ever handy find in files function of Notepad++ I searched for trap and armed in both the dayz_server and the dayz_code and this is what I came up with.
There is actually a folder in Dayz_code that contains your functions to deal with traps



there is a file to Set the traps
@DayZ\Addons\dayz_code\actions\player_setTrap.sqf

which contains this code where you could probably just set the "armed", to true, true and then publish your trap.

Code:
_object setVariable ["armed", false, true];

PVDZ_obj_Publish = [dayz_characterID,_object,[getDir _object, getPosATL _object],[["armed", _object getVariable "armed"]]];
publicVariableServer "PVDZ_obj_Publish";
diag_log [diag_ticktime, __FILE__, "New Networked object, request to save to hive. PVDZ_obj_Publish:", PVDZ_obj_Publish];

player reveal _object;
Here is the code from your actual tripgrenade.sqf file that arms the trap.
_trap setVariable ["armed", true, true];

and of course there are some trap mentions in your dayz_server files update_object and server_monitor.
but that should be enough to get you started on arming them. And of course dont forget to read up on using the "Find in Files" function .. 90% of the time I have no idea when someone asks a question but in about 60 seconds I have the answer ... Notepad++ , its more than just a text editor ...
 
Hi mate, thanks for the reply. I hope you're well :)

I had no idea of that function in notepad++ , it's Awesome !! I will be using it from now on.

It's been a hectic weekend so far and I have not gotten the chance to try it out yet, I'm hoping tomorrow I might be the day :)

Cheers buddy, will post an update regarding the results.
 

delpi

Well-Known Member
I didn't ask that right.

What is the vehicle/building/object that is placed into the game. Is this an object that base Arma knows. For example could I use that object in Epoch, or does it need the files from the 1.8 and up for it to exists.

I'm perfectly comfortable with writing all the functionality code myself, but adding the object is something else.
 
Top