67435a5bb6e8f

67435a5bb8ba3
1 Guest is here.
 

Topic: Stackable Snacks Read 1406 times  

67435a5bb90c4Yankee Clipper

67435a5bb912e
As those who have played any of Christine's excellent fan missions will have noticed, she has changed the way that snacks get stored in the player's inventory. Stuff like soda, chips, vodka, etc, get stored in the same way as ammo or hypos. Instead of taking up one inventory square for each individual item - like taking 3 squares for 3 cans of soda - all of the items stack together in one square along with a count of the number of items.

I am trying to implement this as a mod for the game itself. I started out with just the soda. I have this so far as a dml:
Code: [Select]
DML1
+ObjProp -91 "CombineType" = Soda Can
+ObjProp -91 "StackCount" = 1

According to dbmod.log, the changes are loading without error. When I play the game, the soda does stack. After I got 2 cans of soda, I tried to use them. That didn't work right. Both cans disappeared with a single use and I only got +1 to my health.

In the vanilla game, the soda has a script associated with it called "Comestible". In Christine's mission, that part is changed to "NVComestible". I tried just changing it in my mod to the same name, but then nothing happens when I try to drink the soda. The soda doesn't disappear, no health - nothing. The part I add when I change the name of the script is:
Code: [Select]
+ObjProp -91 "Scripts"
{
"Script 0" NVComestible
}

I'm guessing this means her mod is loading some script that my mod doesn't know anything about. I gave it the name, but the script must not be there in the vanilla version of the game.

Am I diagnosing the problem correctly, and if so, how do I fix it? Where would the script be located?
« Last Edit: 12. July 2014, 01:31:42 by Yankee Clipper »
67435a5bb92e8
It might be that you need to load the NVScripts package, to run the NVComestible script, which prevents the whole stack of sodas from vaporizing in a single use. I don't know how it's done through dmls, but in Shocked you would load a map and select File -> Script -> Load Script.

BTW Infinite uses this system for food, see if it helps! Soda, juice and chips stack into "A snack." (+1 HP) while the 3 alcoholic beverages stack into "A drink." (+1 MP).

Engine features -> Combine type: snack
Engine features -> Stack count: 1
Scripts -> NVComestible
Script -> Objlist Arg: NVComestibleHeal=1

Engine features -> Combine type: drink
Engine features -> Stack count: 1
Scripts -> NVComestible
Script -> Objlist Arg: NVComestiblePsi=1; NVComestibleHeal=0

67435a5bb9436Yankee Clipper

67435a5bb9481
It looks like the problem is I'm not running ADaOB, and NVScript does not get loaded by default in the vanilla maps. Voodoo47 had a mod where he was hacking that force field in MedSci so you could turn it on and off and in that one he said that if you wanted it to work with vanilla, you had to load each mission file into ShockEd, load NVScript, and then save the mission.

https://www.systemshock.org/index.php?topic=6608.0

I just finished up doing that, and it did the trick. Wish there was a way to do it with a dml.

When you combine all your snacks into one and all your alcohol into another, how does the game know what icon to use?
67435a5bb957f
I had similar problems with food not working in the unstripped maps, because those didn't have the NVScripts. If I may suggest, make two versions of your mod: Adaob (dml) and Vanilla (+maps). When items with different icons stack into the same pile, they assume the icon of the first one collected.

67435a5bb964fYankee Clipper

67435a5bb9698
If I may suggest, make two versions of your mod

That's a good idea. I tried a variation on it, where I had the tweaked maps in one file and the dmls in another. The dml would be the same anyway in either case. But, the maps are over the site's upload file size limit. The come out to 15mb, while the limit is a little over 10mb.
67435a5bb9843
I have added you to the "Contributor" group which raises your upload limit per post to 100MB. Although I would like you to rethink whether this mod justifies containing modified maps and how this affects compatibility between mods.

67435a5bb996aYankee Clipper

67435a5bb99b3
I thought about that when I hit the limit. I hadn't initially realized just how big all the map files were. My thought was to have the maps as a separate download. That way everyone could just download the mod itself and then only those that would need it would download the separate maps file. But, I want to respect your opinion. If you think adding such a big file for this little mod is questionable, I won't do it.

I don't think I follow you regarding the compatibility between mods comment. Are you saying that modders in general should use ADaOB as a base?

Also, after thinking about this for a bit, it occurred to me that maybe this could be a job for future versions of your SS2Tool. If it were to replace the vanilla maps with maps that already had NVScript loaded, the installation would become more mod friendly in general.

67435a5bb9cd4voodoo47

67435a5bb9d28
maybe this could be a job for future versions of your SS2Tool. If it were to replace the vanilla maps with maps that already had NVScript loaded
this is actually planned, so my recommendation would be to leave the maps alone for now.
67435a5bb9ff2
I don't think I follow you regarding the compatibility between mods comment. Are you saying that modders in general should use ADaOB as a base?
That was aimed at future modding. More mods like yours may be developed in future and not each of them should contain a modified map set. It will be preferable to have a central way of distributing the maps and then adding various mods on top. SS2Tool will indeed provide a way to do this.

67435a5bba090voodoo47

67435a5bba0da
to make it short, just make dml mods whenever you can, and let us worry about the rest.
1 Guest is here.
but we have been known to venture into artsier territory, because we’re very, very smart.
Contact SMF 2.0.19 | SMF © 2016, Simple Machines | Terms and Policies
FEEP
67435a5bba59c