Jump to content
Sign in to follow this  
Koni

While {attackinprogress} do { brackets problem

Recommended Posts

I'm trying to create a very simple script that I can turn on and off depending on conditions so I can end up being able to use triggers to state attackinprogress=true so the script starts and attackinprogress=false to stop the script.

while {attackinprogress} do {

nul= execvm "scripts\airportbombs.sqf"};

};

sleep 0.5;

};

};

Tried many ways of brackets and script error always says theres missing ] or } no matter what I kep adding :(

Thanks

Share this post


Link to post
Share on other sites

Hi,

while {attackinprogress} do
{

nul = execvm "scripts\airportbombs.sqf";
sleep 0.5;

};

Is that what you mean?

Share this post


Link to post
Share on other sites

I can't get this right at all.

Ok I have a very simple script that spawns explosions around an air field at predefined locations but I want to be able to add a variable so I can easily start and stop the shelling script.

I have placed named objects a1,a2,a3,a4,a5,a6,a7,a8,a9,a10 around the airfield and I'm using a very basic list of createbombs ....

bomb = "Bo_GBU12_LGB" createVehicle getPos a1;

sleep 2;

bomb = "ARTY_R_227mm_HE" createVehicle getPos a2;

sleep 4;

bomb = "Bo_GBU12_LGB" createVehicle getPos a11;

etc and so one, so the script will just run through and explode a bomb at each location once, which takes around 27 seconds to go from start to finish, and this ultra basic list of createvehicle bombs I have called airportbombs.sqf

So what I want to be able to do is have the script ready to start and stop by using a variable, I think you call it a variable which would be named attackinprogress for the sake of easy identification, so I can have triggers setup to set the variable to true if enemy units are in the trigger area and start the airportbombs.sqf script then have the variable set to false and stop the airportbombs.sqf script if no enemy units are in the trigger area, which I was trying to use attackinprogress=true or attackinprogress=false.

Thanks

Share this post


Link to post
Share on other sites

Have you tried:

attackinprogress=true

attackinprogress=false

in the onAct / onDea trigger fields along with the script from Neo above?

---------- Post added at 03:24 PM ---------- Previous post was at 02:51 PM ----------

this works:

while {true} do
{
if (attackinprogress) then {
_bomb1 = "Bo_GBU12_LGB" createVehicle getPos a1;
sleep 2;
_bomb2 = "Bo_GBU12_LGB" createVehicle getPos a2;
sleep 2;
_bomb3 = "Bo_GBU12_LGB" createVehicle getPos a3;
sleep 2;
};
};

Edited by PELHAM

Share this post


Link to post
Share on other sites

Thanks I've got this working how I wanted it to now.

while {true} do

{

if (attackinprogress) then {

nul = execvm "scripts\airportbombs2.sqf";

sleep 11;

};

};

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  

×