How to add items to Gun Runners Vendor?

Post » Tue Dec 29, 2009 9:22 pm

So I've been looking how to add items to the Gun Runners vendor Vendortron outside of New Vegas. Setting the chest to be owned by the Gun Runners doesn't work neither does giving it to Vendortron. So is there any easy way to add items to the vendor outside of directly editing the vendor chest or using a script to put it in there?
User avatar
Nina Mccormick
 
Posts: 3507
Joined: Mon Sep 18, 2006 5:38 pm

Post » Tue Dec 29, 2009 5:59 pm

Whenever I want to edit what a vendor has I always just go and edit it directly. For instance, I wanted to increase how many weapon mods a vendor carries to increase the odds that I'll find a mod I'm looking for so I went to the mod I wanted, right clicked, and selected use info. This brings up a list of things that that particular item is used in. I then select the one I want and either modify it directly or select use info for that one until I reach the level I want to mod. When I get to the level I'm looking to mod, I add a new item or modify an existing value to do what I want. I've never added any chests or anything like that... Don't even know why people do that stuff to start with.

Example of what I did.
Varmint rifle scope -> right click, select use info
weapon mods tier 1 -> right click, select use info
Vendor Chet -> double click
weapon mods tier 1 in Vendor Chet's trade window -> modify value from 2 to 8 (forces it to choose 8 random items from the list and add them to his trade inventory whenever he resets inventory instead of 2)

You could also add your items in that last part.
Hope that helps.
User avatar
Solina971
 
Posts: 3421
Joined: Thu Mar 29, 2007 6:40 am

Post » Tue Dec 29, 2009 10:55 am

odjntrade i'm sorry to inform you but directly editing vendors is a very dirty way to mod and is highly frowned upon last i checked. It overwrites the original settings replacing them with your own. If everyone were to do this to the same vendor then only the last loaded mod would take effect. By adding your own chest you avoid any incompatibilities with other mods. This is true with any other setting in the GECK, ideally you always want to take the route with the least amount of compatibility issues even if it is a bit more work.
User avatar
YO MAma
 
Posts: 3321
Joined: Thu Dec 21, 2006 8:24 am

Post » Tue Dec 29, 2009 4:19 pm

ok, now I know why they do that.
User avatar
Marie
 
Posts: 3405
Joined: Thu Jun 29, 2006 12:05 am

Post » Tue Dec 29, 2009 8:40 am

Getting back to the original question...I too want to add a new chest to Gunrunners HQ so that I can add a non re-spawning item. I am not sure how to do that. I followed the tutorial but ...there is no NPC to place ownership on the new chest to. How is the Gunrunners inventory chest associated with the Vendertron who does not appear to be a real NPC?


Ugh...I may just have to add it to Alex over at the 188.

Any help would be greatly appreciated.

Thanks.
User avatar
Chantelle Walker
 
Posts: 3385
Joined: Mon Oct 16, 2006 5:56 am

Post » Tue Dec 29, 2009 8:46 pm

Nope, Vendortron is a real creature. You should just be able to drop the container in their cell and Vendortron will sell from it. However, he's located near the join between 2 cells, so you'd need to make sure the box is the right side of the line.
User avatar
Talitha Kukk
 
Posts: 3477
Joined: Sun Oct 08, 2006 1:14 am

Post » Tue Dec 29, 2009 10:27 am

I'm using the following code to add items to a number of vendors. The IMCNMiscStuff item is a leveled list containing the things I want them to sell. The IMCNVendorToken is a piece of dummy armor flagged as unplayable. What happens is, when the vendor's container respawns, the vendor token is removed. The script detects this the next time it executes, and re-adds all of the items, so they respawn along with the container. The advantages of this method are there there is no potential for mod conflicts, and the items are available as soon as the mod is installed. You can also work in special conditions for when the items should be available, like being accepted by the vendor's community, etc.


scn IMCNVendorChestQuestScriptref rTargetbegin gamemode	set rTarget to VendorContainerOldLadyGibsonREF	IF rTarget.getitemcount IMCNVendorToken	ELSE		rTarget.additem IMCNMiscStuff 1		rTarget.additem IMCNVendorToken 1	ENDif	set rTarget to MickMerchantBoxREF	IF rTarget.getitemcount IMCNVendorToken	ELSE		rTarget.additem IMCNMiscStuff 1		rTarget.additem IMCNVendorToken 1	ENDif	set rTarget to VendorContainerJohnsonNashREF	IF rTarget.getitemcount IMCNVendorToken	ELSE		rTarget.additem IMCNMiscStuff 1		rTarget.additem IMCNVendorToken 1	ENDif	set rTarget to VendorContainerCliffBriscoeREF	IF rTarget.getitemcount IMCNVendorToken	ELSE		rTarget.additem IMCNMiscStuff 1		rTarget.additem IMCNVendorToken 1	ENDif	set rTarget to D6F5F	; Carter	IF rTarget.getitemcount IMCNVendorToken	ELSE		rTarget.additem IMCNMiscStuff 1		rTarget.additem IMCNVendorToken 1	ENDif	set rTarget to FD56D	; Blake	IF rTarget.getitemcount IMCNVendorToken	ELSE		rTarget.additem IMCNMiscStuff 1		rTarget.additem IMCNVendorToken 1	ENDif	set rTarget to F1B0D	; Angelo	IF rTarget.getitemcount IMCNVendorToken	ELSE		rTarget.additem IMCNMiscStuff 1		rTarget.additem IMCNVendorToken 1	ENDif	set rTarget to E5F33	; Michelle	IF rTarget.getitemcount IMCNVendorToken	ELSE		rTarget.additem IMCNMiscStuff 1		rTarget.additem IMCNVendorToken 1	ENDif	set rTarget to "104C7A"	; Chet	IF rTarget.getitemcount IMCNVendorToken	ELSE		rTarget.additem IMCNMiscStuff 1		rTarget.additem IMCNVendorToken 1	ENDifend

User avatar
Jason King
 
Posts: 3382
Joined: Tue Jul 17, 2007 2:05 pm

Post » Tue Dec 29, 2009 10:31 am

Nope, Vendortron is a real creature. You should just be able to drop the container in their cell and Vendortron will sell from it. However, he's located near the join between 2 cells, so you'd need to make sure the box is the right side of the line.

I tried that this week, and couldn't find his personal faction. I'll have to look again... my plan was to put a custom container at his location, owned by him.

(I prefer the container method for a few reasons. It lets you create leveled lists so that the additional inventory is random and it avoids creating a script that has to run constantly.)
User avatar
DAVId Bryant
 
Posts: 3366
Joined: Wed Nov 14, 2007 11:41 pm

Post » Tue Dec 29, 2009 12:06 pm

I tried that this week, and couldn't find his personal faction. I'll have to look again... my plan was to put a custom container at his location, owned by him.

(I prefer the container method for a few reasons. It lets you create leveled lists so that the additional inventory is random and it avoids creating a script that has to run constantly.)
Personal faction? He should just be under NPC->GunRunnersVendortron.
User avatar
BEl J
 
Posts: 3397
Joined: Tue Feb 13, 2007 8:12 am

Post » Tue Dec 29, 2009 2:43 pm

I have GECK open at the moment.

The protectron that acts as Vendortron is a creature (base of GunRunnerProtectron). A creature (VendortronRef) where the RefID's merchant container tag points at one of the hidden containers (VendorContainerGunRunnerHQ) in the NVVendorsChestsCell. Creatures do not have personal faction.

Ugh... which goes back to my question over on the Nexus of "http://www.thenexusforums.com/index.php?/topic/260474-additemtoleveledlist/" (or an http://www.thenexusforums.com/index.php?/topic/225998-question-about-additemtoleveledlist/ from Fallout 3).

So I only see two ways to get items added to the VendorTron's list (maybe 3):

1. Add leveled lists or individual items to the base container definition for VendorContainerGunRunnerHQ. Which conflicts horribly with any other mod that attempts to do the same thing. The same would go for replacing him with a real NPC, it would conflict with other mods.

2. Use the AddItem command in a one-time start-up script. The downside is that it's a one-time-deal and the items may vanish when the container resets?

3. Use the always-running (ugh, performance?) script that monitors the container and restocks it with AddItem. At a minimum, the script would need to save the "last manual restocked" date and only run again after 6-12 game hours. And I'm not sure you could use leveled lists to randomize the amount of stock.

Given that he's a creature that sells things, I'm not sure of any other methods.
User avatar
celebrity
 
Posts: 3522
Joined: Mon Jul 02, 2007 12:53 pm

Post » Tue Dec 29, 2009 9:28 am

One idea that I have combines the use of a personally-owned container (linked back to a base-object that is flagged to respawn and populated with either items or level lists) and a script.

I could set it up just like the standard vendor-owned container method, then attach a script to OnLoad for that base container definition. The OnLoad script would check the container, see if there is anything inside it, then move the contents of the custom container over to the vendor's official container.

The script would then only run when you enter the cell or cause the cell to be loaded, which would hopefully happen after the contents get respawned. (Execution order might matter here.)
User avatar
Kate Murrell
 
Posts: 3537
Joined: Mon Oct 16, 2006 4:02 am

Post » Tue Dec 29, 2009 12:31 pm

Looks like http://geck.gamesas.com/index.php/RemoveAllItems is the magic. 000ED4CF is the RefID for this instance of VendorContainerGunRunnerHQ.

wrDENVVendorContGRVendortronRef.RemoveAllItems 000ED4CF


I'll just need to add an item that always exists in the DENV's container at respawn. Maybe a single cap. Which turns the code into:

Begin OnLoad    If (wrDENVVendorContGRVendortronRef.GetItemCount Caps001 > 0)        wrDENVVendorContGRVendortronRef.RemoveAllItems 000ED4CF        ; Display a debug message alert    EndIfEnd


How efficient is "GetItemCount" going to be? Not that it matters much since we're doing all this in OnLoad and not GameMode...

Well, almost... VendorContainerGunRunnerHQ is a base ID. The actual object doesn't have an identifier.
User avatar
DarkGypsy
 
Posts: 3309
Joined: Tue Jan 23, 2007 11:32 am

Post » Tue Dec 29, 2009 3:02 pm

This *almost* works. The items are getting added to the Vendortron, but every time you come back to the cell, it adds the items over and over again on each new visit. I checked a few items (some are unique to my DENV mod):

1: 8001 caps 3 40mmEMP 0 MiniNuke 1 MissileEMP
(went away and rested for 3 days)
2: 8001 caps 11 40mmEMP
3: 8002 caps
(here's where I started noticing and started to keep track)
4: 8003 caps 29 40mmEMP 6 MiniNuke 19 MissileEMP
5: 8004 caps 35 40mmEMP 6 MiniNuke 24 MissileEMP
6: 8005 caps 37 40mmEMP 6 MiniNuke 28 MissileEMP
7: 8006 caps 45 40mmEMP 9 MiniNuke 30 MissileEMP

Not sure yet what is going on, except that the Vendor cell is probably on a different timer. But 40mmEMP and MissileEMP ammo is unique to my mod. So either my container is constantly respawning, or RemoveAllItems is doing something strange.
User avatar
Javier Borjas
 
Posts: 3392
Joined: Tue Nov 13, 2007 6:34 pm

Post » Tue Dec 29, 2009 4:28 pm

After walking away and noodling on it for a bit, I think I know why. I remember something about vendors immediately re-stocking their wares if you completely cleaned them out before? Is the following statement true in Fallout New Vegas?

- If a container that is set to respawn is emptied completely, it will immediately respawn?

If so, then the only adjustment I need is the clue that Imp of the Perverse gave, where they place an "unplayable" item into the container. Unplayable (and quest items) are not affected by RemoveAllItems, but since the container never empties, it should prevent the bug (until the cell resets).
User avatar
yermom
 
Posts: 3323
Joined: Mon Oct 15, 2007 12:56 pm

Post » Tue Dec 29, 2009 7:58 am

I think Imp of the Perverse is probably on the best option, putting the unplayable marker item in the vendor's inventory and monitoring for whether it is still there. But I'm going to combine that with a respawning container in the merchant's cell.

Not exactly sure why I'm seeing the behavior that I'm seeing, but by adding the marker item (via AddItem) in the destination container, I don't think it will matter as much.
User avatar
Pumpkin
 
Posts: 3440
Joined: Sun Jun 25, 2006 10:23 am

Post » Tue Dec 29, 2009 5:41 am

i dont quite get the problem here... you guys should prolly play and check more of my mods :D

1- make a leveled list with all your items, set it up like you want, for example with other leveled lists inside, with a chance none will appear, etc

2- make a quest (give it some id -MyItemDistributionQuest- and check "start game enabled")

3- make a quest script:

scn MyItemDistributionQuestScriptshort doonce ;;this thing makes sure the script only runs once and doesnt clog the container with your stuff aswell as not lagging the gamebegin gamemodeif doonce == 0addleveleditem GunRunnerHQStoreGuns yourLeveledListfullofstuffyouwannasell 3 2 1 ;; adds 2 leveled lists to the gunrunner HQ aka a list inside vendertron's chest at level 3 with a condition of 100%set doonce to 1stopquest MyItemDistributionQuest ;;stops the quest and script from running and frees up performanceendifend


4- attach the script to your new quest

done...

what this does:
it adds an item to a leveled list that is inside vendortronics merchant chest once the game starts, since you do not add it directly to the chest but to the list the chest can still respawn but the items will appear again

if you dont want the items to respawn use:

VendorContainerGunRunnerHQ.additem Mylevellistfullofstuff 1


instead of the additemtoleveldlist line in the above script
since the chest respawns it will reset its content to what its base object includes after 3 days, without the newly added item

if you want to keep the item for ever until its sold:

either add a new chest owned by vendortron which doesnt respawn and is owned by him, afaik it can be in a random location

OR use a quest script variable to determine if the player got the item yet

OR simply extend the above script by the following block:

if player.getitemcount myItem >= 1GunRunnerHQStoreGuns.removeitem myItem 1 endif


OR give the item its own script block ala:

begin onAdd playerGunRunnerHQStoreGuns.removeitem myItem 1 end

User avatar
Nicholas
 
Posts: 3454
Joined: Wed Jul 04, 2007 12:05 am

Post » Tue Dec 29, 2009 5:26 pm

The whole problem is that Vendortron is a critter, not a NPC. Full stop. Critters (creatures) don't have personal faction. So the normal method of creating a container and setting the ownership does not work.
User avatar
Emilie M
 
Posts: 3419
Joined: Fri Mar 16, 2007 9:08 am

Post » Tue Dec 29, 2009 9:21 am

of course do critters have a faction...
you cant set an item to belong espeically to them, thats true but you can set that item to belong to that faction in question...

vendortron sadly isnt even in the gunrunners faction btw, just the robot faction...
hence just add a line to the quest script i offered above which adds vendertron to a new faction (
vendertronico.addtofaction mynewweirdoronicfaction 1
) you create to which you can set ownership of the chest, not that you would need that anyway as there are enough other possibilities of which i listed some above
User avatar
Kit Marsden
 
Posts: 3467
Joined: Thu Jul 19, 2007 2:19 pm

Post » Tue Dec 29, 2009 5:56 am

Interesting, so if the newly created faction has "Allow Sell" checked off, the items will show up in the Vendortron's inventory. Personal factions (created on-the-fly by the game engine for every NPC) must already have "Allow Sell" implicitly set. That's not something that is well documented anywhere from what I've seen. The traditional "http://geck.gamesas.com/index.php/Adding_items_to_vendors" page on the GECK wiki implies that it has to be a personal faction ("select your NPC from the drop down list").

Which makes the following method probably the most efficient:

1. Create a new faction for the Vendortron (i.e. wrDENVVendortronFaction). Relations with other factions don't matter, but you must check off "Allow Sell". Just don't make the new faction hostile to any other faction.

2. Create a new base container, set it to respawn (or leave that unchecked if this is a one-time deal). Populate the container with individual items or leveled lists. In the case of the Vendortron, I suggest adding a certain number of Cap001 items so you can easily see that it's working while testing. The Vendortron has 8000 caps by default, if you add 5 caps with your new base container, it becomes easy to see that the Vendortron now has 8005 caps.

For restocking ammo or other items that come in quantity, I prefer leveled lists with random amounts of ammo because it feels more traditional and natural. Plus it lets me tune things fairly easily so that Gun Runners carry more of the new ammo types then a poorer merchant like Chet. Along with having the leveled list result in greater quantities of ammo as the player levels up.

3. Place a reference object of the container somewhere that it will be affected by cell reset. You could probably just put it in the New Vegas vendor chest's cell and be done with it. I went with the traditional method of putting it in the same cell as the vendor NPC/Creature. Set ownership of the new container to the faction you created in step 1.

4. Create a one-time quest script that runs and adds the Vendortron NPC (RefVendortron) to the custom faction created in step 1.

scn wrDENVStartupScriptshort DoOnceAddVendortronToFactionBegin GameMode	If (DoOnceAddVendortronToFaction == 0)		VendortronRef.AddToFaction wrDENVGunRunnerVendortron 1		Set DoOnceAddVendortronToFaction To 1		;ShowMessage somemessageID	EndIf	StopQuest wrDENVStartupEnd


That's a solution that I like, because it's minimal scripting and you're not running a script on every frame (other then the start-up script). Alternately, instead of attaching a one-time quest script, you could have attached the script to the OnLoad event for the container instead. Which would delay processing until you enter the Vendortron's cell for the first time.

It's also zero conflicts with other mods, which is a big plus as NPCs/Critters/Actors can belong to multiple factions.
User avatar
Sammykins
 
Posts: 3330
Joined: Fri Jun 23, 2006 10:48 am

Post » Tue Dec 29, 2009 6:39 am

Which makes the following method probably the most efficient:

(snip)


I like this method - and it's one I hadn't thought of, so thanks for that. :)

I've recently been wrestling with this same issue for http://www.newvegasnexus.com/downloads/file.php?id=36152, and this is cleaner than the method I had settled on; makes me wish your post had existed before I released an update the other day. Oh well; I'll do another update sometime soon, I guess...


One pretty minor thing; I simplified the script a bit. No need for the DoOnce stuff if the script is only going to run through once anyway:

scn DAVendortronFactionQuestScriptBegin GameMode	VendortronRef.AddToFaction DAVendortronFaction 1	StopQuest DAVendortronFactionQuest	End

User avatar
Cartoon
 
Posts: 3350
Joined: Mon Jun 25, 2007 4:31 pm

Post » Tue Dec 29, 2009 7:19 pm

Good catch about the DoOnce being overkill.

StopQuest is great - if you know that you will never ever add more if/endif blocks to the startup script (like additional vendors, or adding a new ammo type to the lists). It's the preferred solution for start-up quests that need to run once. But if you develop incrementally, with plans for future updates, the users have to jump through hoops to get the new features of the latest update. So instead, I tend to use a new DoOnce block for each additional version (with a new variable to track state) and skip StopQuest.

(I could also just create additional quests and quest scripts for each additional feature added in future updates. It's more work, but more efficient and lets you use StopQuest.)
User avatar
Sierra Ritsuka
 
Posts: 3506
Joined: Mon Dec 11, 2006 7:56 am


Return to Fallout: New Vegas