Jump to content

Help with scripting


Recommended Posts

Im wanting to move from stage 87 to stage 90 using script. This is what i have:

 

If (Player.GetInCell (interior cell) == 1)

If (DoOnce5 == 0)

SetStage ADA01 90

Set DoOnce5 to 1

EndIf

EndIf

 

It compiles but doesnt work in the game. Any help appreciated.

Link to comment
Share on other sites

Hmmm. I usually like to run a piece into my script such as

 

setstage tUL665TharnsteinMain 10
player.AddItem "skull01" 30

 

This allows me to know at each step of the way where my problem is. If you have multiple places that look dodgy, I add a multiplyer. For example, the first problem area will add 3, the second problem area will add 30, the third will add 300, the fourth will add 3000, etc. So if your script works all but the second part, you will end up with 3303 skulls (3333 minus the second part, or 30). You can use any numbers you wish, I just found this method to work when writing complex codes.

 

As to your question, I am fairly sure that your problem is that you are using variable counter. I could be wrong. I would try to use a trigzone box in this case. If it is an area that you can't access until the quest is about to update, you could just run:

 

Scriptname tUL665tharnstDrawbridgeTriggerZoneOperatorScript

short triggered

begin onTrigger player

  if triggered == 0
     SetStage ADA01 90
     Set triggered to 1
     disable TrigzoneNameHere
  endif

End

Begin onReset

  if triggered == 1
     disable TrigzoneNameHere
 endif

End

 

You might want to try experimenting with this a bit. I find that when I can't get something that should work to work, If I approach it from a different angle it will work. You can also try to call stage steps, such as

 

 

If (GetStage ADA01 == 89) && (Player.GetInCell (interior cell) == 1)
SetStage ADA01 90
EndIf

 

 

Also, yes, too many begin GameMode blocks is bad. Try to make begin OnActivate and run the scripts on a switch or trigzone or something.

 

Hope this helps,

theuseless

Link to comment
Share on other sites

Well, the fewer beginGameMode the better. The game will constantly try to run these scripts (about once every 3 seconds). I stay away from them like the plague. 99.9 percent of the time, you can get away with using a different trigger. I read something brilliant here that a dude posted, saying that he uses activators either burried under the cell or in a wall etc. Then he runs it as beginOnLoad. That way the script begins when the cell is loaded, providing that the variable conditions are met (such as If (GetStage ADA01 == 89). So in this way he is setting his trigger to activate only when you are at the particular quest stage. Otherwise the activator is invisable (out of viewing range) so it can't be activated on mistake.

 

No, it is not better to split the scripts up into multiple beginGameMode. If you find that you absolutely have to use a beginGameMode, I like to run it on a quest script. I set the quest as initially disabled, the run a string of conditions that when met will reset the quest variables, then deactivate it. If you need an example, I could post my code here.

 

Basically, there are more than one way to skin a mule. I'm not going to be online too much in the next week, but I will try to help you more if you end up needing it.

 

theuseless

Link to comment
Share on other sites

  • Recently Browsing   0 members

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