How to modify existing things like monsters?

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)

How to modify existing things like monsters?

Postby necros » Thu Nov 18, 2021 4:21 pm

I have this map with a lot of open areas. I'd like to have some flying monsters but the big downer about this is that whenever monsters like cacodemons take damage, they go flying off forever and never seem to recover (you can see them walking forward, and then floating backwards).
I've read that I can get around this by just increasing the mass of the monsters... so I opened up gzdoom.pk3, copied the cacodemon.zs file into my mod folder and changed the mass from 400 to 40000...
problem is when I run zdoom I get this: "File D:/Games/Doom/ne_tall/ is overriding core lump zscript/actors/doom/cacodemon.zs."
Is there a way to modify one aspect of a monster while leaving everything else alone?
necros
 
Joined: 30 Dec 2019
Github ID: necros0

Re: How to modify existing things like monsters?

Postby Blue Shadow » Thu Nov 18, 2021 11:16 pm

necros wrote:Is there a way to modify one aspect of a monster while leaving everything else alone?

Yes, through inheritance.

Code: Select allExpand view
actor HeavyCacodemon : Cacodemon
{
    Mass 40000

That creates a version of the Cacodemon which has a higher mass than the original, while retaining everything else the same.
User avatar
Blue Shadow
 
Joined: 14 Nov 2010
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: How to modify existing things like monsters?

Postby necros » Sat Nov 20, 2021 10:39 pm

Blue Shadow wrote:
necros wrote:Is there a way to modify one aspect of a monster while leaving everything else alone?

Yes, through inheritance.

Code: Select allExpand view
actor HeavyCacodemon : Cacodemon
{
    Mass 40000
}

That creates a version of the Cacodemon which has a higher mass than the original, while retaining everything else the same.


Thanks, I didn't realize the answer was to just create a new monster class. I think I'll have to take a look at the zscript stuff a bit since I've just been using the old decorate method until now. I didn't know it was deprecated!
necros
 
Joined: 30 Dec 2019
Github ID: necros0


Return to Scripting

Who is online

Users browsing this forum: SanyaWaffles and 1 guest