Jump to content

Need some help with scripting


Recommended Posts

I'm new to modding, and I'm trying to get a quest to have 4 NPCs tracked at the same time, and you hand them a sample of a product you're promoting. I have no problems with quest markers, I just can't find a counter to track if I've handed them the sample. I'm not sure if it should be SayToDone or OnAdd. I'd appreciate the help.

 

Here is the script I tried to experiment with.

 

scn 000SamplesScript

short samplesgiven

begin gamemode

if [samplesgiven ==4]
setstage PassSamplesQuest 20
endif

end

 

 

scn 000SamplesGiven

begin SayToDone

set PassSamplesQuest.samplesgiven to [PassSamplesQuest.samplesgiven + 1]

end

 

Link to comment
Share on other sites

Some tips, don't use numbers for editor id's , this will cause you grief later. Start them with aa or aaa or something.

 

Your first quest script is fine, but you only really need the tracking variable in your quest script.

 

 

 
int iSamplesGiven
 

 

You have to talk to the NPC's you want to give the items to I presume, so you can put the tracking script in the [end] scriptlet box of the dialogue text.

 

 

 
set PassSamplesQuest.iSamplesGiven to (PassSamplesQuest.iSamplesGiven + 1)
player.removeitem SampleItem 1
if PassSamplesQuest.iSamplesGiven == 4
setstage PassSamplesQuest 20
endif
 

 

You can use that same scriptlet for all 4 NPC's dialogue responses and you can give them the samples in any order.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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