Vendor Compatibility Project

lyravegalyravega Posts: 338
edited July 2014 in GUTS Community Help
Ignore the previous stuff. Apparently, AG already found a sweeter and easier way.

Lets say, we are trying to add stuff to MERCHANT_GENERAL_INVENTORY spawn class. Create a new spawn class, and call it whatever you want (but not anything that is being used in the game or any mod, simplest example is calling it after your mod for example). In this spawn class, one thing has to be same with MERCHANT_GENERAL_INVENTORY, and it is the name.

So, your file should look like this:
[SPAWNCLASS]
     <STRING>NAME:MERCHANT_GENERAL_INVENTORY
     (stuff that your mod adds are below)
     ...
[/SPAWNCLASS]

So, yeah. Only the name string has to match, and file name(s) should be unique. Anyone used the project stuff before, if you delete the MOD_GENERAL_INVENTORY.DAT from your mods, and change the name string in your spawn classes to "MERCHANT_GENERAL_INVENTORY", you'll effectively add your stuff to that spawn class. I'm moving the entire post to 2nd post, and marking all as spoiler.
I will be migrating to Steam Workshop soon; not to worry, I won't drop non-Steam support, I will just copy/paste stuff from workshop pages instead of writing same but different "article" three times for every mod.

Comments

  • lyravegalyravega Posts: 338
    edited May 2013
    Basically, the idea -making mods that use the same vendor compatible, without combining mods or anything- comes from this topic: A Proposition to Modders (Related to Vendor Spawn Classes). This is the real public implementation part of it. All the necessary info is over there (and a little is over here), and been discussed, and laid out the foundation for a "project", that is now being used by several mods. We still have that 10-mod barrier on our way, but still, if there are players that use any of our mods, they won't have any compatibility problems. If you are interested, keep reading, then refer to 2nd post, and for further questions, ask here or click the idea link above to check some more in-depth discussions.

    Q: How does this work?
    A: Instead of adding stuff to the vendor spawn class (from now on, called main spawn class), we all create new spawn classes (called mod spawn classes), and add stuff in those mod spawn classes. In order to get our stuff shown in game, one last step remains: using a main spawn class that is common to all mods that use this approach to solve the conflicts. Think that, main spawn class has empty slots, and what we modders do is claiming these in order to use them.

    Q: I still don't understand how it works, can you explain a bit further?
    A: The main spawn class contains (currently) 20 mod spawn classes, it doesn't matter if they're used or not. If not used, game will simply ignore them; however if they're used, they'll be added to the list. In other words, main spawn class has references for mod spawn classes, when they are used, they'll also be included in the main one. Since there is only one common and same main spawn class in all the mods, and as all of them use their separate mod spawn classes, there won't be any conflict as long as modders don't use same "slot".

    Q: How can I get this working in my mod?
    A: At the end of this topic, you can get the main spawn class (currently, only have one - and that is for Merchant General Inventory) via download, or copy/paste the code. All you need to do is, refer to 2nd post, pick a number from there (claim a spot), announce it in this topic (so that I can update the list and other people will know), and put all the new stuff in your own, new mod spawn class. All of the mods down there use the same main spawn class, and just one mod spawn class - the one they "reserved". When you include the main spawn class (merchant_general_inventory.dat) along with your mod spawn class (mod_mgi_0xx.dat), all will be fine in the game like those other ones, and your mod will be compatible with other mods using this approach.

    Q: Will other mods need an update when/if I adapt my mod?
    A: No. This is another goal of the project. Since there is one main spawn class to rule them all, any new mods added to that list will be compatible with any other existing/future mods.

    This is a "graph" made in paint, to explain the process further. Note that, example mod spawn classes are old; instead of MOD000, MOD_MGI_000 is used now.
    43tnvr9shh4uzfxfg.jpg?size_id=7

    MERCHANT_GENERAL_INVENTORY (github)
    [SPAWNCLASS]
    	<STRING>NAME:MERCHANT_GENERAL_INVENTORY
    	[OBJECT]
    		<STRING>UNIT:IDENTIFY SCROLL
    		<INTEGER>WEIGHT:-1
    		<INTEGER>RARITY_OVERRIDE:1
    	[/OBJECT]
    	[OBJECT]
    		<STRING>UNIT:WAYPOINT PORTAL SCROLL
    		<INTEGER>WEIGHT:-1
    		<INTEGER>RARITY_OVERRIDE:1
    	[/OBJECT]
    	[OBJECT]
    		<STRING>UNITTYPE:MANAPOTION
    		<INTEGER>WEIGHT:-1
    		<INTEGER>MINCOUNT:9
    		<INTEGER>MAXCOUNT:9
    		<INTEGER>LEVEL_BONUS:-9
    	[/OBJECT]
    	[OBJECT]
    		<STRING>UNITTYPE:MANAPOTION
    		<INTEGER>WEIGHT:-1
    		<INTEGER>MINCOUNT:9
    		<INTEGER>MAXCOUNT:9
    	[/OBJECT]
    	[OBJECT]
    		<STRING>UNITTYPE:MANAPOTION
    		<INTEGER>WEIGHT:-1
    		<INTEGER>MINCOUNT:9
    		<INTEGER>MAXCOUNT:9
    		<INTEGER>LEVEL_BONUS:9
    	[/OBJECT]
    	[OBJECT]
    		<STRING>UNITTYPE:HEALTHPOTION
    		<INTEGER>WEIGHT:-1
    		<INTEGER>MINCOUNT:9
    		<INTEGER>MAXCOUNT:9
    		<INTEGER>LEVEL_BONUS:-9
    	[/OBJECT]
    	[OBJECT]
    		<STRING>UNITTYPE:HEALTHPOTION
    		<INTEGER>WEIGHT:-1
    		<INTEGER>MINCOUNT:9
    		<INTEGER>MAXCOUNT:9
    	[/OBJECT]
    	[OBJECT]
    		<STRING>UNITTYPE:HEALTHPOTION
    		<INTEGER>WEIGHT:-1
    		<INTEGER>MINCOUNT:9
    		<INTEGER>MAXCOUNT:9
    		<INTEGER>LEVEL_BONUS:9
    	[/OBJECT]
    	[OBJECT]
    		<STRING>UNIT:DYNAMITE
    		<INTEGER>WEIGHT:-1
    	[/OBJECT]
    	[OBJECT]
    		<STRING>SPAWNCLASS:MOD_MGI_000
    		<INTEGER>WEIGHT:-1
    	[/OBJECT]
    	[OBJECT]
    		<STRING>SPAWNCLASS:MOD_MGI_001
    		<INTEGER>WEIGHT:-1
    	[/OBJECT]
    	[OBJECT]
    		<STRING>SPAWNCLASS:MOD_MGI_002
    		<INTEGER>WEIGHT:-1
    	[/OBJECT]
    	[OBJECT]
    		<STRING>SPAWNCLASS:MOD_MGI_003
    		<INTEGER>WEIGHT:-1
    	[/OBJECT]
    	[OBJECT]
    		<STRING>SPAWNCLASS:MOD_MGI_004
    		<INTEGER>WEIGHT:-1
    	[/OBJECT]
    	[OBJECT]
    		<STRING>SPAWNCLASS:MOD_MGI_005
    		<INTEGER>WEIGHT:-1
    	[/OBJECT]
    	[OBJECT]
    		<STRING>SPAWNCLASS:MOD_MGI_006
    		<INTEGER>WEIGHT:-1
    	[/OBJECT]
    	[OBJECT]
    		<STRING>SPAWNCLASS:MOD_MGI_007
    		<INTEGER>WEIGHT:-1
    	[/OBJECT]
    	[OBJECT]
    		<STRING>SPAWNCLASS:MOD_MGI_008
    		<INTEGER>WEIGHT:-1
    	[/OBJECT]
    	[OBJECT]
    		<STRING>SPAWNCLASS:MOD_MGI_009
    		<INTEGER>WEIGHT:-1
    	[/OBJECT]
    	[OBJECT]
    		<STRING>SPAWNCLASS:MOD_MGI_010
    		<INTEGER>WEIGHT:-1
    	[/OBJECT]
    	[OBJECT]
    		<STRING>SPAWNCLASS:MOD_MGI_011
    		<INTEGER>WEIGHT:-1
    	[/OBJECT]
    	[OBJECT]
    		<STRING>SPAWNCLASS:MOD_MGI_012
    		<INTEGER>WEIGHT:-1
    	[/OBJECT]
    	[OBJECT]
    		<STRING>SPAWNCLASS:MOD_MGI_013
    		<INTEGER>WEIGHT:-1
    	[/OBJECT]
    	[OBJECT]
    		<STRING>SPAWNCLASS:MOD_MGI_014
    		<INTEGER>WEIGHT:-1
    	[/OBJECT]
    	[OBJECT]
    		<STRING>SPAWNCLASS:MOD_MGI_015
    		<INTEGER>WEIGHT:-1
    	[/OBJECT]
    	[OBJECT]
    		<STRING>SPAWNCLASS:MOD_MGI_016
    		<INTEGER>WEIGHT:-1
    	[/OBJECT]
    	[OBJECT]
    		<STRING>SPAWNCLASS:MOD_MGI_017
    		<INTEGER>WEIGHT:-1
    	[/OBJECT]
    	[OBJECT]
    		<STRING>SPAWNCLASS:MOD_MGI_018
    		<INTEGER>WEIGHT:-1
    	[/OBJECT]
    	[OBJECT]
    		<STRING>SPAWNCLASS:MOD_MGI_019
    		<INTEGER>WEIGHT:-1
    	[/OBJECT]
    [/SPAWNCLASS]
    

    Open & Claimed slots for MERCHANTS_GENERAL_INVENTORY
    MOD_MGI_000: claimed by lyravega (GemBox)
    MOD_MGI_001: claimed by lyravega (Stash Scrolls)
    MOD_MGI_002: claimed by zParticle (The Goldfish Exchange)
    MOD_MGI_003: claimed by thebbandit (Combine Them All)
    MOD_MGI_004: claimed by Jake (Gem Merchants)
    MOD_MGI_005: claimed by Jake (Respec Potions)
    MOD_MGI_006: claimed by thebbandit (Vendor Fish)
    MOD_MGI_007: claimed by naelian (TEA & TL2Rama)
    MOD_MGI_008: claimed by fibero
    MOD_MGI_009:
    MOD_MGI_010:
    MOD_MGI_011:
    MOD_MGI_012:
    MOD_MGI_013:
    MOD_MGI_014:
    MOD_MGI_015:
    MOD_MGI_016:
    MOD_MGI_017:
    MOD_MGI_018:
    MOD_MGI_019:
    I will be migrating to Steam Workshop soon; not to worry, I won't drop non-Steam support, I will just copy/paste stuff from workshop pages instead of writing same but different "article" three times for every mod.
  • My latest mod uses MOD_MGI_005.
  • thebbanditthebbandit Posts: 41
    I propose we also follow this same logic for the MERCHANT_GENERAL_INVENTORY_ACT2 and MERCHANT_GENERAL_INVENTORY_ACT3 files. MOD_MGI2_00x and MOD_MGI3_00x would work fine to start up those two series. If you would be so kind as to add to the first post with those as well. :3 And if we have one reserved from the MGI master file, should we use the same number for our MGI2 and MGI3 files?
  • zParticlezParticle Posts: 211
    As far as I can tell, MERCHANT_GENERAL_INVENTORY_ACT3 isn't used at all and MERCHANT_GENERAL_INVENTORY_ACT2 is only used by an unused vendor Dela [MERCHANT_GEMSACT2]. The only one that's actually used is MERCHANT_GENERAL_INVENTORY_ACT1 which includes the items unique to ACT1 but also calls spawnclass MERCHANT_GENERAL_INVENTORY already.

    So I don't think this is needed, unless where you really wanted to add items were MERCHANT_MAGICSTUFF_ACT2 and MERCHANT_MAGICSTUFF_ACT3 (used in ACT4 as well).
  • thebbanditthebbandit Posts: 41
    You are right, they all call the main MGI file, I must have been looking at an edited version of the merchants. :) Sorry about the confusion.
  • McQuadeMcQuade Posts: 19
    I'm wondering, do you guys know of a way to increase the size of the merchant's inventory page? Right now I have the problem where I'm not able to see everything a merchant has for sale because the merchant calls for too many inventory items, so whichever ones are lower priority are unavailable. If there was a way to scroll down and see more items (which I thought was part of the game at one point) it would really help with this type of mod.
  • lyravegalyravega Posts: 338
    There is, actually. I already planned it for the future, in case there will be a lot of mods using this thing.

    Are you using all of the mods above?
    I will be migrating to Steam Workshop soon; not to worry, I won't drop non-Steam support, I will just copy/paste stuff from workshop pages instead of writing same but different "article" three times for every mod.
  • McQuadeMcQuade Posts: 19
    I'm actually not using any of them, I've combined others from the Workshop like Restat and Reskill Potions, and many of the slots are taken up by the Fish Overhaul mod. Can you let me know how to add more inventory slots on merchants for my own personal mod compilation? I'd truly appreciate it :D
  • lyravegalyravega Posts: 338
    Increase the merchant container size. Then look at the ITEMCOMBINER.LAYOUT, where you can find how to enable pages, and navigate through them.

    I'll put up some files later on though, you can use them too.
    I will be migrating to Steam Workshop soon; not to worry, I won't drop non-Steam support, I will just copy/paste stuff from workshop pages instead of writing same but different "article" three times for every mod.
  • thebbanditthebbandit Posts: 41
    that would be a great workaround for the merchant space issue.
  • naeliannaelian Posts: 122
    Thanks for this project !
    I claim "MOD_MGI_007" for my own mods : The TEA Project and TL2Rama
  • lyravegalyravega Posts: 338
    Added!
    I will be migrating to Steam Workshop soon; not to worry, I won't drop non-Steam support, I will just copy/paste stuff from workshop pages instead of writing same but different "article" three times for every mod.
  • fiberofibero Posts: 8
    Very good idea
    I claim "MOD_MGI_008" for my mods : SEAFOOD and TOME_LIKE_TL
    Best RGDS
  • Hi~ this community compiled vendor is a great idea and I would love to have a spot in MOD_MGI_009 for my Minigun Weapon Mod, Thanks!
  • zParticlezParticle Posts: 211
    Sorry if I misdirected you; I was just referring to the top post; the rest is no longer necessary. Here's an alternate rundown of the process—just apply the concept to your desired vendor instead. If you have any questions let me know.
  • CQuCQu Posts: 21
    Hello,

    you don't need that main file with the already linked Spawnclasses. Everyone can just add their mergable spawnclass additions in a .dat file with different windows file name und same internal name.
Sign In or Register to comment.