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 bar - no need to edit setuplevel script!

Author
Message
Michael Thompson
16
Years of Service
User Offline
Joined: 15th Aug 2008
Location: Behind you (if not, in australia)
Posted: 2nd Oct 2010 14:16 Edited at: 8th Mar 2011 11:01
Hello all.
I have recently been trying to implement a health bar into my game, without having to edit setuplevel, as then I would just have no HUDs whatsoever, so I have made this script, so that I would not need to edit the file.

So here is my script, you have full permissions, so long as I am credited, (and all the other people that have been creditied in the script (its only fair, thanks for pointing that out Mr Illusionest) as this is my first released script, even if I was helped a lot, and used another script as a template.



This works on the player having 100 health, so if you want it to be 500, you will have to change it yourself.
As the code says, it is not completely my script, it was originally made my the user Reyvyn, and I just refined it.

To use it, set it as the main script for dynamic light. I will leave it up to you to make the huds, you will need to make 20, and put the in the gamebank\huds folder, under a subdirectory called 'healthhuds'.

To make the dds pictures, you can be like me and use gimp and get the dds plugin from the gimp website.
Please note that they must be dds images, unless you changed that part in the script

Name them hHudx (x being 1 through to 20), and they must all be in the healthhuds subdirectory of the gamecore folder.

I hope this was discriptive eneough for you all. Let me know if you have any problems.

Enjoy!

EDIT
It is now finnished. When you reach 0 health, it doesnt display a HUD, but when you respawn, it shows the correct huds. I will fix this in my next release.

Let me know if this no longer works and I will have a look at it.

Windows 7 ultimate x64, Intel i7, 4 GB RAM, NVIDIA GEFORCE 330m 1GB
Flash Star Game Creations
Seth Black
FPSC Reloaded TGC Backer
20
Years of Service
User Offline
Joined: 22nd Feb 2005
Location: Pittsburgh, PA
Posted: 2nd Oct 2010 18:09
...good attempt.

You have several hudname=x typo bugs that need to be corrected for this work function correctly, though.

Michael Thompson
16
Years of Service
User Offline
Joined: 15th Aug 2008
Location: Behind you (if not, in australia)
Posted: 2nd Oct 2010 18:20 Edited at: 4th Oct 2010 10:09
And here is the early release of version 2.
Changes, states have been fixed (it went from state 7 back to 5 or something like that)

OUTDATED AND REMOVED

Windows 7 ultimate x64, Intel i7, 4 GB RAM, NVIDIA GEFORCE 330m 1GB
Flash Star Game Creations
Michael Thompson
16
Years of Service
User Offline
Joined: 15th Aug 2008
Location: Behind you (if not, in australia)
Posted: 2nd Oct 2010 18:24
@ seth Black
Thanks. i realise it is buggy and i am working on that.
its a work in progress so therefor it will not be perfect, but i am working on this script and this script only.
Version 2 of this script has improvewd it a little, but not completely so i am hoping that tomorrow i will have it fixed and finnished.

Enjoy all and keep your eyes on this forum page and i will tell you when i have it working properly.

Enjoy and keep at it.

Windows 7 ultimate x64, Intel i7, 4 GB RAM, NVIDIA GEFORCE 330m 1GB
Flash Star Game Creations
Michael Thompson
16
Years of Service
User Offline
Joined: 15th Aug 2008
Location: Behind you (if not, in australia)
Posted: 2nd Oct 2010 18:27
Btw, thx seth black. i had already realised but it is nice that people are willing to help.

Thanks mate.

Windows 7 ultimate x64, Intel i7, 4 GB RAM, NVIDIA GEFORCE 330m 1GB
Flash Star Game Creations
Michael Thompson
16
Years of Service
User Offline
Joined: 15th Aug 2008
Location: Behind you (if not, in australia)
Posted: 2nd Oct 2010 18:42
OK, i have done my best, now I need help.
When my character gets lower than 75 health, the silhouette no longer works, no matter how much health i have got, and if my health increases, the silhouette does not update to the current health.
Pretty much, once it gets to 75, it stops. Can anyone help please?
Thanks.

Windows 7 ultimate x64, Intel i7, 4 GB RAM, NVIDIA GEFORCE 330m 1GB
Flash Star Game Creations
Gencheff
14
Years of Service
User Offline
Joined: 12th Jun 2010
Location: UK by way of USSR
Posted: 2nd Oct 2010 19:33
Because everything in the script is WRONG.

hHud15 does not exist as a hudname first of all.
Second of all you have copied all huds twice for no reason.

calling a hud with hudshow uses hudname , NOT the image name!

Michael Thompson
16
Years of Service
User Offline
Joined: 15th Aug 2008
Location: Behind you (if not, in australia)
Posted: 3rd Oct 2010 07:29
Wow, i have majorly screwed up havent I?
I know that it gets to hhud15 and goes no lower, but does respond when your health recharges. I think I know why, and I will correct it now.

Btw Gencheff, i dont know whether you meant that in an agressive way, but it looks to me that you are aggrivated with me. I am only learning, and I will make mistakes. I know that you were once learning and you would have made mistakes. I have set the hudname to the same as the image name (without the extension) and it displays them.

If you havent meant to be aggressive, please clear that over so that we can work more smoothly, as right now, this comminuty is the only place i can go now to escape my real life, and I do not want bullying to follow me into the forums.

Thanks, and I will upload the code when it is fixed, and if its still not working, I will say so.

Windows 7 ultimate x64, Intel i7, 4 GB RAM, NVIDIA GEFORCE 330m 1GB
Flash Star Game Creations
Michael Thompson
16
Years of Service
User Offline
Joined: 15th Aug 2008
Location: Behind you (if not, in australia)
Posted: 3rd Oct 2010 08:58 Edited at: 4th Oct 2010 09:51
Ok, now I have a problem where when the game begins, it displays the hud. When you get hurt, it displays the HUD, but when your health starts to regenerate, the HUDs dissapear, and when your health is below 51, the huds dissapear altogether.

OUTDATED AND REMOVED

Any help will be good.
Thanks.

Windows 7 ultimate x64, Intel i7, 4 GB RAM, NVIDIA GEFORCE 330m 1GB
Flash Star Game Creations
Gencheff
14
Years of Service
User Offline
Joined: 12th Jun 2010
Location: UK by way of USSR
Posted: 3rd Oct 2010 12:21
I guess I was in a grouchy mood... I'm sorry if it sounded rude , I'm the most cheerful guy around actually

And yes I have made mistakes , but to tell you the truth I haven't asked for any help (weird huh?)

Now to help you with your problem :

My friend,you don't need 40 states for a simple health script.

Quote: ":state=39,plrhealthless=1:hudunshow=hhud01,state=40
:state=40,plrhealthless=1:hudshow=hhud0,state=41"


The thing that bothers me is how complex you are trying to make it.
Those lines could be combined in 1 and afterwards it'll be easier to edit and not so clogged up (spelling?)

Bottom line,states are not necessary.

This is how I would do it :



And so on , just by playing with less and greater values.

Michael Thompson
16
Years of Service
User Offline
Joined: 15th Aug 2008
Location: Behind you (if not, in australia)
Posted: 3rd Oct 2010 13:15
Thanks for clearing that up, its ok. just how you bolded the words. I understand, every1 gets grouchy sumtimes, so lets get past that now aii.
And I will try your suggestion, and get back to you thanks.
(btw, i had the 40 states coz i thought that it may make it a little easier to locate it all.

Thanks.

Windows 7 ultimate x64, Intel i7, 4 GB RAM, NVIDIA GEFORCE 330m 1GB
Flash Star Game Creations
Michael Thompson
16
Years of Service
User Offline
Joined: 15th Aug 2008
Location: Behind you (if not, in australia)
Posted: 3rd Oct 2010 13:45
Is there any script that hides all huds, to the best of your knowledge?

Windows 7 ultimate x64, Intel i7, 4 GB RAM, NVIDIA GEFORCE 330m 1GB
Flash Star Game Creations
Michael Thompson
16
Years of Service
User Offline
Joined: 15th Aug 2008
Location: Behind you (if not, in australia)
Posted: 3rd Oct 2010 14:40 Edited at: 4th Oct 2010 09:42
btw, here is the script as you suggested it. the problem is that it only shows hud 20, and none of the rest (hud 20 stays there and does not dissapear)

OUTDATED AND REMOVED

EDIT
Ok, thx Mr illusionest, you realised that i had made a mistake, where it should have been
:state=22,plrhealthless=1,plrhealthgreater=-1:hudunshow=hHud01,hudshow=hHud0,state=2
it was
:state=22:plrhealthless=1,plrhealthgreater=-1:hudunshow=hHud01,hudshow=hHud0,state=2
Fixed, thx.

Windows 7 ultimate x64, Intel i7, 4 GB RAM, NVIDIA GEFORCE 330m 1GB
Flash Star Game Creations
Mr illusionest
16
Years of Service
User Offline
Joined: 5th Mar 2009
Location: Cairo , Egypt
Posted: 3rd Oct 2010 15:53
@Michael Thomson:

Sorry If my words will be rough , But you still don't understand scripting basics , I suggest you read the community guide before trying to do anything complexed like this , The mistakes you made can be accepted when doing a simple script and asking for help , but with something complexed like this and you are posting a thread about it is not actully nice , you should have fully tested it before releasing it .

The mistakes in your script are 2:
1- You have 3 of these things ( in each line of the HUDs appearing , They should be 2 : one at the start of the line and the other to seperate between actions and conditions , I will let you discover which one to remove by yourself .

2- What if you get a health extra , that will make no HUD change , your script is made to little health decreases only , which have ruined the whole script idea .

I'm still insisting not to fix the script myself , Because you are missing the very basics of FPI scripting , Read the community guide .

Cheers

"I am the night visitor when everyone is sleep , and when the last light fades"
The illusionest
Michael Thompson
16
Years of Service
User Offline
Joined: 15th Aug 2008
Location: Behind you (if not, in australia)
Posted: 3rd Oct 2010 17:37 Edited at: 3rd Oct 2010 18:27
Fair eneough. I released it for help, but it has become an epic fail. I will read the guide (do you mean ofpscguide?) As for the mistakes, i know that there should be 2 : things per a line to separate the actions and conditions, and I know that it doesnt respond well to increasing health.

Anyway, did you learn scripting by reading the guide?

Also, is there an or command?

Windows 7 ultimate x64, Intel i7, 4 GB RAM, NVIDIA GEFORCE 330m 1GB
Flash Star Game Creations
Mr illusionest
16
Years of Service
User Offline
Joined: 5th Mar 2009
Location: Cairo , Egypt
Posted: 3rd Oct 2010 22:56
Quote: "Anyway, did you learn scripting by reading the guide?"


No , I learned scripting after months of trying and failing , and after reading the manual that was really hard to find your way in , because I didn't know about ofpscguide.pdf until late , and because I couldn't make a game that satisfies my need ....

Quote: "Also, is there and or command?"


No , but there is a really nice way to do it , for example :


Look at it and you will understand everything .

Sorry for my last post if I was rough , But I really went crazy when I saw this :
Quote: "you have full permissions, so long as I am credited"


You can't be credited , because you edited the script not made it from scratch , and you shouldn't have said that because that script is really simple and any low knowledge scripter can make it with kinda hard effort , and because it's not perfect and getting fixed , so you were helped by 5 members till now

Cheers

"I am the night visitor when everyone is sleep , and when the last light fades"
The illusionest
Michael Thompson
16
Years of Service
User Offline
Joined: 15th Aug 2008
Location: Behind you (if not, in australia)
Posted: 4th Oct 2010 08:42
Ok, fair eneough, I didnt make it from scratch, but the idea was for those who cant script (basically, like me), to be able to use it so long as i am credited. Also, i am going to (and was going to from the start) place in a big thanks to everyone who helped. As for the or command, I was worried you would say that, and therefore, whould have to structure it like that. But so long as it works, I am happy.

As for crediting all of you, I will do that now.

Windows 7 ultimate x64, Intel i7, 4 GB RAM, NVIDIA GEFORCE 330m 1GB
Flash Star Game Creations
Michael Thompson
16
Years of Service
User Offline
Joined: 15th Aug 2008
Location: Behind you (if not, in australia)
Posted: 4th Oct 2010 09:38 Edited at: 4th Oct 2010 14:08
IT'S ALIVE!
I have it working properly now, and I have updated the top code snippet and will make sure that all the rest say outdated.

BTW, thanks for all the help everyone.

EDIT

OK, it was working when I uploaded it. Now it is not working. And I dont have a clue why, because, I did not edit it, nor did I move any of the HUDs or rename or edit them. Can anybody see a problem with it?

Windows 7 ultimate x64, Intel i7, 4 GB RAM, NVIDIA GEFORCE 330m 1GB
Flash Star Game Creations
A dude
15
Years of Service
User Offline
Joined: 15th Mar 2010
Location: The Solar System
Posted: 29th Nov 2010 01:14
Thanks for this script! I'll try it.
Michael Thompson
16
Years of Service
User Offline
Joined: 15th Aug 2008
Location: Behind you (if not, in australia)
Posted: 29th Nov 2010 06:37
your welcome, and let me know if it doesnt work.

Windows 7 ultimate x64, Intel i7, 4 GB RAM, NVIDIA GEFORCE 330m 1GB
Flash Star Game Creations
A dude
15
Years of Service
User Offline
Joined: 15th Mar 2010
Location: The Solar System
Posted: 29th Nov 2010 21:30
Is hhud1 supposed to be the lowest or highest amount of health?
Michael Thompson
16
Years of Service
User Offline
Joined: 15th Aug 2008
Location: Behind you (if not, in australia)
Posted: 30th Nov 2010 11:42
That is when you are out of health.

Windows 7 ultimate x64, Intel i7, 4 GB RAM, NVIDIA GEFORCE 330m 1GB
Flash Star Game Creations
A dude
15
Years of Service
User Offline
Joined: 15th Mar 2010
Location: The Solar System
Posted: 30th Nov 2010 16:41 Edited at: 30th Nov 2010 16:45
IT WORKS! Thank you for this script.
Michael Thompson
16
Years of Service
User Offline
Joined: 15th Aug 2008
Location: Behind you (if not, in australia)
Posted: 30th Nov 2010 17:20
You are welcome. I will also be refining it soon so that it uses more HUDs, because it will then be a lot smoother. Also, I will attach a picture of what I have done with my health hud, to show how I have both a health indicator and the 'blood' or whatever it is that creeps in around the screen the more health you lose. It is just one picture, and to do it, I just used the 'eyehud' image, changed the transparency, and added a silhouette to indicate the health.

Windows 7 ultimate x64, Intel i7, 4 GB RAM, NVIDIA GEFORCE 330m 1GB
Flash Star Game Creations

Attachments

Login to view attachments

Login to post a reply

Server time is: 2025-06-04 21:09:43
Your offset time is: 2025-06-04 21:09:43