Need help with ACS and puking
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!)
-
- Posts: 12
- Joined: Mon Mar 06, 2017 2:58 pm
- Graphics Processor: Intel (Modern GZDoom)
Need help with ACS and puking
Is there a way that I can have my ACS script "puke" when someone gets a frag?
-
-
- Posts: 596
- Joined: Thu Jul 05, 2007 6:13 pm
- Location: my laboratory
Re: Need help with ACS and puking
Yup, I think it can be done with the [wiki=PlayerFrags]PlayerFrags[/wiki] function in an enter-script. It'll cover all players. Check if the frag count increases and it should work as imagined:
edit: And of course you can execute the script as often as frags - prev_frags, if you want to account for multiple frags in the same tic by the same player!
Code: Select all
script "On frag" enter {
bool check_frags = true;
int frags = 0;
int prev_frags = frags;
while(check_frags) {
prev_frags = frags;
frags = PlayerFrags();
if(prev_frags < frags) {
Acs_NamedExecuteAlways("got a frag", 0);
}
Delay(const:1);
}
}
-
- Posts: 12
- Joined: Mon Mar 06, 2017 2:58 pm
- Graphics Processor: Intel (Modern GZDoom)
Re: Need help with ACS and puking
Thanks a bunch!