A_Jump with custom blood actor 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
Aerosplinter
Posts: 98
Joined: Wed Feb 01, 2017 2:14 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia (Modern GZDoom)

A_Jump with custom blood actor not working

Post by Aerosplinter »

My blood actor seems to always play the spawn animation, not the SpawnTwo animation with A_Jump, even with a 176/256 chance. How can this be fixed?

Code:

Code: Select all

ACTOR BulletGunSpark1 : Blood Replaces Blood
{
  +NOBLOCKMAP
  +NOTELEPORT
  Scale 0.68
  RenderStyle Normal
  Radius 10
  Height 10
  Mass 5
  States
  {
  Spawn:
	TNT1 A 0 A_Jump(176, "SpawnTwo")
    SPRK A 2 BRIGHT
    SPRK B 2 BRIGHT
	SPRK C 2 BRIGHT
    SPRK D 2 BRIGHT
	TNT1 A -1
    Stop
  
  SpawnTwo:
	SPRK E 2 BRIGHT
    SPRK F 2 BRIGHT
	SPRK G 2 BRIGHT
    SPRK H 2 BRIGHT
	TNT1 A -1
    Stop
  }
}
Blue Shadow
Posts: 5040
Joined: Sun Nov 14, 2010 12:59 am

Re: A_Jump with custom blood actor not working

Post by Blue Shadow »

When an actor first spawns and enters its Spawn state sequence, it normally doesn't execute its function on the first state (first line under "Spawn", if you will). To resolve this, you use the NoDelay keyword on that state to tell it to execute the function anyway:

Code: Select all

TNT1 A 0 NoDelay A_Jump(176, "SpawnTwo") 
Post Reply

Return to “Scripting”