Jump to content

[Help] How to prevent dead mobs from disappearing


Recommended Posts

Hi!

So I'm thinking of creating a mod where the corpse of a dead mob stays on screen.

 

Usually when a mob dies, like a pigman, catcoon or beefalo, their dead body fades away.

 

Where abouts in the game's code do I find the ability to turn this off so their dead body always stays there?

 

Much like a dead mandrake.

 

Let me know if its possible to change and/or if such a mod already exists.

 

Thank you :)

Link to comment
Share on other sites

I don't think it's impossible but it will require some work, probably. The body that "fades away" isn't a body, it's an animation. So you can't "turn this off".

What you can maybe do is find a way to spawn a body when the creature dies. Maybe by adding the body to the loot of the creature ? So for example, a pigman will drop a "body of dead pigman" when it dies. I suppose, without looking at the code, that it's what the mandrake is doing when she "dies".

It could require some works because you will have to create an anim for each body you want, prefab(s) (depending of what you want, a part of the code could probably be shared by the different "body" prefabs), and add the related body_prefab to the list of the drop of the creature you want.

Mandrake code is probably a good start to see how it's done. Don't ask me about details because i never tried and just have the general idea i gave you here.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...