Jump to content

Recommended Posts

Posted

Hey, I'm not very competent with scripting but I've usually been very good with figuring it out myself, but this time i'm a little stumped. I wound up writing this quest so that it needed two instances of wait time, I tried to script the quest like this

Scriptname ARMS03_ColtA102_UpdateGameTime extends Quest  

Quest Property ARMS03_ColtA102  Auto  

Event OnUpdateGameTime()	
	if (ARMS03_ColtA102.GetStage(10))
		UnregisterForUpdateGameTime()
		ARMS03_ColtA102.Setstage(20)
	else
		UnregisterForUpdateGameTime()
		ARMS03_ColtA102.Setstage(40)
	endif
endEVENT

but i keep getting the 'too many arguments passed' error. this setup worked in other if/else examples i've seen, so I'm assuming it's an issue with the UpdateGameTime event?

Posted (edited)

I can only fix what I can see, but get stage has no parameters and it returns a value to compare, that were the too many args error came from

Scriptname ARMS03_ColtA102_UpdateGameTime extends Quest

Quest Property ARMS03_ColtA102  Auto

Event OnUpdateGameTime()
   if (ARMS03_ColtA102.GetStage() == 10)
      ARMS03_ColtA102.Setstage(20)
   else     
      ARMS03_ColtA102.Setstage(40)
   endif
   UnregisterForUpdateGameTime()
EndEvent

instead of calling unregister twice, do it once at the bottom too

 

Edit not sure about this, but the script name and the quest name implies they are this Quest as this Script , which makes the code this.

Scriptname ARMS03_ColtA102_UpdateGameTime extends Quest

Event OnUpdateGameTime()
   if (Self.GetStage() == 10)
      Self.Setstage(20)
   else     
      Self.Setstage(40)
   endif
   Self.UnregisterForUpdateGameTime()
EndEvent

It does not need a property to Self, but take this with a grain of salt, I am not sure of your naming convention 

Edited by PeterMartyr
extra detail
Posted
43 minutes ago, ArmsSamedi said:

it needed two instances of wait time

BTW you can not register for two of the same types of update, on the second call, you just update the existing update,

registerForUpdate(60)

registerForUpadte(30)

means it only has one update that is now in 30 seconds 

  • Recently Browsing   0 members

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