[DECORATE] Dead body spawning a weapon

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
User avatar
The Philosopher
Posts: 212
Joined: Thu Sep 20, 2018 1:00 pm
Preferred Pronouns: She/Her
Operating System Version (Optional): W10
Location: Santiago, Chile

[DECORATE] Dead body spawning a weapon

Post by The Philosopher »

How i can make a corpse spawn a weapon? I tried to use the DeadMarine code and A_SpawnItem for spawning a Shotgun but it didnt work

My Code:

Code: Select all

Actor DeadBodyShotgun
{ 
  Radius 20
  Height 4
  +NOBLOCKMAP
  +MOVEWITHSECTOR
  States
  { 
    Spawn:
       DEAD A 0 A_SpawnItem ("Shotgun")
       DEAD  A -1
       Stop
      }
}
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Re: [DECORATE] Dead body spawning a weapon

Post by Matt »

Make that line read

Code: Select all

DEAD A 0 nodelay A_SpawnItem ("Shotgun")
Otherwise anything you put into the first spawn frame is ignored unless/until the actor revisits that state later.
User avatar
The Philosopher
Posts: 212
Joined: Thu Sep 20, 2018 1:00 pm
Preferred Pronouns: She/Her
Operating System Version (Optional): W10
Location: Santiago, Chile

Re: [DECORATE] Dead body spawning a weapon

Post by The Philosopher »

Matt wrote:Make that line read

Code: Select all

DEAD A 0 nodelay A_SpawnItem ("Shotgun")
Otherwise anything you put into the first spawn frame is ignored unless/until the actor revisits that state later.
Thanks!
Post Reply

Return to “Scripting”