bravo 6 0 Posted August 2, 2007 when i try to use this command sleep 1 in a file.sqf and run it in edior, calling the file i have an error.. why? shouldn't it recognize it in arma?! Share this post Link to post Share on other sites
Taurus 20 Posted August 2, 2007 Only spawn and execVM scripts(.sqf) can be slept for x seconds. If you did something like: ["zomg"] call myFunction This doesn't starta a thread for it and therefor can not be paused when entered in init-lines or on act for triggers. Share this post Link to post Share on other sites
bravo 6 0 Posted August 2, 2007 ok i think i understand... in the .sqs files we could delay the cameras for ~x (x secounds) i was hoping to hold in sqf aswell with the sleep. oh well.. thanks anyway. Share this post Link to post Share on other sites
Taurus 20 Posted August 2, 2007 just change "call" to either "execVM" or "spawn" and it'll work. Share this post Link to post Share on other sites
bravo 6 0 Posted August 2, 2007 just change "call" to either "execVM" or "spawn" and it'll work. i just used the "execVM" instead "exec" thanks! ps- i really dont understand this language at all dont know how people can understand these kinda tricks Share this post Link to post Share on other sites
=BFP=Cheetah 0 Posted August 3, 2007 Either use execVM and assign it to a variable, or use: call { [] execVM "script.sqf"; }; Both should work, however I prefer the 2nd option. If you need more details, take a look at my Basics of SQF tutorial, you can find it on www.ofpec.com. Share this post Link to post Share on other sites
Taurus 20 Posted August 3, 2007 Yeah! That tutorial of yours is a good start! I was looking for it but didn't find it as I was to link it in this thread. I've looked it through and I give it a Share this post Link to post Share on other sites
zaphod 0 Posted August 4, 2007 instead of creating a file.sqf and execute it as virtual machine, you can put it's content in a function body like: yourfunction={sqf-contents....}; and precompiling the file containing these functions inside init.sqf on top. from this point you can call/spawn your programmed functions at any point in the game. call functions without sleeps, [] spawn functions with sleeps, then your problems are gone and all scripts are stored as functions in a single file. Regards, zap Share this post Link to post Share on other sites