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

Spawn AI when other AI reduces HP

Question

I am new here and I apologize if this question has already been asked.
Is it possible in Doom to create a kind of waves in battles, for example, with a boss or miniboss. 
Example, the boss has 100% HP, when he got 80% HP, the door opens and he comes to the aid of monsters to support. 
How hard is this to do? 

Share this post


Link to post

4 answers to this question

Recommended Posts

  • 0
5 hours ago, SgtPappas said:

I am new here and I apologize if this question has already been asked.
Is it possible in Doom to create a kind of waves in battles, for example, with a boss or miniboss. 
Example, the boss has 100% HP, when he got 80% HP, the door opens and he comes to the aid of monsters to support. 
How hard is this to do? 

Yes, very doable, you'll need some ACS scripting basic knowledge to set up the loop to check for the boss and miniboss health and the waves.

More time consuming than hard to pull it off.

 

You'll come up with something like this:

 

script "Waves" (int minibossTID, int bossTID) { //give the miniboss and boss monster a TID and then set those values in the arguments in the line special 80 (Script execute) to activate this script.
	int minibossHP = GetActorProperty(minibossTID, APROP_SpawnHealth); //Get miniboss spawn health and store it
	int bossHP = GetActorProperty(bossTID, APROP_SpawnHealth); //Get boss spawn health and store it
	while(GetActorProperty(minibossTID, APROP_Health) > minibossHP * 0.8) { //Check if the miniboss health is > than the 80% of its spawn health
		Delay(35); //wait
	}
	Open_Door(tag); //do whatever you want when the miniboss health is lower than 80%
	...
	while(GetActorProperty(bossTID, APROP_Health) > bossHP * 0.8) { //Do the same for the boss monster
		Delay(35);
	}
}

 

Share this post


Link to post
  • 0

Thank you very much for such quick aswer. 
Since i'm more leveldesigner than sripter, i have some questions if you do not mind. 


TID - this is Tag as i understand? Or i'm wrong?  
APROP_SpawnHealth should i leave it or i have to change it for some numbers, like 100 or 1000?  

This is what i got 
 

script "Waves" (void)
 {
    int bossTID = 999; //Boss Tag 
    int bossHP = GetActorProperty(999, 100); //Get boss spawn health and store it
    while(GetActorProperty(999, 100) > bossHP * 0.8);  //Check if the miniboss health is > than the 80% of its spawn health
        Delay(35); //wait

        Door_Open (900, 16);
    }


But for some reason, doors opens immediately after i'm crossing trigger line, even if i will not shoot. 


 

Share this post


Link to post
  • 0
2 hours ago, SgtPappas said:

Thank you very much for such quick aswer. 
Since i'm more leveldesigner than sripter, i have some questions if you do not mind. 


TID - this is Tag as i understand? Or i'm wrong?  
APROP_SpawnHealth should i leave it or i have to change it for some numbers, like 100 or 1000?  

This is what i got 
 

script "Waves" (void)
 {
    int bossTID = 999; //Boss Tag 
    int bossHP = GetActorProperty(999, 100); //Get boss spawn health and store it
    while(GetActorProperty(999, 100) > bossHP * 0.8);  //Check if the miniboss health is > than the 80% of its spawn health
        Delay(35); //wait

        Door_Open (900, 16);
    }


But for some reason, doors opens immediately after i'm crossing trigger line, even if i will not shoot. 

 

APROP means Actor Property, and _SpawnHealth is the maximum value of the actor's Health property (i.e its max health, unless for some reason this boss spawns with less than its max health o_o)

 

So yes, you should be using APROP_SpawnHealth

 

https://zdoom.org/wiki/ACS_actor_properties

Share this post


Link to post
  • 0

Yes, TID is referred to the tag you're giving to an actor.

 

There are some issues with your script there:

  • Defining an integer to store the monster tag is useless, since you can just directly use the value
  • Like Wo0p said, APROP_stuff is the property you want to get, so using in this case APROP_SpawnHealth will return the actual monster health when he spawned. You don't set the monster health with this function.
  • The door opens immediately because you have the door opening inside the loop instead of having outside of it like I wrote in my example
1 hour ago, Wo0p said:

(i.e its max health, unless for some reason this boss spawns with less than its max health o_o)

I believe this property will account for the possibility of increasing/reducing monsters health directly in the editor, I didn't tested it though.

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
×