+TOUCHY won't really work as that would make the monster die from falling 1 unit, which while hilarious, is not what I want. I want it to gib itself and cause splash damage. (using A_Explode)
How can I tell when this monster touches a living Actor?
(The monster is a suicide bomber)
[ZSCRIPT] How do I make a monster that gibs itself & explodes when it touches a living Actor?
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!)
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!)
Re: [ZSCRIPT] How do I make a monster that gibs itself & explodes when it touches a living Actor?
Basically, make his melee state jump to a Xdeath or custom death state that spawns a rocket explosion something like
You can make it fancier with SpawnItemEX and make a new actor that is the actual explosion if you want. This essentially gets you what you are looking for. I would change the monster's melee range to something short like 32.
Code: Select all
...
Melee:
POSS C 1
goto XDeath
...
XDeath:
POSS M 5
POSS N 5 A_XScream
MISL B 8 Bright A_Explode
MISL C 6 Bright
MISL D 4 Bright
Stop
...
-
yum13241
- Posts: 875
- Joined: Mon May 10, 2021 8:08 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): EndeavorOS (basically Arch)
- Graphics Processor: Intel with Vulkan/Metal Support
- Contact:
Re: [ZSCRIPT] How do I make a monster that gibs itself & explodes when it touches a living Actor?
My suicide bomber isn't damaging the player. (This is all ZScript)
SShotgunGuy:
SuicdeBomb:
BaseMonster:
BaseActor:
BaseProjectile:
What's going on? I spawn the explosion 5 units away from the zombie, and telefrag the player if they get in its way. Why am I taking almost no damage?
SShotgunGuy:
Spoiler:
SuicdeBomb:
Spoiler:
BaseMonster:
Spoiler:
BaseActor:
Spoiler:
BaseProjectile:
Spoiler:
What's going on? I spawn the explosion 5 units away from the zombie, and telefrag the player if they get in its way. Why am I taking almost no damage?
- Player701
-

- Posts: 1710
- Joined: Wed May 13, 2009 3:15 am
- Graphics Processor: nVidia with Vulkan support
- Contact:
Re: [ZSCRIPT] How do I make a monster that gibs itself & explodes when it touches a living Actor?
I think you need to add NoDelay to the state where you make the A_Explode call since it is technically the first state your actor enters, and functions in the first state are not called by default. E.g.
Note that you could just put the "Spawn:" label directly above "Death:", it'll work the same, no need for the "Goto Death"+"Stop" part.
Code: Select all
Death:
MISL B 8 NoDelay Bright A_Explode;
...
-
yum13241
- Posts: 875
- Joined: Mon May 10, 2021 8:08 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): EndeavorOS (basically Arch)
- Graphics Processor: Intel with Vulkan/Metal Support
- Contact:
Re: [ZSCRIPT] How do I make a monster that gibs itself & explodes when it touches a living Actor?
Thanks, I forgot about that Doom-ism.