A_JumpIfMasterCloser needs A_PRINT to work?!?

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.

A_JumpIfMasterCloser needs A_PRINT to work?!?

Postby Azagthoth » Sat Mar 27, 2021 3:42 pm

I've spent almost all day trying to figure this out and it's driving me nuts. For some reason, A_JumpIfMasterCloser only works if there is a print function in the missile state. What could possibly be the explanation for this? I've seen a lot of weird quirks in doom scripting but this one really takes the cake.

This works:
Code: Select allExpand view
ACTOR PainElemental_ : PainElemental
{
  States
  {
  Missile:
    PAIN D 5 A_FaceTarget
    PAIN E 5 A_FaceTarget
    PAIN F 5 Bright A_FaceTarget
    //PAIN F 0 Bright A_PainAttack
    PAIN F 0 Bright A_SpawnItemEx("LostSoul_", 50, 0, 0, 0, 0, 0, 0, SXF_TRANSFERPOINTERS | SXF_SETMASTER | SXF_NOCHECKPOSITION, 0, TID)
    Goto See
  }
}

ACTOR LostSoul_ : LostSoul

  States
  {
  Spawn:
    TNT1 A 0
    TNT1 A 0 A_JumpIfMasterCloser(150, 5)
    SKUL AB 10 Bright A_Look
    Loop
  Missile:
    TNT1 A 0 A_PRINTBOLD(" ")
    SKUL C 10 Bright A_FaceTarget
    SKUL D 4 Bright A_SkullAttack
    SKUL CD 4 Bright
    Goto Missile+3
  }
}

Replace TNT1 A 0 A_PRINTBOLD(" ") with just TNT1 A 0 and it doesn't jump to the missile state anymore. Removing it and jumping 4 frames instead doesn't work either. Oh and I just noticed you can even put the print AFTER Goto Missile+3 and it still works. Like what the hell is going on here? :?
Azagthoth
 
Joined: 20 Jan 2021
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)

Re: A_JumpIfMasterCloser needs A_PRINT to work?!?

Postby Mikk- » Sat Mar 27, 2021 4:15 pm

Funny - I've copied your code verbatim and it works fine, just out of curiosity what version of GZDoom are you using? I tested this using a recent GZDoom devbuild.
User avatar
Mikk-
yooooooooooo
 
Joined: 30 Jun 2009
Location: Somewhere off Kanagawa
Discord: Mikk0451#3922

Re: A_JumpIfMasterCloser needs A_PRINT to work?!?

Postby Azagthoth » Sat Mar 27, 2021 4:46 pm

Mikk- wrote:Funny - I've copied your code verbatim and it works fine, just out of curiosity what version of GZDoom are you using? I tested this using a recent GZDoom devbuild.

Forgot to mention I use Zandronum 3.0. I just tried it on GZDoom 4.5.0 and it seems to work there so I guess it's a bug with Zandronum then. Anyway, putting a dummy print frame after GOTO shouldn't affect it in any way so I guess that's fine then.
Code: Select allExpand view
ACTOR LostSoul_ : LostSoul

  States
  {
  Spawn:
    TNT1 A 0
    TNT1 A 0 A_JumpIfMasterCloser(150, 4)
    SKUL AB 10 Bright A_Look
    Loop
  Missile:
    SKUL C 10 Bright A_FaceTarget
    SKUL D 4 Bright A_SkullAttack
    SKUL CD 4 Bright
    Goto Missile+2
    TNT1 A 0 A_PRINT("")
  }
}
Azagthoth
 
Joined: 20 Jan 2021
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)


Return to Scripting

Who is online

Users browsing this forum: No registered users and 2 guests