ACS_Execute not working! (Resolved)

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
void
Posts: 26
Joined: Fri Feb 10, 2012 12:04 am
Location: That dark spot under the couch

ACS_Execute not working! (Resolved)

Post by void »

When working with decorate and practicing making monsters activate scripts, I came across a problem.

In one monster, who is supposed to activate a script on his death, he doesn't.

I tried forcing the script in-game, and it works just fine, but for some reason the monster won't activate it when he dies.

Here's the code for the monster.

Code: Select all

ACTOR YellowBoss 5504
{
  Game Doom
  SpawnID 125
  Health 10000
  Radius 30
  Height 112
  Mass 50000
  Scale 3.0
  Speed 0
  Species Yellow
  translation "0:255=160:167"
  MONSTER
  +SOLID
  +SHOOTABLE
  +NOBLOOD
  +ACTIVATEMCROSS
  +DONTGIB
  +NOICEDEATH
  +OLDRADIUSDMG
  DeathSound "world/barrelx"
  Obituary "$OB_BARREL" // "%o went boom."
  States
  {
  Spawn:
    BAR1 AB 6
    Loop
  Death:
    BEXP A 5 BRIGHT A_NoBlocking
    BEXP B 5 BRIGHT A_Scream
    BEXP C 5 ACS_Execute (13, 1)
    BEXP D 5 BRIGHT A_Explode (9999, 9999)
    BEXP E 10 BRIGHT
    TNT1 A -5
    stop
  }
}
I know I did the DECORATE part right, because different monsters using ACS_Execute work just fine, but their scripts were activated in their spawn state.

Are monsters simply not allowed to use scripts in thier death state?.. I ask that because from what I've seen, A_Explode can ONLY be used in a monster's death state, so maybe this is state-specific too? idk, just guessing.. I just wish this would work.

Any ideas?
Last edited by void on Thu May 03, 2012 3:38 pm, edited 1 time in total.
User avatar
amv2k9
Posts: 2178
Joined: Sun Jan 10, 2010 4:05 pm
Location: Southern California

Re: ACS_Execute not working!

Post by amv2k9 »

[wiki]ACS_ExecuteAlways[/wiki]? That may not help you with what you want to do.
User avatar
void
Posts: 26
Joined: Fri Feb 10, 2012 12:04 am
Location: That dark spot under the couch

Re: ACS_Execute not working!

Post by void »

I just want to know why, in this specific instance, ACS_Execute does not work, and how I can GET it to work..

Is it true it can't be used in the death state? Or is there some other cause?

EDIT: Tried ACS_ExecuteAlways, and it didn't work either.
User avatar
chopkinsca
Posts: 1325
Joined: Thu Dec 11, 2003 5:03 pm

Re: ACS_Execute not working!

Post by chopkinsca »

Just curious, but what's the script?
User avatar
NeuralStunner
 
 
Posts: 12328
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: ACS_Execute not working!

Post by NeuralStunner »

What's the 1 for? If it's intended as an argument to the script, it needs to be the next parameter over. (Second parameter is which map to run the script in.)
User avatar
void
Posts: 26
Joined: Fri Feb 10, 2012 12:04 am
Location: That dark spot under the couch

Re: ACS_Execute not working!

Post by void »

The script terminates another script, and prints a colored message, which works when I use the console command "puke", so I know the script itself is working.

The 1 is for the map, yeah.. The script is on the first map. I do that with all ACS_Execute things I use, and all the other ones worked just fine.
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: ACS_Execute not working!

Post by Gez »

Are you using [wiki]Print[/wiki] or [wiki]PrintBold[/wiki] to print the colored message? Because with Print, the message would only display on... the monster's screen. Which would be consistent with it seemingly not working; whereas from the console it's displayed on the console player's screen, so it is seen to work.

Also, you can use A_Explode in absolutely any state. The only case in which an action function will fail to execute is the very first state an actor is spawned in, so if you have code like this:

Code: Select all

Spawn:
  NUKE A 4 A_Explode
  NUKE BCDE 4
  Stop
Then it will not work as expected.

Whereas:

Code: Select all

Spawn:
  NUKE A 0
  NUKE A 4 A_Explode
  NUKE BCDE 4
  Stop
Will work.

(This is because action functions are called when an actor enters a state. When the actor is spawned, it doesn't enter its spawn state, it is created in it. This is how vanilla behaved and it might have broken dehacked mods if it had been changed. To say nothing of the ton of ZDoom mods with DECORATE that might be broken if it were changed now.)
User avatar
NeuralStunner
 
 
Posts: 12328
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: ACS_Execute not working!

Post by NeuralStunner »

The reason you wouldn't use A_Explode on a live monster is because it'd damage itself, plus have funky infighting effects.
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: ACS_Execute not working!

Post by Gez »

The fact that it'd be stupid is irrelevant to the fact that it would work anyway. There is nothing in the engine that prevents A_Explode from working when called from any arbitrary state.
User avatar
void
Posts: 26
Joined: Fri Feb 10, 2012 12:04 am
Location: That dark spot under the couch

Re: ACS_Execute not working!

Post by void »

Strange, because I've never gotten A_Explode to ever work properly unless it was in the death state or in a projectile.. Anyway..

The print function on the script works perfectly, the script itself works perfectly, it's the ACS_Execute on the death state of the monster that's not working properly..

The script WORKS, okay? I can use the console command "puke" to activate it, that proves there's nothing wrong with it.

I just want to know why, in this specific instance, ACS_Execute is not working with this monster..

I don't know what I did wrong, but whatever it is, it's not the script.. The script works.. It's just not being activated.

Code: Select all

script 13 (void)    //---- Yellow Boss dies
{
ACS_Terminate (9, 1);
Print (s:"\c[gold]The yellow boss has died!");
}
As I said, the script works, it terminates script 9, and prints "The yellow boss has died!" in yellow.... .... On MY screen.

.... Oh wait.. If the monster is activating the script.. It wouldn't print on my screen, and-...

*facepalm*

Ooooooooooooohhhh.....

Thank you.. Problem resolved... It actually WAS executing, but I wasn't getting the message because I was using the wrong print command..
Last edited by void on Thu May 03, 2012 3:41 pm, edited 4 times in total.
User avatar
amv2k9
Posts: 2178
Joined: Sun Jan 10, 2010 4:05 pm
Location: Southern California

Re: ACS_Execute not working!

Post by amv2k9 »

And while an action function/special on the first frame of a Spawn state won't be run, if it loops back to the Spawn state for any reason, it will be run that second time and any other times after that.
User avatar
void
Posts: 26
Joined: Fri Feb 10, 2012 12:04 am
Location: That dark spot under the couch

Re: ACS_Execute not working! (Resolved)

Post by void »

Are you using Print or PrintBold to print the colored message? Because with Print, the message would only display on... the monster's screen. Which would be consistent with it seemingly not working; whereas from the console it's displayed on the console player's screen, so it is seen to work.
Hit the nail on the head, good sir. Problem solved.

Thanks for the help, guys..

Sometimes zdoom wiki can't solve EVERYTHING.. ^^;
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: ACS_Execute not working! (Resolved)

Post by Gez »

void wrote:Hit the nail on the head, good sir. Problem solved.

Thanks for the help, guys..

Sometimes zdoom wiki can't solve EVERYTHING.. ^^;
Well, the ZDoom wiki article for [wiki]Print[/wiki] has said that PrintBold was to be used for scripts activated by enemies since September 2005, so... :P

Also, about [wiki]A_Explode[/wiki], if I have to make a point out of it...
boomimp.zip
(505 Bytes) Downloaded 23 times
These replace normal imps and call A_Explode everywhere except their death state sequences. I gave 'em +NORADIUSDMG so that they don't kill themselves. Go give them a hug and tell me if it doesn't work.
User avatar
void
Posts: 26
Joined: Fri Feb 10, 2012 12:04 am
Location: That dark spot under the couch

Re: ACS_Execute not working! (Resolved)

Post by void »

It worked fine.. I guess I was just doing something wrong... Well, thanks for the help.
Locked

Return to “Editing (Archive)”