DropItem not working

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
EndHack
Posts: 57
Joined: Wed Feb 14, 2018 8:53 pm

DropItem not working

Post by EndHack »

I'm working on a little project and I wanted to make this little brain thing (the golden one not the normal one) drop something but its not working

Code: Select all

ACTOR FlyingBrain
{
  Health 1
  Speed 13
  Radius 10
  Height 16
  Monster
  +FLOAT
  +NOGRAVITY
  MinMissileChance 150
  States
  {
  Spawn:
    BFLY A 10 A_Look
    Loop
  See:
    BFLY AAAA 4 A_Chase
    Loop
  Melee:
    BFLY A 8 A_Wander
    BFLY A 4 A_Wander
    Goto See
  Death:
    BRS1 A 700
    Stop
  }
}

ACTOR GoldenFlyingBrain : FlyingBrain
{
	DropItem "DoomImp"
	Translation "128:135=160:161", "136:143=162:167", "16:47=208:223"
}
FlyingBrainTest.pk3
(4.42 KiB) Downloaded 22 times
User avatar
wildweasel
Posts: 21706
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed
Contact:

Re: DropItem not working

Post by wildweasel »

The item dropping logic normally occurs when an actor executes A_NoBlocking, which is usually in its Death state. If, for some reason, you don't want to use this function (you really should, otherwise the player is liable to get stuck behind your dead monster), you can spawn your DoomImp with something like A_SpawnItemEx.
User avatar
EndHack
Posts: 57
Joined: Wed Feb 14, 2018 8:53 pm

Re: DropItem not working

Post by EndHack »

Alright thanks
Post Reply

Return to “Scripting”