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 Picture changes, 75%, 50%, 25% health (help)

Author
Message
Toffeemouse
14
Years of Service
User Offline
Joined: 29th Apr 2010
Location: United Kingdom
Posted: 12th Mar 2012 04:02
Hi there, I am trying to make it so instead of the generic numbers, five images will display the players health: one at 100%, one at 75%, one at 50%, one at 25% and one when dead.

Here is what I have so far (this is my setup.fpi file)



Is that looking good? I am a a very novice scriptwriter, infact I have almost no experience and scavange bits off others here and there. I think I have the values put in correctly.

Once complete what do I do with it, do I have to build my game and then insert the script into the completed game files or can I use this script in my "test games" during the editor? I have never edited setup.fpi before.

Thanks,
Toffee
angusm3
15
Years of Service
User Offline
Joined: 6th Mar 2009
Location: Right behind you...
Posted: 12th Mar 2012 06:10
though it is possible to put scripts straight into the setup.fpi, I would not recommend it. Instead, place a trigger zone somewhere in your level that the player will never be and use the script on it.

messing around with the states in the setup.fpi can make your game stop working.

I appear to have burst into flames...
Toffeemouse
14
Years of Service
User Offline
Joined: 29th Apr 2010
Location: United Kingdom
Posted: 12th Mar 2012 13:02 Edited at: 12th Mar 2012 13:03
In that case, should I just put the following script in a trigger zone:



as wont two setup.fpi's be running, the original and the one I place in a trigger zone? I dont know how this should be done.
Leon Kennedy
16
Years of Service
User Offline
Joined: 7th Sep 2008
Location: Neither here nor there
Posted: 12th Mar 2012 17:17 Edited at: 12th Mar 2012 17:19
Yes, put that script in a trigger zone. Rename it to be something like playerhuds.fpi, or something along those lines. Then make that the triggerzone's main.

However, you need to add a line to actually get to state 1. Chang the last state = 0 line to be:



Priest of the Church of Joe Wood

In memory of Nanee. 9/1/1993 - 5/16/2009. Rest in Peace, little girl.
rolfy
18
Years of Service
User Offline
Joined: 23rd Jun 2006
Location:
Posted: 14th Mar 2012 02:14 Edited at: 14th Mar 2012 02:20
At best you will have both the original setuplevel.fpi huds running and the triggerzone huds sitting on top if you do it the way you intend. If your going to do it this way (triggerzone) then you have to remove any health hud info from the setup anyhow and it kinda defeats the purpose.
Personally I always make any changes to huds using setuplevel.fpi, just back up your original.
If you make any changes (such as skybox) in the global editor settings, the setuplevel.fpi will default to original (removing any hud scripting you put into it), this is the reason I prefer to make any changes by hand and never use the global editor.

Heres a link to one I gave away before.
http://forum.thegamecreators.com/?m=forum_view&t=166815&b=24

Awesome! Its one of those threads.
Toffeemouse
14
Years of Service
User Offline
Joined: 29th Apr 2010
Location: United Kingdom
Posted: 14th Mar 2012 13:14
Thanks, so I am figuring I build game as-is, go into my setup.fpi in the completed games folder - change all my health huds, numerics etc to a transparent .tga. Then place my health huds in their place.
maho76
13
Years of Service
User Offline
Joined: 31st May 2011
Location: universe-hub, playing the flute
Posted: 15th Mar 2012 11:47 Edited at: 15th Mar 2012 11:48
Quote: "Thanks, so I am figuring I build game as-is, go into my setup.fpi in the completed games folder - change all my health huds, numerics etc to a transparent .tga. Then place my health huds in their place. "


nop, you have to implement the huds BEFORE build a final game because the HUDS are merged into the level.zip or universe.dbo (dont know where, but they are not in there original folders when finalbuild a game).

open languagebank/mygame/... levelsetup.fpi (standard setup, check if you changed destination) and do your changes (dont forget savety copy), then it will work, even in testgame.

Toffeemouse
14
Years of Service
User Offline
Joined: 29th Apr 2010
Location: United Kingdom
Posted: 16th Mar 2012 00:27 Edited at: 16th Mar 2012 00:30
Thanks, I edited my setuplevel.fpi (After making a backup), however now the first hud:

"hudimage=languagebank\english\gamecore\huds\health100.dds"

appears, covering the whole screen, and will not change to health75/health50/health25 when taking damage.

How do I remedy my problem

Edit: Now the FPI has reverted back to the original! How do I stop it doing that, its a nightmare.
Edit: Going on what rolfy has previously said Im going to assume that it's something everyone just has to deal with :/
maho76
13
Years of Service
User Offline
Joined: 31st May 2011
Location: universe-hub, playing the flute
Posted: 16th Mar 2012 17:38 Edited at: 16th Mar 2012 17:45
i based my healthhuds on the one done by rolfy.

it works with 12 steps, but you will find a description how to setup your levelsetup.fpi.

look at first lines of HUD-CREATOR and HEALTH CONTROLLER and just edit the HUDS provided by rolfy and finally set them to right x/y-coordinates. then, if you wish, delete his HUD-backgrounds and animations (scifihud1.png & ammo.png, scifi10001-10020.png) out of the script. its very easy to do based on his setup.


thanks again, rolfy.

gz

Toffeemouse
14
Years of Service
User Offline
Joined: 29th Apr 2010
Location: United Kingdom
Posted: 16th Mar 2012 20:46 Edited at: 16th Mar 2012 21:03
I seem to have done something wrong somewhere,
I have reverted my setup.fpi to the original and when I test-level this happens: (see attatched)

It's not even the health hud that I use, its an old image. No matter what I do i cant get rid of it. Any suggestions?!

Edit: Even if I delete the image at its source I still get a whole different HUD setup and no way of changing the images.

Real nightmare, made a new .fpg and kept it all vanilla but I still get a strange picture for my ammo. Tried making another .fpg with everything vanilla BUT using Rolfys setup.fpi - still the same problem!

How do I fix :<

EditEdit: If i "build game" rolfys huds appear, but its going to be a complete pain to keep building game again and again to get everything perfect

Attachments

Login to view attachments
bruce3371
14
Years of Service
User Offline
Joined: 4th Aug 2010
Location: Englishland
Posted: 16th Mar 2012 21:23
I had a similar problem to this a while ago.

Do you have a dedicated sub-folder for your game in your gamebank folder?

If you do, you need to copy the contents of that folder to the mygame folder, as the editor uses the mygame folder for test builds (but it uses your game's folder when it builds your game).

Hope this helps.

Toffeemouse
14
Years of Service
User Offline
Joined: 29th Apr 2010
Location: United Kingdom
Posted: 16th Mar 2012 22:29
Ah thanks Bruce, I thought I was being organised by having a folder for each game, didnt realise this was the case.

@Rolfy: I have managed to set up your beautiful hud script to use my 12 images and it is working great thanks - could you please tell me what line I need to edit to make my health pictures appear at the bottom-left most corner of the screen? And X & Y axis if you know them. I am sure I could figure the axis out by trial and error but I dont know which line of your script to edit.

Thanks,
Toffee
bruce3371
14
Years of Service
User Offline
Joined: 4th Aug 2010
Location: Englishland
Posted: 16th Mar 2012 23:00 Edited at: 16th Mar 2012 23:01
Quote: "Ah thanks Bruce, I thought I was being organised by having a folder for each game, didnt realise this was the case."


You were doing the right thing, as the editor uses those folders when it builds your games. It only uses the mygame folder for test builds...

Toffeemouse
14
Years of Service
User Offline
Joined: 29th Apr 2010
Location: United Kingdom
Posted: 16th Mar 2012 23:38
I have given up using the editor, im just going to edit the text file from now on, it causes too much quandry.

Found out the correct coords, bottom left is x=8 y=88, for me anyway.

I think this thread is finished, thank you everyone for the help.
rolfy
18
Years of Service
User Offline
Joined: 23rd Jun 2006
Location:
Posted: 17th Mar 2012 06:52 Edited at: 17th Mar 2012 06:57
Quote: "I have given up using the editor, im just going to edit the text file from now on, it causes too much quandry."


Quote: "Personally I always make any changes to huds using setuplevel.fpi, just back up your original.
If you make any changes (such as skybox) in the global editor settings, the setuplevel.fpi will default to original (removing any hud scripting you put into it), this is the reason I prefer to make any changes by hand and never use the global editor."


I knew you would get there eventually.


Now back up your own setup script so you dont lose it.

Awesome! Its one of those threads.
Toffeemouse
14
Years of Service
User Offline
Joined: 29th Apr 2010
Location: United Kingdom
Posted: 17th Mar 2012 13:12
ROLFYYY I have gone and broken your script! Now only image 12 is showing from the start and they wont change!



I dont know how I managed to break it (This one just changes images rather than having a bar that depletes so i deleted all the other showhealths that it didnt need)It was working fine yesterday.
maho76
13
Years of Service
User Offline
Joined: 31st May 2011
Location: universe-hub, playing the flute
Posted: 17th Mar 2012 13:34 Edited at: 17th Mar 2012 13:37
in "Health Controller" you have to give an hudunshow=x to each healthhud you dont wanna show for each hud you want to show so that the former shown dissappears, or it will stay on screen below the new one showing up. hudreset doesnt work for this.

so instead of

":state=1,plrhealthless=69,plrhealthgreater=60:hudreset,hudshow=health5"

you have to use what rolfy does:

":state=1,plrhealthless=69,plrhealthgreater=60:hudreset,hudshow=health5,hudunshow=health1,hudunshow=health2,hudunshow=health3,hudunshow=health4,hudunshow=health6,hudunshow=health7,hudunshow=health8,hudunshow=health9,hudunshow=health10,hudunshow=health11,hudunshow=health12"

trust him, he knows what he does.

quote Syntax Script List3:
"3.12.2.21 HUDRESET
Description: This resets the HUD variables in preparation for a new HUD to be created. This action should be used before any other action used to define a new HUD."

you should start to learn propper scripting when you want to customize your game that far.

Toffeemouse
14
Years of Service
User Offline
Joined: 29th Apr 2010
Location: United Kingdom
Posted: 17th Mar 2012 15:19
I see :< I know what I did, I mistook hudunshow for hudshow, and had a lapse of concentration and thought that full health on rolfys system was achieved by showing 12 individual squares rather than a whole picture.

I have restored the script, it now correctly shows the first health image, but does not go through the chain.

It shows full health at 100% health, and the picture for when the character has died - but it doesnt transition through the pictures.

I know I am being annoying but im finding that Im learning quite a lot from making these mistakes. At this stage i cant see anything wrong though:

Login to post a reply

Server time is: 2024-11-24 03:03:49
Your offset time is: 2024-11-24 03:03:49