Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • 0
Gianluco

How do I make an actor die after you kill other actors?

Question

I want to make a special action that kills the Boss1 actor after destroying (killing) all of the Altar actors. How do I do it?

Share this post


Link to post

12 answers to this question

Recommended Posts

  • 1

Here you go:

https://github.com/smeghammer/snippets/tree/master/kill_cust_actor

 

I used your script, but adapted to different TIDs (for the zombiemen and the custom cyberimp).

 

Kill the zombiemen...

#library "acslib.acs"
#include "zcommon.acs"

script 1000 ENTER{
    print(s:"starting kill detect loop...");

    While (ThingCount(T_NONE, 10) > 0) {
        Delay(10);
    }
    Thing_Destroy(11, 1);
}

Obviously, if you ant other things to happen on OPEN, you ill need to adapt accordingly.

 

Notice I used the gib death flag set to TRUE (1) and omitted the sector tag flag (defaults to 0/any)

 

You need to compile any changes to the script of course (acs.exe, slade, CLI etc...) 

 

Share this post


Link to post
  • 1

If you're on UDMF, or anything that supports acs scripting, than you can just write a while loop to check if the Altars are "alive" and if they're not you call for Thing_Destroy (or whatever function you wish) to kill the boss.

 

Spoiler

Something like this:


While (ThingCount(T_NONE, AltarTID) > 0) {
	Delay(35);
}
Thing_Destroy(BossTID, 0, 0);

 

 

Share this post


Link to post
  • 0
Posted (edited)
7 hours ago, Kan3 said:

If you're on UDMF, or anything that supports acs scripting, than you can just write a while loop to check if the Altars are "alive" and if they're not you call for Thing_Destroy (or whatever function you wish) to kill the boss.

 

  Hide contents

Something like this:



While (ThingCount(T_NONE, AltarTID) > 0) {
	Delay(35);
}
Thing_Destroy(BossTID, 0, 0);

 

 

It doesn't work, I tried putting the Tag of the altars, but when I kill all of them, nothing happens. This is the script I put


script 6 (void)
{
While (ThingCount(T_NONE, 800) > 0) {
    Delay(10);
}
Thing_Destroy(801, 0, 0);
}

 

Also, the boss has the INVULNERABLE flag, but not the NOKILLSCRIPTS one 

Edited by Gianluco

Share this post


Link to post
  • 0
3 hours ago, ramon.dexter said:

How are you starting the script itself? What triggers it?

A linedef at the start of the level that executes the script when walking over it

Share this post


Link to post
  • 0
On 6/28/2022 at 7:05 PM, Gianluco said:

It doesn't work, I tried putting the Tag of the altars, but when I kill all of them, nothing happens. This is the script I put


script 6 (void)
{
While (ThingCount(T_NONE, 800) > 0) {
    Delay(10);
}
Thing_Destroy(801, 0, 0);
}

 

Also, the boss has the INVULNERABLE flag, but not the NOKILLSCRIPTS one 

I use that in almost every map I made, so just try to add another action other than Thing_Destroy to see if that action or the boss is the issue.

Share this post


Link to post
  • 0
4 hours ago, Gianluco said:

Which script is it?

Look in the source acs code in /root/acs/

 

Line 176.

 

Sorry I forgot how much other stuff was there.

Share this post


Link to post
  • 0
1 hour ago, smeghammer said:

Look in the source acs code in /root/acs/

 

Line 176.

 

Sorry I forgot how much other stuff was there.

Ok, I found a difference with the code that Kan3 suggested. You put the identifier T_BARON, while I put T_NONE. Maybe that's what causing the issue? How do I give a custom actor an identifier?

Share this post


Link to post
  • 0
Posted (edited)

That's the TID is it not? It is defined in the decorate code for the custom thing. I'll check it when I get home and get back to you.

 

EDIT - I mean the TID you ADD to the actor...

Edited by smeghammer

Share this post


Link to post
  • 0
On 7/1/2022 at 10:59 AM, smeghammer said:

Here you go:

https://github.com/smeghammer/snippets/tree/master/kill_cust_actor

 

I used your script, but adapted to different TIDs (for the zombiemen and the custom cyberimp).

 

Kill the zombiemen...


#library "acslib.acs"
#include "zcommon.acs"

script 1000 ENTER{
    print(s:"starting kill detect loop...");

    While (ThingCount(T_NONE, 10) > 0) {
        Delay(10);
    }
    Thing_Destroy(11, 1);
}

Obviously, if you ant other things to happen on OPEN, you ill need to adapt accordingly.

 

Notice I used the gib death flag set to TRUE (1) and omitted the sector tag flag (defaults to 0/any)

 

You need to compile any changes to the script of course (acs.exe, slade, CLI etc...) 

 

It looks like it's working now, thank you!

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×