I have a FOR loop I want to run every second. How is this done. I have used fWait fTimer ect.. It seems the game language has no sleep function or pause nor delay. How do I get my code to repeat on a timed/delayed basis?
Basically I want a timer above the players head to count down for a quest I am doing How/Is this possible ?
fTimer fWait cannot get them to work ?
Débuté par
Guest_Leopard73_*
, déc. 17 2009 06:31
#1
Guest_Leopard73_*
Posté 17 décembre 2009 - 06:31
Guest_Leopard73_*
#2
Posté 17 décembre 2009 - 10:34
There's no way to pause execution of code. A script will run essentially instantaneously. Commands, such as CommandWait are actions taken by creatures, not the script itself.
The only way to delay anything in the scripting language is the DelayEvent() function. You delay an event passed to an object, and in the script for that object you check for the event type then put whatever code you want, possibly another delayed event to the same object.
Keep in mind that the timing on this is not exact, as execution of the delayed event is an ai update, and therefore will happen whenever the game gets around to it. If there are a lot of things happening, such as a big combat, the event may be delayed longer than the time you enter..
The only way to delay anything in the scripting language is the DelayEvent() function. You delay an event passed to an object, and in the script for that object you check for the event type then put whatever code you want, possibly another delayed event to the same object.
Keep in mind that the timing on this is not exact, as execution of the delayed event is an ai update, and therefore will happen whenever the game gets around to it. If there are a lot of things happening, such as a big combat, the event may be delayed longer than the time you enter..





Retour en haut






