Monsters start dead in sector

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!)
Post Reply
CynicalOverdose
Posts: 3
Joined: Sun Jan 14, 2018 2:50 pm

Monsters start dead in sector

Post by CynicalOverdose »

Hello,

I've been wondering how one starts off with monsters dead in a sector that revive when another monster crosses into that sector.

One part of this level involves accidently releasing an Archvile into a base covered in the corpses of dead demons that the archvile revives by moving through the sectors.

I've seen this done in other wads before where the monsters start dead and revive when the player picks up an item, but I only want to have it affect a couple of sectors and not the entire level.
User avatar
krokots
Posts: 266
Joined: Tue Jan 19, 2010 5:07 pm

Re: Monsters start dead in sector

Post by krokots »

Maybe you could make a seperate monster actors which just start in last frame of "Death" state. You would put at "Spawn" function some boolean check (JumpIf), and that would jump the monster to Death state. Also you must set monster KILLED and CORPSE flags to true.
User avatar
Amuscaria
Posts: 6628
Joined: Mon Jul 26, 2004 12:59 pm
Location: Growing from mycelium near you.

Re: Monsters start dead in sector

Post by Amuscaria »

You can do this two ways, one with ACS and another with Decorate. The ACS way is easier.

ACS Method:

-Give the monsters you want to look dead a thing_id, say 1.
-Use an OPEN type script to kill all the monsters with thing_id 1. Open scripts activate when the map is entered for the first time (it think?).

example:

Code: Select all

Script 1 OPEN
{
Thing_Destroy(1);
}
-Put an action special #17 (Thing_Raise) on the object that you want to the revive the monsters with, and use tag 1. The item will raise the monsters when it's picked up.

Decorate Method:

-Make special versions of the monsters Where it's Spawn State uses the final death frame, and the see state first goes thru the death animation backwards. You'll need to make the appropriate frame skips for all its other states so it doesn't look like its going thru revives every time the see state is called, or use a different states.

example:

Code: Select all

ACTOR DoomImpReviver : DoomImp
{ 
  States
  {
  Spawn:
    TROO M 1 A_Look
    Loop
  See:
    TROO MLKJI 7 
    TROO AABBCCDD 3 A_Chase
    goto See+5
  Melee:
  Missile:
    TROO EF 8 A_FaceTarget
    TROO G 6 A_TroopAttack
    Goto See+5
  Pain:
    TROO H 2
    TROO H 2 A_Pain
    Goto See+5
  Death:
    TROO I 8
    TROO J 8 A_Scream
    TROO K 6
    TROO L 6 A_NoBlocking
    TROO M -1
    Stop
  XDeath:
    TROO N 5
    TROO O 5 A_XScream
    TROO P 5
    TROO Q 5 A_NoBlocking
    TROO RST 5
    TROO U -1
    Stop
  Raise:
    TROO ML 8
    TROO KJI 6
    Goto See+5
-In the map, set the actors you want to revive as "dormant" and give them a tag (say 1 again).
-Give the activator item an action #130 (Thing_Activate) with tag 1. This will also revive the monsters. But you'll need a custom version of every monster if you do it this way, which is more tedious. But doing it this way does allow the player to spawn in the same room as the monster at the start and not having to see the monster go thru the initial setup death animation that using the ACS method will cause.

There are other ways that combines ACS and Decorate too, but they use the same concept.
Post Reply

Return to “Scripting”