asd1994 Posted September 9, 2021 So I want the player character to breathe heavy when low on health (15% and below). How would I go about doing that? 0 Quote Share this post Link to post
1 Rifleman Posted September 10, 2021 (edited) So I spent a while trying to make it sound ok in DECORATE and just couldn't do it. So I erased that and tried a script and that seems to work better: script "LowHPBreath" ENTER { int HP = GetActorProperty(0, APROP_Health); if(HP < 16 && HP > 0) { PlaySound(0, "grunt/death", 7, 1.0, 1); } else { StopSound(0, 7); } Delay(35); Restart; } It's just for the map, but could be copied to others or used with LOADACS. Edited September 10, 2021 by Rifleman 1 Quote Share this post Link to post
0 Rifleman Posted September 9, 2021 Someone probably has a better solution, but I tried this and it seemed to work ok, so maybe it'll help :) See: TNT1 A 0 A_JumpIfHealthLower(16, 2) TNT1 A 0 A_Jump(256, 2) TNT1 A 0 A_StartSound("grunt/death") PLAY ABCDABCDABCD 4 Loop I just modified the player actor in DECORATE - changed the See state. First it checks if you have less than 16 HP and if so it jumps to the sound and if not, then jumps over it. I tripled the frames in the end to avoid the sound being played to fast in a loop. This way, whenever you have less than 16 HP and are moving, the sound plays. For the sound to play while idle, the Spawn state could be modified like this. The sound wouldn't play while firing. 0 Quote Share this post Link to post
0 asd1994 Posted September 9, 2021 (edited) 13 hours ago, Rifleman said: Someone probably has a better solution, but I tried this and it seemed to work ok, so maybe it'll help :) See: TNT1 A 0 A_JumpIfHealthLower(16, 2) TNT1 A 0 A_Jump(256, 2) TNT1 A 0 A_StartSound("grunt/death") PLAY ABCDABCDABCD 4 Loop I just modified the player actor in DECORATE - changed the See state. First it checks if you have less than 16 HP and if so it jumps to the sound and if not, then jumps over it. I tripled the frames in the end to avoid the sound being played to fast in a loop. This way, whenever you have less than 16 HP and are moving, the sound plays. For the sound to play while idle, the Spawn state could be modified like this. The sound wouldn't play while firing. This kinda works, but the sound restarts whenever I start to move so it sounds strange. Same thing happens when I try to apply this to the Spawn state as well, just the other way around (sound restarts when I stop moving). Is there a way to get it to not do that constantly? Edited September 9, 2021 by LightwaveAlice 0 Quote Share this post Link to post
0 asd1994 Posted September 12, 2021 On 9/10/2021 at 3:40 AM, Rifleman said: So I spent a while trying to make it sound ok in DECORATE and just couldn't do it. So I erased that and tried a script and that seems to work better: script "LowHPBreath" ENTER { int HP = GetActorProperty(0, APROP_Health); if(HP < 16 && HP > 0) { PlaySound(0, "grunt/death", 7, 1.0, 1); } else { StopSound(0, 7); } Delay(35); Restart; } It's just for the map, but could be copied to others or used with LOADACS. This works great, thank you so much! :D 1 Quote Share this post Link to post
Question
asd1994
So I want the player character to breathe heavy when low on health (15% and below). How would I go about doing that?
Share this post
Link to post
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.