I need help with a project that includes everything dying at the end, is there anyway that I can add this to my mod
or maybe can someone put an example. Thanks
Monster Death Events
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!)
- Beetow Brode
- Posts: 69
- Joined: Sat Sep 24, 2016 1:46 pm
- Graphics Processor: nVidia (Modern GZDoom)
- Location: "We've Got Hostiles"
- Beetow Brode
- Posts: 69
- Joined: Sat Sep 24, 2016 1:46 pm
- Graphics Processor: nVidia (Modern GZDoom)
- Location: "We've Got Hostiles"
Re: Monster Death Events
But this includes multiple monsters
not one
not one
-
- Posts: 4949
- Joined: Sun Nov 14, 2010 12:59 am
Re: Monster Death Events
[wiki]Thing_Destroy[/wiki]. You can use it from DECORATE/ZScript and ACS.
- Beetow Brode
- Posts: 69
- Joined: Sat Sep 24, 2016 1:46 pm
- Graphics Processor: nVidia (Modern GZDoom)
- Location: "We've Got Hostiles"
Re: Monster Death Events
Could I maybe see an example, also I had a script where this could maybe work, but it doesnt because its 2 imps and a arachnatron, so i'm thinking this could maybe work?
Code: Select all
baronsKilled++;
if(baronsKilled >= 2)
- m8f
-
- Posts: 1445
- Joined: Fri Dec 29, 2017 4:15 am
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Manjaro Linux
- Location: Siberia (UTC+7)
- Contact:
Re: Monster Death Events
Do you want to: 1. kill everything in the end by a script, or 2. detect that everything is killed?
If the first, then will kill every monster.
If the second, then
If you want to check not everything, but a particular type of monster, you can use ThingCountName:
If the first, then
Code: Select all
Thing_Destroy(0, 0, 0);
If the second, then
Code: Select all
script "CheckEverythingKilled" Enter
{
int totalMonsters = GetLevelInfo(LEVELINFO_TOTAL_MONSTERS);
int killedMonsters = GetLevelInfo(LEVELINFO_KILLED_MONSTERS);
bool allMonstersKilledOld = (totalMonsters == killedMonsters);
while (true)
{
totalMonsters = GetLevelInfo(LEVELINFO_TOTAL_MONSTERS);
killedMonsters = GetLevelInfo(LEVELINFO_KILLED_MONSTERS);
bool allMonstersKilled = (totalMonsters == killedMonsters);
if (allMonstersKilled != allMonstersKilledOld)
{
// do something that you want when everything is killed
}
allMonstersKilledOld = allMonstersKilled;
delay(35); // check every second.
}
}
Code: Select all
if (ThingCountName("DoomImp", 0) == 0)
{
// do something that you want when all imps are killed
}
- Beetow Brode
- Posts: 69
- Joined: Sat Sep 24, 2016 1:46 pm
- Graphics Processor: nVidia (Modern GZDoom)
- Location: "We've Got Hostiles"
Re: Monster Death Events
Thank you this helped very much! (: