Jump to content

Script problem


Olafo

Recommended Posts

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 by Olafo
Link to comment
Share on other sites

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

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

 

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...