Jump to content

Simple mod for gun runners


YanL

Recommended Posts

At least I think is simple.

 

My request is: a option to have ALL the guns and mods for sale in the gun runners, always.

 

My current char is rich, level 44, but have to wait 3 days (more, with bad luck) to buy some of the itens sold by the Runners.

 

I dont want to buy a holorifle or Old Glory in the kiosk, just the guns and mods that exist in the guns runners arsenal DLC.

 

Thanks :)

Edited by YanL
Link to comment
Share on other sites

Yeah, I would think that would be pretty easy in concept, just adding a chunk of code that checks for an item, and if there is < 1 adds it. But it's a lot of cut and pasting.

 

If (GunrunnerContainerVendorChest.getItemCount WeapLaserPistol) < 1
    GunrunnerContainerVendorChest.addItem WeapLaserPistol 1 1
ElseIf (GunrunnerContainerVendorChest.getItemCount WeapLaserRifle) < 1
    GunrunnerContainerVendorChest.addItem WeapLaserRifle 1 1
    etc, etc
EndIf
And keep extending the elseIf statements for each weapon.

 

Alternately you could probably work out something with a formlist, but that would be more complicated and you'd have to copy and paste the items to create the formlist (as I don't think there is a comprehensive one in the base game). Testing the formlist against a conditional statement is easy, but then I guess you'd have to tally to the hits into another formlist and add them to the vendor container. I'm not a scripter so the details elude me, but I would think the concept is workable for any coder.

Link to comment
Share on other sites

Oh, also you may need a functional equivalent of a loop taht will continue to test the vendor chest until there are no more hits (ie there is at least one of every weapon in the chest), or the script ends on the first hit (I think, once again I'm not a scripter). Perhaps some of our resident coders can shed some light on point for you (and me).
Link to comment
Share on other sites

By making the conditional for all but the first weapon "elseif" you are turning everything into a check for a single "true" condition (a "hit"), where upon the test is completed for all the weapons, regardless of their actual state. The first "hit" ends the entire test sequence, so yes ... a loop through for as many weapons as there are in the test is required. That's a relatively large processing overhead for the entire GRA inventory.

 

By changing the "elseif" to simple "if" conditions (with matching "end" statements), then each weapon is tested for, and all the weapons in the list are tested in one pass through the list. Much more efficient as you are going to test all of them anyway.

 

A count of the number of items in a container could be used to determine if the test needs to be run again. But I would also couple that with a timer, as a counter can't tell if there has been a change in the container that altered the contents but left the count the same.

 

Put the list into an array and use a "for" loop to simplify the comparison of the "GunrunnerContainerVendorChest.getItemCount" against the <array[index]> content as the "<item name>".

 

-Dubious-

Edited by dubiousintent
Link to comment
Share on other sites

By making the conditional for all but the first weapon "elseif"

Thanks Dubious, I appreciate the input

 

Put the list into an array and use a "for" loop to simplify the comparison of the "GunrunnerContainerVendorChest.getItemCount" against the <array[index]> content as the "<item name>".

 

-Dubious-

Would you happen to have a link to any fallout specific tutorial(s) on arrays or should I just peruse some standard C tutorials on them?

 

Maybe a better solution is: a refresh in the list each day, instead of 3 days. It´s simple to do?

Not in the standard refreash settings, you get to choose 2 days of the week, but just two. A quest script (set to 24 hours) to reset the vendor lists/chest might work though. There's a actor inventory reset, but I'm not sure if that works on the vendor inventory.

Link to comment
Share on other sites

Re: Array tutorials. Start with the GECK entry, which points out that array variables are added by NVSE 4. As is the "ForEach" loop. There is also a tutorial here. All of which I found by a Google search on "GECK Arrays". (I haven't gotten "into" GECK modding. But the basics of coding apply across most syntax differences.)

 

-Dubious-

Edited by dubiousintent
Link to comment
Share on other sites

Maybe a better solution is: a refresh in the list each day, instead of 3 days. It´s simple to do?

Here is a rar with 3 mods. One refreshes the whole cell the vendor chests are in, and the other two use two different functions to (hopefully) respawn the gun runners vendor chest. They are all 3 set to fire off each day. Try em and see if they work for you (only one at a time).

This probably isn't the best or most elegant way to accomplish this, but my internet was down for a while so I 86'd the research.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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