Jump to content

Begin OnAdd Player script question


Razakel

Recommended Posts

I'm making a quest mod and for the most part I want it to update when certain items are picked up. Thus far I've been using:

 

scn (itemname)Script

 

Begin OnAdd Player

 

SetStage (questname) 10

 

end

 

It works, but it occured to me that it's far too simple and somewhere down the track it's going to be a problem. Am I right? Will this do or do I need to add more lines? (I should mention that it's impossible to get the items out of quest order).

Link to comment
Share on other sites

well, there is always the solution of this

 

scn (itemname)Script

 

short (nextiteminsequence)

Begin onAdd player

(Tab)If get.(Previousiteminsequnce) == 1

(Tab)(Tab)setstage (questname) 10

(Tab)(Tab)set.(nextiteminsequence) to 1

(Tab)Endif

END

 

Note: for all of the items to work together, then you should have all of the scripts for the quest  in one qwuest if you get what i mean, if you don't then you just need to have multiple blocks inside of your script, and have the one script linked to the quest so that it should look like this:

 

scn pickedupitemsquestscript

 

short (iteminsequence1)

Short (iteminsequence2)

short (iteminsequence3)

 

Begin onAdd player

(Tab) setstage (questname) 10

(Tab)set.(iteminsequence1) to 1

END

 

Begin onAdd player

(Tab)If get.(iteminsequence1) == 1

(Tab)(Tab)setstage (questname) 11

(Tab)(Tab)set.(iteminsequence2) to 1

(Tab)Endif

END

 

Begin onAdd player

(Tab)If get.(iteminsequence2) == 1

(Tab)(Tab)setstage (questname) 12

(Tab)(Tab)set.(iteminsequence3) to 1

(Tab)Endif

END

 

Note2: this will not prevent the item from being picked up, but the quest will not advance unless the items preceeding it are already picked up as well

Link to comment
Share on other sites

Would this work equally as well? Making this mod is pretty much my first experience with scripting so I'm just taking what I can from other quests and trying to make it fit in with mine

 

scn 1aDarkLairContractScript

 

Begin OnAdd Player

 

If (GetStage 1aDarkLairQuest <20)

SetStage 1aDarkLairQuest 20

endif

 

end

Link to comment
Share on other sites

I have found that i come across many problems with the getstage, but you are welcome to try, the new edited one that i have just done in the above post should work, and you can just input your own names and refid's into it, but another thing that i just realized might be a problem with your script... when you have not yet started the quest, it is at 0, so when you accidently pick the item up, then it will automatically put you at 20, therefore bypassing all the rest of the quest before it, mine does not allow for that, because it will not advance the quest without you haveing all of the previous items to it.
Link to comment
Share on other sites

lol i already got it for him, my first post worked like a charm or so he told me http://www.thenexusforums.com/public/style_emoticons/dark/biggrin.gif (not in those exact words)
Link to comment
Share on other sites

Yeah, I was looking at your script though, and it looks like a lot of excess code that doesn't to be entered. I've never had a problem with GetStage, so I tend to use it a lot.

 

Here's an example of what my script would look like:

 

ScriptName itempickup

 

short DoOnce

 

begin gamemode

 

if DoOnce == 0 && player.GetItemCount (Item1) == 1 && player.GetItemCount (Item2) == 1 && GetStage (QuestName) == 10

SetStage (QuestName) 20

Set DoOnce to 1

endif

 

End

 

This script allows you fit multiple items (or just one if you want to) into one block there saving time and resources on your system. However, if the other code worked for you, than stick with it. This is just another alternative if you want to try it. This script also allows you to get the items in any order you want.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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