Jump to content

Need help with scripting


Stormscape

Recommended Posts

I've created a new mod, with a traveling merchant that visits

Thirsk

Fort Frotmoth

AND

Raven Rock

 

So how do I write a script so he is only in one location at a time? I know script, if assigned on an NPC will effect all NPCs will thew same ID, So it's three different NPCs that look the same. Now writing a script that causes it to rotate every three game days where he is, in sequence would be hard for me.

Link to comment
Share on other sites

Here's what you'd have to do for the meat of the scripts, though it would be a better mod if you could use the same NPC at all three sites, resulting in the items sold to the NPC being retained throughout the three sites. Although it can't be done easily, I'm quite sure that it can be done with some fancy-pants NPC movement and use of GetPCCell conditionals.

 

For the first one...

 

If ( Day > 1 )

If ( Day <= 11 )

Enable

Else

Disable

 

...For the second one...

 

If ( Day > 11 )

If ( Day <= 21 )

Enable

Else

Disable

 

...And the third...

 

If ( Day > 21 )

Enable

Else

If ( Day == 1)

Enable

Else

Disable

 

...And if you want an idea to go with the mod, then place certain objects that would make the NPC appear as if he were packing up at all three sites, and have them disabled until the gameday is equal to 11 for the first site, 21 for the second site, and 1 for the third site. Have a travel option avaliable with the NPC(s) that would allow you to travel with him when the day is equal to the aforementioned values. If you want to get really complex, then you could always give the NPC distinct schedules for each month and actually have him physically travel to each location a-la the Travelling Merchants plugin.

Link to comment
Share on other sites

Just remember that the code posted is only the meat of each script, meaning that you'll still need those pesky EndIfs, along with Begin and End declarations. If you want to have the items that the PC sells and buys kept the same, you'll have to have only one script, one NPC, and one instance of said NPC. Give the word and I'll see if I can sketch out what would be necessary to get that type of thing to work out.
Link to comment
Share on other sites

That'd be nice, having the items stay the same. except said items are in a container, So buddy can run after thieves and pickpockets with his unique Daedric Dai-Katana that does serious buttkick with abosorb health 200 points per second for 5 seconds. Only Karstaag can survive him.
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...