[quote=“Malkeus, post:46, topic:10715”][quote=“SioxGWolf, post:45, topic:10715”][quote=“Malkeus, post:43, topic:10715”]Jcd’s redesign of the AIM system seems like it would be really easy to use and could easily be ignored if you wanted. But what SioxGWolf said about dragging a body with all it’s items still attached and things inside the pockets/bags…that would be amazing. It’s always felt a little strange when something dies and all their stuff falls off them into a pile on the ground. I hope that’s the direction an inventory overhaul takes.
I’m imagining killing a group of zombies, hauling their (still clothed) corpses into a pile, looting them and then dropping a match on it and walking away. Easy peasy cleanup, minimal keypresses. Combine this with being able to grab a body and drag it in the same way we grab a shopping cart and my immersion factor goes way up.[/quote]
Thanks. Another use if burying a friend, respectfully clothed. Implementing is where it may be hard. I’ed love to work on it, but I can barely set up a decent loop, and I haven’t even looked at how this code works. I can think code, and can use other examples to try to find a solution. For this, all this, it’s all about treating the entity as a container, the clothing is contained in the entity, and the clothinng being a container in a container, where they contain the final object.Or we can forget that. The entity, upon death, will drop a container(the body) that would contain the clothing, which in turn is a container with the objects that were on the entity, along with whatever it was holding. The body,after a time, would then disappear and spawn an entity (zombie). The problem there is then transfering the clothing, the objects in the clothing, that where on the body when it disappeared, back to the entity. If I remove a bullet from the coat pocket, it won’t be there when the zom returns, as well when it dies again. if we arn’t careful, it could lead to an infinite item spawn.
I also see that we make lack the container definition, which would need work.
Can someone translate the idea into code?[/quote]
One method I could see working is if corpses were reworked to be a type of furniture, like lockers. This would obfuscate the contents of the corpse until you closed the range and allow for grabbing and dragging the corpse and it’s contents. This wouldn’t even need an inventory rework to function, but that one change would spiral out into a series of other changes, changing or adding to butcher code to work with the new corpse ‘furniture’ and changing or adding to zombie revival code to reequip the zombie upon revival are two that come to mind right away.
That would be 1 step closer to the outline in my first message (with a couple steps sideways to make it work). This might be a route to pursue before tackling the massive inventory reworking. I feel it would enhance gameplay quite a bit.
I also would like to help with the coding, but I wouldn’t even know where to start for something like this. I can usually puzzle out what a given function is supposed to do (given sufficient time), but when I try to code things myself I get bogged down on simple syntax errors and lack of experience, leading to frustration and giving up…I’ll see what I can do with .json alone, maybe I can break something in such a way that someone will be able to fix it and produce something usable with slightly less headache.
Edit: ok, so I managed to track the creation of corpses to item.cpp but I’m lost in that file. It doesn’t seem to have a straightforward function I can point to and say, “This is what a corpse is.” There’re references and pointers…corpses gets created from mondeath.cpp line 717…confusing. I think what I’d want to do is add a flag to monstergenerator.cpp around line 154 and define it in mondeath.cpp in order to even attempt to test this idea. I can’t figure out how a corpse is actually defined though. I will make a thread to ask about this.[/quote]
Iirc a corpse is a simple item spawned on a monster’s death (every entity is a monster), and named accordingly.
Again iirc, such code resides in mondeath.cpp and handles all relevant cases mostly with flags (no corpse, exploding corpses etc.) with the exception of inventory items that get spawned on death.
As you say, by making a corpse furniture (or even vehicle), you could fix this particular problem. You could then drag corpses with their contents around.
This could be done if at monster death a furniture corpse is spawned at the location and then filled with the items. But this creates several complications:
- Collisions with furn-corpses are very undesirable and have to be addressed.
- Two furnitures cannot coexist in a space. What if the zed dies in the middle of a 3x3 bed?
- Zed regeneration from furniture -> zed needs to get handled.
- Furnitures are static objects. So you need to either define a ‘corpse’ furniture for each monster (bad idea) or just define only one corpse furniture and add naming functionality to it.
- If you use furniture storage space to store the items (i assumed so) you cannot use the inventory system for it. This is problematic b/c then you have to take care of furniture storage space too.
Maybe a better way of doing this would be to create a new ‘corpse’ object that will be able to coexist with furnitures and vehicles and be draggable, but also be an ‘item’ class so that there will be no collisions and other problems with it.
Ofc this might be a bit too much for the effort required. (or i could have overlooked something)