how multiply an already working mine spawner/despawner ?

  1. 8 years ago

    hi all guys !

    for optimization purposes, i'm trying to create a trigger that spawn/despawn mines based on distance.
    i already got it working for one mine here it is :

    a simple trigger 50x50
    activating condition : "anybody " "present"
    on activation: hint "mine created at flag";mi2 = createMine ["APERSBoundingMine", position flag1, [], 0];
    on deactivation: deleteVehicle mi2;hint "mine at flag deleted";

    it works perfectly (it generate a specified type of mine at the location of the trigger if anyone gets in its range, and delete it when noone is there)....but i need to do this for a minefield, lets say 50 mines randomly (or not randomly, its ok too) placed in the trigger area.

    i'm sorry to bore you guys, but really have no idea how do this !

    really thanks for any help !

  2. Hi ! Im trying to apply the suggestion aboit arrays...but seems im doing something wrong ! Any ideas ? Thanks guys !

  3. for "_i" from 0 to 4 do {
        // Your mine placement code
    };

    Would place 5 mines (4 + 1 because we're starting at 0). I'm guessing that the createMine has a radius parameter to spread them out randomly.

  4. Huge thanks man !!
    Anorher step in the right direction !
    While it actually not works as intended (its fault of my part of code ) i will try to adapt it !
    Really thanks ! Will let you know about my progress towards a minefield with no fps impact !

 

or Sign Up to reply!