Monster won't move from high ledge

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.

Monster won't move from high ledge

Postby Hidden Hands » Mon Oct 12, 2020 3:34 pm

It's a standard and well known thing that if a ledge is too high, a monster on the top won't be able to get down from the edge. Is there a way to script something that will change this? I only want it for one monster type. My Petrified Gargoyle is supposed to surprise the player by jumping to life and dropping from the ledge it stands in (its there so the player believes it to merely be decoration.)

As it is now, an ACS script triggers "activate_thing" but the creature, despite being active, is stuck in the alcove in the wall. The alcove is large enough for it to move, because the exact size is used on lower ledge gargoyles which are able to move out. It's just because it's so high up. How can I make it so that these monsters can move off the ledge no matter its height?

Thanks in advance.
You do not have the required permissions to view the files attached to this post.
User avatar
Hidden Hands
Deadite
 
Joined: 21 Sep 2016
Location: London, England

Re: Monster won't move from high ledge

Postby Blue Shadow » Mon Oct 12, 2020 6:34 pm

Try setting the DROPOFF actor flag on the monster.
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: Monster won't move from high ledge

Postby Hidden Hands » Sat Oct 17, 2020 8:37 pm

Blue Shadow wrote:Try setting the DROPOFF actor flag on the monster.

If my monster is only coded in zscript how would I add the drop off or more accurately, how would I base a decorate around it?
User avatar
Hidden Hands
Deadite
 
Joined: 21 Sep 2016
Location: London, England

Re: Monster won't move from high ledge

Postby Player701 » Sat Oct 17, 2020 8:52 pm

Hidden Hands wrote:If my monster is only coded in zscript how would I add the drop off or more accurately, how would I base a decorate around it?

You add flags to the default block:

Code: Select allExpand view
class MyClass
{
    Default
    {
        ...
       
        +DROPOFF;
    }
   
    ...
}


You can also define a DECORATE class inherited from a ZScript class, though I don't see any point in this in your case. There is no special syntax for that, you just use the name of your ZScript class as the parent:

Code: Select allExpand view
actor MyActor : MyZscriptClass
{
    +DROPOFF
}


BTW, do note that inheriting a ZScript class from a DECORATE class is not possible.
User avatar
Player701
 
Joined: 13 May 2009
Location: Russia
Discord: Player701#8214
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support


Return to Scripting

Who is online

Users browsing this forum: No registered users and 0 guests