how do i make a win requirement
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!)
how do i make a win requirement
how do i make a requirement to win a level so its like hunting monsters?
Re: how do i make a win requirement
If it's for a custom map, you can use ACS scripting for it:
Just call this script instead of Exit_Normal you would normally use and it should work.
Used in this example was GetLevelInfo to retrieve the number of killed monsters and compare it with the number of total monsters.
If it's for a general gameplay mod meant to be used with Doom maps, I heavily advise against it.
There are plenty maps where getting 100% kills is impossible and it will cause your mod to prevent progression.
But if you really want to do it, you can use a ZScript Event Handler for it and overriding WorldLinePreActivated, checking the line's special, number of killed monsters compared to total monsters and setting ShouldActivate.
Once again, I advise against it as it will break several games, so win requirements are best used in custom maps.
Code: Select all
Script 666 (void)
{
If(GetLevelInfo(LEVELINFO_KILLED_MONSTERS)>=GetLevelInfo(LEVELINFO_TOTAL_MONSTERS))
{ //If the monster have been killed, end the level
Exit_Normal(0);
}
Else
{ //Otherwise print a message
Print(s:"There are still monsters left!");
}
} Used in this example was GetLevelInfo to retrieve the number of killed monsters and compare it with the number of total monsters.
If it's for a general gameplay mod meant to be used with Doom maps, I heavily advise against it.
There are plenty maps where getting 100% kills is impossible and it will cause your mod to prevent progression.
But if you really want to do it, you can use a ZScript Event Handler for it and overriding WorldLinePreActivated, checking the line's special, number of killed monsters compared to total monsters and setting ShouldActivate.
Once again, I advise against it as it will break several games, so win requirements are best used in custom maps.
Re: how do i make a win requirement
thank you so much sir!
