Jump to content
Xaels

Minefield Module Respawn

Recommended Posts

Hello,

Please excuse my noobness, I would like to setup a Minefield module that would respawn once all the mines have been disarmed/triggered (practice landmines) for training.
Is this possible?

The goal is not to restart the mission/server as this is intended for a Multiplayer training map.

Thank you!

Share this post


Link to post
Share on other sites

You could create a few minefields and create a trigger. When the trigger fires, move the second minefield to the position of the first.

 

You can practise by using a trigger to move a box from place to place.

.

 

 

 

 

Share this post


Link to post
Share on other sites

This should work:

In init field of the module:

 

if (isServer) then {
  this spawn {
    _mf = _this;
    waitUntil {_mf getVariable ["clientinitdone",FALSE]};
    private _a = parseNumber (_mf getVariable "axisa");
    private _b = parseNumber (_mf getVariable "axisb");
    private _area = [_mf, _a, _b, getdir _mf,(_mf getVariable "shape" == "Rectangle")];
    private _mines = allmines select {_x inArea _area};
    private _minesPosType = +_mines apply {[typeOf _x,getpos _x,[],0]};
    while {true} do {
      waitUntil {sleep 1; allMines select {_x inArea _area} isEqualTo []};
      {deleteVehicle _x} count (nearestobjects [getpos _mf,["groundWeaponHolder","TrainingMine_01_used_F"], sqrt(_a^2 + _b^2)]);
      {createVehicle _x} forEach _minesPosType;  
      waitUntil {sleep 1; allMines select {_x inArea _area} isNotEqualTo []};
    };
  };
};

 

  • Like 3

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×