Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / Health Control

Author
Message
Soviet176
16
Years of Service
User Offline
Joined: 19th Sep 2009
Location: Volgograd
Posted: 12th Sep 2010 06:42
Hey guys, I am having a small problem. I am trying to have it so, when a players health is at a certain place, it will show a hurt hud, like gears of war. So far, this is what I have I am using one of I am using lotgd huds but I wanted to mix things up, this code plays a sound when the health is 19 I believe, and I added some code to have it show a hurt hud at the same health, and tried to reset it when you die. But the HUD stays the same when you die, and I am using a PNG picture with transparency, for some reason, it does not show the transparent part. So you are running around blind lol. Any help would be awesome, thanks!



Putting fear back into sliced bread since 4th May 2010
Plystire
23
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 12th Sep 2010 09:50
Use "hudunshow"

"hudreset" is a command used to prep the system for loading a HUD.


The one and only,


Marc Steene
FPSC Master
20
Years of Service
User Offline
Joined: 27th Mar 2006
Location: Bahrain
Posted: 12th Sep 2010 11:39
That script isn't very logical, try this one instead:

:state=0:hudreset,hudhide,hudx=50,hudy=50,hudname=blood,hudimage=gamecore\huds\CloudRedHudHD.png,state=1
:state=1,plrhealthless=150,plrhealthgreater=1:loopsound=audiobank\music\Rafleo\Heartbeat.ogg,hudshow=blood
:state=1,plrhealthgreater=19:hudunshow=blood,stopsound


[b]FPSC MIGRATION: http://forum.thegamecreators.com/?m=forum_view&t=142497&b=21
zeza
18
Years of Service
User Offline
Joined: 27th Jun 2008
Location:
Posted: 12th Sep 2010 16:33 Edited at: 12th Sep 2010 16:34
Quote: ":state=0:hudreset,hudhide,hudx=50,hudy=50,hudname=blood,hudimage=gamecore\huds\CloudRedHudHD.png,state=1
:state=1,plrhealthless=150,plrhealthgreater=1:loopsound=audiobank\music\Rafleo\Heartbeat.ogg,hudshow=blood
:state=1,plrhealthgreater=19:hudunshow=blood,stopsound"


That wouldn't work either, because if the players health was 149, the hud and sound would flicker on and off, why not just do

Quote: ":state=0:hudreset,hudhide,hudx=50,hudy=50,hudname=blood,hudimage=gamecore\huds\CloudRedHudHD.png,state=1
:state=1,plrhealthless=150,plrhealthgreater=1:loopsound=audiobank\music\Rafleo\Heartbeat.ogg,hudshow=blood
:state=1,plrhealthgreater=151:hudunshow=blood,stopsound
:state=1,plralive=0:hudunshow=blood,stopsound
"


I'd change the world, but I don't have the source code
R.I.P. heltor, we will miss you
Gencheff
16
Years of Service
User Offline
Joined: 12th Jun 2010
Location: UK by way of USSR
Posted: 12th Sep 2010 18:18 Edited at: 12th Sep 2010 18:19
Ah good to see you're using my hud Comrade

Now...what the hell are you guys above talking about...

zeza - do you notice what Marc wrote in the last row?

Marc - every time the players health goes under 19 (18,17,16,etc.) that sound will play and will cause sound distortion,so that wont work well either.

Try this :


Not sure how stopsound works ,but I think you don't need the =x part,just stopsound.

Soviet176
16
Years of Service
User Offline
Joined: 19th Sep 2009
Location: Volgograd
Posted: 12th Sep 2010 20:36
Quote: "Ah good to see you're using my hud Comrade"


You know it comrade! simply the coolest hud. I will be trying out this code and get back to you.

Putting fear back into sliced bread since 4th May 2010
Soviet176
16
Years of Service
User Offline
Joined: 19th Sep 2009
Location: Volgograd
Posted: 12th Sep 2010 21:11
Ok double post, but, the sound plays, however for some reason the hud just won't show. I have tried everyones code lol.

Putting fear back into sliced bread since 4th May 2010
Gencheff
16
Years of Service
User Offline
Joined: 12th Jun 2010
Location: UK by way of USSR
Posted: 12th Sep 2010 23:57 Edited at: 12th Sep 2010 23:58
I forgot to add hudhide=1 and hudmake=display in the first row lol.

Soviet176
16
Years of Service
User Offline
Joined: 19th Sep 2009
Location: Volgograd
Posted: 13th Sep 2010 22:48
So wait how would that look :/

Putting fear back into sliced bread since 4th May 2010
Gencheff
16
Years of Service
User Offline
Joined: 12th Jun 2010
Location: UK by way of USSR
Posted: 13th Sep 2010 22:49


Soviet176
16
Years of Service
User Offline
Joined: 19th Sep 2009
Location: Volgograd
Posted: 14th Sep 2010 00:31
Darn, for some reason it just is not working. It plays the sound, just wont show the hud at a small HP level, and for some reason when I use your script is always shows the game menu as if I was in game "Exit game ect" and wont go away. Lol this is so odd.

Putting fear back into sliced bread since 4th May 2010
Gencheff
16
Years of Service
User Offline
Joined: 12th Jun 2010
Location: UK by way of USSR
Posted: 14th Sep 2010 00:42
HUH? o_O...

If you're trying to apply this in x10,I have no clue what the problem is.

Where are you putting this script? tell me it's not in setuplevel.fpi,because if it is it changes your state to pause lol!!

Place it in a trigger zone


Soviet176
16
Years of Service
User Offline
Joined: 19th Sep 2009
Location: Volgograd
Posted: 14th Sep 2010 03:24
Oh, no I am using FPSC x9 for this test, its a multi-player map, should be the same, as the sound works. Basiclly it's supposed to do this.

When the player is hit with a gun, and becomes wounded, at a certain level of his wounds (lets say 20 HP) a Hud will pop up (your awesome hud) Indicated that you are about to die, and it is supposed to stay up until you find more health. Like ME2's red hurt hud or MW2.

I am putting it in the setuplevel.FPI, here is the whole thing.



Controll suono or what ever that means, is supposed to be the part that triggers the hud when the player is at a certain HP, and remain there until he picks up lets say a HP pack that brings his health to umm 50 lets say then the hud dispears till next time he gets is bug kicked.

Putting fear back into sliced bread since 4th May 2010
Gencheff
16
Years of Service
User Offline
Joined: 12th Jun 2010
Location: UK by way of USSR
Posted: 14th Sep 2010 13:33 Edited at: 14th Sep 2010 13:36
Quote: "Controll suono or what ever that means"


It means sound control (if I'm not mistaking).

NOW Comrade here's your problem.

The script I gave you is suited for trigger zones , not setuplevel. Why? - because the states interfiere with the pause game ones (state=2),that's why you get the pause menu.

Now since after the game has been ran the FIRST state changes to 1 (here
) the HUD is not initialized since it requires state 0.Meaning you have to put the hud initializing script around the first row of setuplevel.


This should be your final setuplevel.fpi



If this doesn't work I'm out of ideas.

-Gencheff

Soviet176
16
Years of Service
User Offline
Joined: 19th Sep 2009
Location: Volgograd
Posted: 15th Sep 2010 02:25
Comrade, you are a scripter, a programmer, a modeler, a texture artist, a graphics designer, and a talented individual.

Spasibo comrade, this has helped me a lot, and your hud only made it better.

Putting fear back into sliced bread since 4th May 2010

Login to post a reply

Server time is: 2026-07-26 05:22:50
Your offset time is: 2026-07-26 05:22:50