Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upOutdated Zombie clothing drops function #6907
Comments
This comment has been minimized.
This comment has been minimized.
|
I think this function is really tied to our inability to spawn logical clothing groups through the current item spawn system. Because everything defined in the monster drops json is just randomly selected from, you could just as easily end up with a zombie fireman spawning with 10 pairs of underwear and 6 pairs of fireman gauntlets as you could have one spawn with a coherent set. This requires extra logic to get, and thus the reason for the function. Ideally the item drop algorithms would be reworked in a way to allow for easy addition of "one-of" lists, where the game will only select one item form a given list (and thus would allow the creation of coherent clothing sets in the json files). |
This comment has been minimized.
This comment has been minimized.
|
You mean, like it already does with itemgroups? You just need additional itemgroups to choose from, because you already have them, except defined in code except the JSON. |
This comment has been minimized.
This comment has been minimized.
|
Ok did a bit more digging into it, and the problem looks like it's the monster item spawning code. Right now said code will only spawn one item. We need to be able to spawn multiple items, and we need to be able to apply a little bit of logic to it as well. Ideally a system would be able to have multiple lists for each monster and allow for multiple copies of the same list. So you could say "spawn 3 things from list A, and 1 thing each from list B, C, D, and E". This runs into a bit of a problem with how we currently do monster item groups in the JSON, notably that it won't allow for multiple lists for the same monster (if I understand correctly). Here's what I would suggest to do going forward.
and then in
This would then allow for mass use of templates among similar monsters (for example a generic clothes template would work for 90% of zombies) while still allowing for individual monster customization without the creation of new templates for them. |
i2amroy
added
the
Suggestion (Discuss)
label
Mar 25, 2014
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
I thought we had this for firefighter zeds already, IIRC. I've considered trying to generalize it. @Rivet-the-Zombie, any insight? |
This comment has been minimized.
This comment has been minimized.
|
I gave the firefighter zeds a special function within the clothing drop area of the code that makes them choose from either a full-body costume, or else one each from a set of lists which each contain a section of clothing like tops, pants, boots, etc. |
This comment has been minimized.
This comment has been minimized.
Seems like it works well enough. Any reason we couldn't generalize it, maybe extend to fix the corpse-clothing issues as well? |
SeanMirrsen commentedMar 25, 2014
As per http://smf.cataclysmdda.com/index.php?topic=5884.0
There is a function in mondeath.cpp,
mdeath::zombie:It, as helpfully pointed out by the comment, generates clothing for zombies. The problem is that monster drop items, including zombie clothing, are now defined in an external .JSON file, and editing that file to remove the clothing or reduce its chance of appearence - to, say, prevent extensive clutter - does not work as long as that function is used.
I didn't just outright delete this one and all references to it because it seems to do more than just generate clothing - specifically, it seems to generate cash cards - so I thought I'd make it an issue out of it first, so that maybe someone better acquainted with that code than I can take a look and see if that function is safe to remove now.