Here's my scenario:
1. I have two enemies of one species tagged 14 (say, Team 1)
2. I have several enemies of two different species tagged 15 (say, Team 2)
3. My script is (Thing_Hate 14, 15); and (Thing_Hate 15, 14);
4. Once at least one member of each team is killed the surviving enemies appear to ignore the other team enemies.
5. This results in surviving enemies returning to their idle states rather than seeking out their opponents until all enemies with a given tag are killed
How should I set up my scenario so that the fighting continues until all enemies with a given tag are killed?
I suppose I can assign each enemy a unique tag and duplicate the Thing_Hate instructions, but this seems an extremely inelegant want to achieve what I want.
I'd appreciate any suggestions. Thanks.
Overcoming Limitations of Thing_Hate Behavior
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!)
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!)
Re: Overcoming Limitations of Thing_Hate Behavior
While loop checking the count, call the same script to force hellish chaos (i like that), until team A or B count 0?
Re: Overcoming Limitations of Thing_Hate Behavior
Yes, this is probably the way to go. Let me think about how to execute the loop.Logan MTM wrote:While loop checking the count, call the same script to force hellish chaos (i like that), until team A or B count 0?
Many thanks.
Re: Overcoming Limitations of Thing_Hate Behavior
Code: Select all
PrevTeamA = Thingcount(0,15);
PrevTeamB = Thingcount(0,16);
Delay(1);
LateTeamA = Thingcount(0,15);
LateTeamB = Thingcount(0,16);
If(PrevTeamA != LateTeamA || PrevTeamB != LateTeamB)
//inFighting script
Re: Overcoming Limitations of Thing_Hate Behavior
Here's what I have, but it doesn't activate the HATE behavior in the enemies:
Spoiler:
Re: Overcoming Limitations of Thing_Hate Behavior
And Never will! You forgot the While Loop! 
This should work:
Edit: Tested and working! Besides, NoiseAlert works better for this matters!

This should work:
Code: Select all
int PrevTeamA;
int PrevTeamB;
int LateTeamA;
int LateTeamB;
script "Test" OPEN
{
Delay (140);
NoiseAlert(14,15);
NoiseAlert(15,14);
While(1)
{
PrevTeamA = Thingcount(0,14);
PrevTeamB = Thingcount(0,15);
Delay(1);
LateTeamA = Thingcount(0,14);
LateTeamB = Thingcount(0,15);
If(PrevTeamA != LateTeamA || PrevTeamB != LateTeamB)
{
NoiseAlert(14,15);
NoiseAlert(15,14);
}
If(!PrevTeamA || !PrevTeamB)
{
Terminate;
}
}
}
Re: Overcoming Limitations of Thing_Hate Behavior
Yes, it would have helped to have the WHILE statement in there.
It all works as expected now. Many thanks.
It all works as expected now. Many thanks.