Jump to content

How to do an "If stage = set amount" statement


Baramoth2

Recommended Posts

Hi , I was wondering how I would pull off a script in which I need to make sure the quest stage is as a certain point.

 

For example:

 

Event OnDeath(Actor killer)

TrethnylDead.SetObjectiveDisplayed(70)

TrethnylDead.SetStage(70)

 

EndEvent

 

Event OnDeath(Actor killer)

TrethnylDead.SetObjectiveDisplayed(71)

TrethnylDead.SetStage(71)

 

EndEvent

 

 

Event OnDeath(Actor killer)

TrethnylDead.SetObjectiveDisplayed(72)

TrethnylDead.SetStage(72)

 

EndEvent

 

I want to make it check the previous stage with an if comparison and then channel the results to one of these 3 branches. thanks for your help in advance :)

Link to comment
Share on other sites

Would it look something like this (this won't work, it says "missing EOF at if")?

 

 

Scriptname ThrethnylDead extends ObjectReference

 

Quest Property TrethnylDead Auto

 

 

 

 

if (getstage=60)

 

Event OnDeath(Actor killer)

TrethnylDead.SetObjectiveDisplayed(70)

TrethnylDead.SetStage(70)

 

EndEvent

 

else if (getstage=61)

 

Event OnDeath(Actor killer)

TrethnylDead.SetObjectiveDisplayed(71)

TrethnylDead.SetStage(71)

EndEvent

else (getstage=62)

 

Event OnDeath(Actor killer)

TrethnylDead.SetObjectiveDisplayed(71)

TrethnylDead.SetStage(71)

EndEvent

endif

Link to comment
Share on other sites

Missing EOF means that you don't have any Events or Functions. That 'if' is in the wrong place.

 

You only need one OnDeath event block and put your logic inside of that.

Can you also please post within [ code ] tags, as it keeps the formatting so is easier to follow.

 

Scriptname ThrethnylDead extends ObjectReference 

Quest Property TrethnylDead Auto 

Event OnDeath(Actor killer)
 int stg = TrethnylDead.getstage()
 if ( stg == 60 )
   TrethnylDead.SetObjectiveDisplayed(70)
   TrethnylDead.SetStage(70)
 elseif ( stg == 61 )
   TrethnylDead.SetObjectiveDisplayed(71)
   TrethnylDead.SetStage(71)
 elseif ( stg == 62 )
   TrethnylDead.SetObjectiveDisplayed(72)
   TrethnylDead.SetStage(72)
 endif
endEvent

I think that's what you meant.

 

BTW, beware of using '=' (an assignment), when you mean '==' (are these equal)

Link to comment
Share on other sites

  • Recently Browsing   0 members

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