OFPEC Forum
Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting Multiplayer => Topic started by: Binary on 02 Mar 2011, 02:46:26
-
Hi folks,
I'm a complete .sqf/.sqs retard, but understand a few things here and there..
I'm trying to create a simple script that creates persistent smoke (for a drop zone marking) for 10 minutes..
The idea was something in the line of (please don't laugh.. to hard..)
while { true } do
{
smoke1 = "SmokeShellRed" createvehicle getpos smoke1;
smoke2 = "SmokeShellRed" createvehicle getpos smoke2;
smoke3 = "SmokeShellRed" createvehicle getpos smoke3;
smoke4 = "SmokeShellRed" createvehicle getpos smoke4;
sleep 40; // Roughly the time it takes for the smoke to dissapear
};
aaaaand i still haven't figured out how to terminate it from there, not really my highest priority right now.
Using the above, the smoke shows up the first time, but the loop doesn't seem to work..
The script is executed like this:
this exec "persistent-light-smoke.sqf"
As I said, I'm a scripting retard, but would love to understand why this doesn't work, and how to fix it..
Cheers !
-
exec only works for sqs, sqf needs execVM
-
call with null= [] execvm "timesmoke.sqf"
while { time <10*60 } do
{
smoke1 = "SmokeShellRed" createvehicle getpos smoke1;
smoke2 = "SmokeShellRed" createvehicle getpos smoke2;
smoke3 = "SmokeShellRed" createvehicle getpos smoke3;
smoke4 = "SmokeShellRed" createvehicle getpos smoke4;
sleep 40; // Roughly the time it takes for the smoke to dissapear
};
That should run for ten mins + how long the last smoke will run last.
-
Thanks !
Does that mean that the following snippet:
{ time <10*60 }
automaticly begins counting down 10 times 60 seconds??
-
Yes it should just keep running the loop for around 10 minutes then exit.