Olafo Posted April 19, 2011 Share Posted April 19, 2011 (edited) I'm trying to do a timer to my New Vegas mod. begin GameMode set fQuestDelayTime to 1; It should repeat the code every 1 second if ( timer < 5 ) set timer to timer+1; At the beginning timer is 0, so after 5 seconds, timer should be 5 else ShowMessage 000Mensaje2; it'll be shown after 5 seconds StopQuest 000Ordenadores endif end However, the message is shown after a randomly number of seconds (always bigger than 5) and i don't understand why. I've tried this alternative: begin GameMode set fQuestDelayTime to 1; It should repat the code every 1 second if ( timer < 5 ) set timer to timer+GetSecondsPassed; else ShowMessage 000Mensaje2; it'll be shown after 5 seconds StopQuest 000Ordenadores endif end But i give a similar result. Thanks for reading Edited April 19, 2011 by Olafo Link to comment Share on other sites More sharing options...
rickerhk Posted April 19, 2011 Share Posted April 19, 2011 First of all, don't use numbers in front of your object names as this causes script problems and failures. If you want to set a quest delay, it's: SetQuestDelay MyQuestName 1 ;One second You don't need to run this function every gamemode block.Also, you can set the delay to 1 second in the Quest object and skip the script function unless there is a reason to toggle the quest between different delays Link to comment Share on other sites More sharing options...
davidlallen Posted April 19, 2011 Share Posted April 19, 2011 This is a very common application. Please see this short guide: http://www.cipscis.com/fallout/tutorials/staged_timers.aspx Link to comment Share on other sites More sharing options...
Olafo Posted April 19, 2011 Author Share Posted April 19, 2011 Thanks for the answering, both of you.I have written this code: ScriptName TimerSCRIPT float timer begin GameMode if ( timer < 5 ) set timer to timer + GetSecondsPassed else ShowMessage Mensaje2 StopQuest Ordenadores endif end The first time that script is active, it works wrong, because the message is shown after a randomly number of seconds. The next times it works well. Any idea? Thanks again. Link to comment Share on other sites More sharing options...
rickerhk Posted April 19, 2011 Share Posted April 19, 2011 The first time that script is active, it works wrong, because the message is shown after a randomly number of seconds. The next times it works well. Any idea? Thanks again.It sounds like a 'dirty' save. If it's the same quest object and you have changed variables around, perhaps. Try loading a save from before you created the quest. Link to comment Share on other sites More sharing options...
Recommended Posts