Jumping Enemies

Wed Feb 02, 2022 10:57 am

I was wondering can you make enemies jump no a ledge if the player is there. I was thinking to use a line trigger, but I don't know how to do it.

https://imgur.com/sEz0YvB

here is a link to my example painting.

this can probably be done with some ACS which I am not that good with so any help is appreciated.

thank you in advance!

Re: Jumping Enemies

Thu Feb 03, 2022 8:16 am

Are you trying to make every enemy have the ability to jump to a ledge? Or is is only specific enemies? Are these custom enemies?

If you're creating custom enemies you can use DECORATE or ZScript to give the enemy jumping abilities.

If you want any enemy to be able to jump to a ledge you can use ThrustThingZ via an ACS script to make the enemy "jump" up to a ledge.

Re: Jumping Enemies

Thu Feb 03, 2022 10:37 am

Yes, I want all enemies to jump up. I am guessing that the line, after crossing it, will activate a script that pushes them forward on a cliff.

Re: Jumping Enemies

Sat Feb 05, 2022 11:39 am

YesMan wrote:Yes, I want all enemies to jump up. I am guessing that the line, after crossing it, will activate a script that pushes them forward on a cliff.

Just to clarify: You'd like any enemy that crosses that line to be able to jump to the ledge, correct? If so, yes, any actor that crosses the linedef will activate the script that causes them to be thrust upwards to the cliff ledge.

Please note the parameters of the ACS special:

ThrustThingZ (tid, force, up/down, set/add)

tid: Thing ID of the thing to thrust. If 0, this will thrust the activator (usually the player)

This means that you'll need to give consideration to how you assign Thing ID numbers. Typically, the player has a TID of 0. This means that, the script as defined above, will push the player up to the ledge. If you don't want the player to be pushed upwards you'll need to assign the player a (unique) non-zero TID number. This will need to be taken into consideration for other scripts in the map.

This also means that if you have enemies with non-zero TID numbers, you'll have to rework this script to accommodate that.

Re: Jumping Enemies

Sat Feb 05, 2022 11:46 am

I could be wrong, but I think both of those problems can be addressed:

if the map is in UDMF format, it's easy to set a line of any type to be activated by a monster but not the player:
Image

I *think* "If 0, this will thrust the activator (usually the player)" will be OK. If the tid parameter is left at 0, then I think it thrusts the activating actor regardless of their tid. So, a monster only activation line with the tid argument set to 0 should thrust any monster that crosses it, regardless of whether the monster has a tid or not.

Re: Jumping Enemies

Sun Feb 06, 2022 1:47 pm

Enjay wrote:if the map is in UDMF format, it's easy to set a line of any type to be activated by a monster but not the player

You are quite correct: I had forgotten the types of linedef triggers. [Incidentally, this may be done in HeXen format too,]

IIf the tid parameter is left at 0, then I think it thrusts the activating actor regardless of their tid. So, a monster only activation line with the tid argument set to 0 should thrust any monster that crosses it, regardless of whether the monster has a tid or not.

This makes sense and could very well work. (Trust me to make things more complicated than they need to be.)