Jump to content
Sign in to follow this  
Dielos

Infinite clones spawning problem

Recommended Posts

Hello, hope someone can help me with this.

The idea is to for two planes coming from two different directions with 24 units in each plane to parachute over a random area defined by the mission. I tried to insert the paradrop procedure into a small loop, but something is going really wrong. As the paradrop position is random and might be near water, often happens that they parachute over water. So I tried putting the part with the "surfaceiswater" to force the plane to eject the cargo units only when over land. And it does actually work, but the problem is that instead of dropping the 24 units in the cargo, it seems to start dropping an unlimited ammount of units out of the plane (much more than actually available!wink_o.gif until the computer locks due to the CPU load. I don't know where or why they are cloning.

Here the loop:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_Var1=0

_Var2=0

#startloop

?(_plane1 distance getmarkerpos "Conflict" <= 1600):_plane1 SetSpeedMode "normal";_Var1=2

?(_plane2 distance getmarkerpos "Conflict" <= 1600):_plane2 SetSpeedMode "normal";_Var2=2

?((_plane1 distance getmarkerpos "Conflict" <= 700)or _Var1==2)&&(_Var1==0 or _Var1==2)&&(!(surfaceiswater position _plane1)):[_wgrp1,_plane1] exec "parachute.sqs";_Var1=1;[_wgrp2,_plane1] exec "parachute.sqs"

?((_plane2 distance getmarkerpos "Conflict" <= 700)or _Var2==2)&&(_Var2==0 or _Var2==2)&&(!(surfaceiswater position _plane2)):[_rgrp1,_plane2] exec "parachute.sqs";_Var2=1;[_rgrp2,_plane2] exec "parachute.sqs"

goto "startloop"

Maybe I did the IF statement too messy? Is there a simpler way of doing this without the units cloning themselves?

Thanks for any help in advance...

Ok, just solved it by placing "_Var!=1" in the first IF statement... Still I don't understand how they kept spawning. Should it not once the plane is empty not ejecting any more? How do they clone???

Share this post


Link to post
Share on other sites

The loop isn't finished yet. I was just testing the drop. But you're right. I still don't understand why they kept cloning endlessly...

But thanks

Share this post


Link to post
Share on other sites

What is your para.sqs?

it may be in that file that comands the endless spawn, had the same thing happen to me,

if your para script has a line like this

Quote[/b] ]_i = _i + 1

Make sure where the 1 (representing one man) is, says how many guys you want

_i = _i + (your troop count here) without the()

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
Sign in to follow this  

×