Jump to content

Safely Adding Invetory to existing vendors without conflict?


phoenixfang

Recommended Posts

Alright, I'm working on a mod, well more or less have finished it, that adds 25mmm Plasma, Pulse, and Incendiary grenade ammo and 40mm HE, Plasma, and Pulse Ammo. I want to add these to existing vendors without causing conflict with other mods. I tried simply making a container that respawns and giving it persistent reference and ownership to a person. The inventory appeared, but after that initial time and seven days of waiting, it didn't respawn, and when I checked the container I hid just under the ground, it hadn't respawned its contents...

 

So how do I add inventory to existing vendors safely?

Link to comment
Share on other sites

There is a bug in respawning in FNV. You may want to attach script to Your chest to ensure it's respawned every now and then. For this to work You need chest to contain leveled list, simply adding items wont work.

 

float nextResetTime

 

begin gamemode

if (nextResetTime < GameDaysPassed)

set nextResetTime to GameDaysPassed + 3 - ((GameDaysPassed - nextResetTime) % 3)

; or whatever You wish (3 stands for number of days between resets)

ResetInventory

endif

end

 

will respawn Your chest every 3 gamedays (AFAIK object script is only called when You're in cell with object, if I'm wrong on this, You may want to create quest script instead with some larger delay so it doesn't hog resources)

Link to comment
Share on other sites

float nextResetTime

 

begin gamemode

if (nextResetTime < GameDaysPassed)

set nextResetTime to GameDaysPassed + 3 - ((GameDaysPassed - nextResetTime) % 3)

ResetInventory

endif

end

 

So if I use that as a script, it'll reset the container every three days?

Sorry, I know diddly squat about scritpting.

Link to comment
Share on other sites

well, there should be

 

scriptname YourScriptName

 

before the code. and yes it should work (if it doesn't, post, and I'll look at it when I'm back home and have access to geck to try it out)

 

script type should be object and You need to attach it to Your chest.

 

 

Also instead of adding chest to each vendor, You can modify their leveled items to contain Your ammo. (however that way You can't choose what which vendor will have (because list are used by most of them), and I'm not sure about AddItemToLeveledList and conflicts it causes when removing mod)

Edited by thc1234
Link to comment
Share on other sites

ScriptName ChestSpawning

 

float nextResetTime

 

begin gamemode

 

if (nextResetTime < GameDaysPassed)

set nextResetTime to GameDaysPassed + 3 - ((GameDaysPassed - nextResetTime) % 3)

ResetInventory

endif

 

end

 

(Though apparently nexus doesn't like showing the tabs)

 

Is exactly what I put, and now its working like a charm. Thanks for the help thc1234, I'll make sure to give you credit in this mod once I put the finishing touches on it, and you'll get a mention in another of mine as I'll use this same script for another of my mods, well close to it anyways.

Edited by phoenixfang
Link to comment
Share on other sites

  • Recently Browsing   0 members

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