Jump to content

Scripting Help Needed


wizardmirth

Recommended Posts

I've created two non-playable amulets that are both quest objects with object scripts attached. Each one OnAdd normally sets a new SetStage, however I want both object scripts (or another script that controls both objects, whatever is simplest) to also ask that IF both amulets are possessed then another SetStage is Set after the normal one (that means two journal pop-ups, one for found 1 amulet and then 1 for found both amulets if the IF statement is true). This means the 2 amulets don’t have to be obtained in a specific order in order to bump the player up to the “Have Both Amulets” Stage. This is sort of like Garridan’s Tears where each tear found updates the journal without relying on a specific order of which tear is found first. I tried looking at the GT object script and copying some of its method but I don’t think mine needs to be that complicated. Or does it? What would be the simplest, most minimal way to accomplish my goal? Thanks.
Link to comment
Share on other sites

I've created two non-playable amulets that are both quest objects with object scripts attached. Each one OnAdd normally sets a new SetStage, however I want both object scripts (or another script that controls both objects, whatever is simplest) to also ask that IF both amulets are possessed then another SetStage is Set after the normal one (that means two journal pop-ups, one for found 1 amulet and then 1 for found both amulets if the IF statement is true). This means the 2 amulets don’t have to be obtained in a specific order in order to bump the player up to the “Have Both Amulets” Stage. This is sort of like Garridan’s Tears where each tear found updates the journal without relying on a specific order of which tear is found first. I tried looking at the GT object script and copying some of its method but I don’t think mine needs to be that complicated. Or does it? What would be the simplest, most minimal way to accomplish my goal? Thanks.

 

I'm not sure why you're using two seperate items that have scripting on them. All this could be controlled by the quest scripting itself. Use Getitemcount as a conditional for setting the stages based on what stage the quest is currently at.

 

IE

short hasamulets

begin gamemode
if hasamulets == 0
  if player.getitemcount <ID of amulet> == 1
   setstage <questname> <stage when one is picked up>
   set hasamulets to 1
  elseif player.getitemcount <ID of other amulet> == 1
   setstage <questname> <stage where player has other amulet, but still has only one>
   set hasamulets to 1
  endif
elseif hasamulets == 1
  if player.getitemcount <ID of amulet> == 1
   setstage <questname> <stage where the player has both>
   set hasamulets to 2
  elseif player.getitemcount <ID of other amulet> == 1
   setstage <questname> <stage where the player has both>
   set hasamulets to 2
  endif
endif
end

 

Using scripts on the items means having to have 3 seperate scripts running and talking to eachother. If you use just a single quest script, in this case you can have all the needed information in one place.

Link to comment
Share on other sites

Thanks, this really helped alot although I had to rewrite the script a little. The stage was set to where player has both amulets upon taking the first one (didn't test it with taking the second first). In my version of your script the "has both amulets" stage is only set once both amulets are actually taken.

 

short hasamulets

begin gamemode
if hasamulets == 0
  if player.getitemcount <ID of amulet 1> == 1
   setstage <questname> <stage when player has amulet 1>
   set hasamulets to 1
  elseif player.getitemcount <ID of amulet 2> == 1
   setstage <questname> <stage where player has amulet 2>
   set hasamulets to 2
  endif
elseif hasamulets == 1
  if player.getitemcount <ID of amulet 2> == 1
   setstage <questname> <stage where player has amulet 2>
   setstage <questname> <stage where the player has both>
   set hasamulets to 3
  endif
elseif hasamulets == 2
  if player.getitemcount <ID of amulet 1> == 1
   setstage <questname> <stage when player has amulet 1>
   setstage <questname> <stage where the player has both>
   set hasamulets to 3
  endif
endif
end

 

Basically, getting each amulet has its own stage, but then having both has a third stage to it. The only problem is that when the second amulet is taken, whichever one is left, the player gets two back to back journal entries. But that's not game breaking and I can probably find a command to add some delay to it.

Link to comment
Share on other sites

Thanks, this really helped alot although I had to rewrite the script a little. The stage was set to where player has both amulets upon taking the first one (didn't test it with taking the second first). In my version of your script the "has both amulets" stage is only set once both amulets are actually taken.

 

short hasamulets

begin gamemode
if hasamulets == 0
  if player.getitemcount <ID of amulet 1> == 1
   setstage <questname> <stage when player has amulet 1>
   set hasamulets to 1
  elseif player.getitemcount <ID of amulet 2> == 1
   setstage <questname> <stage where player has amulet 2>
   set hasamulets to 2
  endif
elseif hasamulets == 1
  if player.getitemcount <ID of amulet 2> == 1
   setstage <questname> <stage where player has amulet 2>
   setstage <questname> <stage where the player has both>
   set hasamulets to 3
  endif
elseif hasamulets == 2
  if player.getitemcount <ID of amulet 1> == 1
   setstage <questname> <stage when player has amulet 1>
   setstage <questname> <stage where the player has both>
   set hasamulets to 3
  endif
endif
end

 

Basically, getting each amulet has its own stage, but then having both has a third stage to it. The only problem is that when the second amulet is taken, whichever one is left, the player gets two back to back journal entries. But that's not game breaking and I can probably find a command to add some delay to it.

You have 2 journal entries because you have it showing the journal entry for the second one as if it was the first. Just make the journal entry for the "both" situation to cover that the second one was recovered, and you can move along to the next. Or jusrt branch off the quest slightly depending on the order of the items obtained, where if you went 1, then 2, you would be at stage 65, if you went for 2 then 1, you would be at stage 70, and have the next part of the quest work with either 65 or 70 as the current stage... or something.

Link to comment
Share on other sites

You have 2 journal entries because you have it showing the journal entry for the second one as if it was the first. Just make the journal entry for the "both" situation to cover that the second one was recovered, and you can move along to the next. Or jusrt branch off the quest slightly depending on the order of the items obtained, where if you went 1, then 2, you would be at stage 65, if you went for 2 then 1, you would be at stage 70, and have the next part of the quest work with either 65 or 70 as the current stage... or something.

 

I could merge them as one custom journal update depending on which amulet was found second. I think that's what you mean. This way there would be four possible entries but the player wil only see two depending on what order amulets are found. Anyway thanks again. That little bit of script has gone a long way!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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