Jump to content

Recommended Posts

Hello everyone, 

I'm trying to write a small script that gets an truck to place mines along a premade path if waypoints. 

 

But my problem right now is, it only spawns one mine. 

 

Right now im on my cellphone on my way to work, so i can't copy/paste the code, but it's somewhat like this:

 

_mines = 100

 

while{_mines != 0 } do

{

"classname of the mine" createVehicle (getpos truck);

_mines =_mines - 1;

hint format["Remaining Mines: %1",_mines];

sleep 2;

} ;

 

Since the hint tells me, there are less and less mines remaining, the loop seems to work, but there are no more mines appearing. 

 

I've also tried

 

_mine = "classname" createVehicle (getpos truck) ;

sleep 2;

deleteVehicle _mine;

 

to check if the Script manipulates the first mine all the time, but the mine gets spawned, exists for 2 seconds and then ceases exsitance. 

 

To make things real strange - in my eyes- spawning a dozens of infantry units works fine. 

 

I hope someone here can spot and explain my mistake to me. 

 

Please excuse misspellings, my phones autocorrect does it's best to find similar german words and change them :) 

 

Best regards, 

 

wuestenkamm

 

 

 

ps. i'll add the classname i'm using asap

Share this post


Link to post
Share on other sites

createMine is the correct command. A for-from-to loop would be easier too:

_mines = 100;
for "_i" from 1 to _mines do {
	createMine ["ATMines_Range_Mag",getPos truck];
	sleep 2;
};

 

  • Like 1

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

×