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 / Trigger Zone (Health Hud)

Author
Message
Thistle Studios
18
Years of Service
User Offline
Joined: 1st Mar 2007
Location: Kirkcaldy
Posted: 5th Oct 2007 23:45
I've found a way to create an animating hud without the need for rewriting the setuplevel.fpi, using the same way you create text, you can make a hud which, if your health drops down, your custom hud signifys what happens.
Problem is, i can't get it to work.

Here is the unfinished code



Im a new user, im young and FPI-dyslexic, i simply dont have the foggiest and cant learn FPI, so copy and paste code snippets please!
Plystire
22
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 6th Oct 2007 03:09
Quote: "Problem is, i can't get it to work."


Hmmm, that's not descriptive enough for me to decide what could be wrong with it.

What exactly is it doing or not doing?

Does NOTHING show up at all? Have you tried getting hit to see if it'll work?

Just a side though, whenever I see the condition "plrhealthgreater" then I think it's checking if the health is GREATER THAN that number and not greaterthan OR EQUAL TO. So maybe you could try "plrhealthgreater=99" and the same goes with "plrhealthless", try putting in "plrhealthless=96".

It's a long shot, but hey, weirder things have happened.


The one and only,
~PlystirE~

In Soviet Russia, road forks you!

Mom: I may not be the alpha and omega, but I can sure as hell be yours!
Thistle Studios
18
Years of Service
User Offline
Joined: 1st Mar 2007
Location: Kirkcaldy
Posted: 6th Oct 2007 12:40
Well, Avid showed us his halo-style hud, which unfortuantely doesn't work, by making a trigger zone which displays how your health is doing.

Ive edited the script so its more understandable and more basic, but when i put it in a trigger zone, all it showed was a black and white hud of when you die.



Im a new user, im young and FPI-dyslexic, i simply dont have the foggiest and cant learn FPI, so copy and paste code snippets please!
Plystire
22
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 6th Oct 2007 13:04 Edited at: 6th Oct 2007 13:11
Okay, first off:

You don't need the "state=0" at the end of any of your hudmaking lines at the top.

Secondly:



That third colon will cause the parser to miss that last part, it needs to be a comma.

Thirdly:

I don't see anywhere in here that says "hudshow=dead", so if you're seeing the dead.bmp come up, something else could be wrong here... maybe the way your huds are being made?

Not sure on that point.

[EDIT]

Try this out instead:



I haven't tried it, but... well, it sounds like it should work.

Also, I might try to vear away from using pure numbers as names for anything... maybe spell-out the number? I dunno... maybe it's just me and my programming teacher's consistent nagging of proper coding structure.


The one and only,
~PlystirE~

In Soviet Russia, road forks you!

<img src="http://www.danasoft.com/sig/PlystiresRoadSign.jpg" border="0">
Thistle Studios
18
Years of Service
User Offline
Joined: 1st Mar 2007
Location: Kirkcaldy
Posted: 6th Oct 2007 23:17
well, the dead thing is fixed... (sigh)

NOTHING IS DISPLAYED! WHAT IS WRONG WITH THE GAME ENGINE?

Have you checked the script, from my logic the "fadeout" meaning the hud will fadeout?

If correct, this would happen


| | 0.0secs later <NOTHING>
| 75 |
|____|

If the fadeout is set to 75 in the show 75 line, the 75 will show for 0.0 seconds and fadeout.

At least, thats what i think, i may be wrong...

Here is an image, there is nothing set there BUT there should be a health hud in between the arrows!

Im a new user, im young and FPI-dyslexic, i simply dont have the foggiest and cant learn FPI, so copy and paste code snippets please!

Attachments

Login to view attachments
Avid
17
Years of Service
User Offline
Joined: 24th Jun 2007
Location:
Posted: 7th Oct 2007 01:21 Edited at: 7th Oct 2007 01:23
Hey wait a minute my hud thing works well on my game. Just bear these points in mind (this may be the problem) If you want to run it in a test game, you need to replace the files in mygame (or whatever the default test thing is called). I backed up the defaults and replaced them with it. Else you have to copy them over manually when you build the game. I had the same problem with them not showing up one time, sometimes it reset the fpi file so I had to replace it again. But it does work, no reason why it shouldn't.

Else I suggest you try it from scratch, someone else posted a tutorial for the standard hud-head system.
Plystire
22
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 7th Oct 2007 08:41 Edited at: 7th Oct 2007 08:42
Quote: "Have you checked the script, from my logic the "fadeout" meaning the hud will fadeout?"


Not true. This is used very commonly in a lot of HUD scripts. This because the line is being run ALL THE TIME. So, the hud is being displayed, then faded out, but then less than a nanosecond later, it's being displayed yet again, resetting the "fade out" sequence back to the start, resulting in a seemingly motionless picture. The fadeout part is in there to make sure that the picture WILL fadeout once the line stops being true.

I'm not sure what else could be wrong, you may wish to look into the source of your pictures. Also, have you changed the names of your huds to something other than numbers? I'm not entirely sure if that would have an effect or not, but it couldn't hurt to try.


The one and only,
~PlystirE~

In Soviet Russia, road forks you!

<img src="http://www.danasoft.com/sig/PlystiresRoadSign.jpg" border="0">
Thistle Studios
18
Years of Service
User Offline
Joined: 1st Mar 2007
Location: Kirkcaldy
Posted: 7th Oct 2007 17:28
Avid, i tried your hud script, i replaced the files but it didn't work.

Hrm... I'm in such a state=0 here, i can't figure out what is wrong...

Im a new user, im young and FPI-dyslexic, i simply dont have the foggiest and cant learn FPI, so copy and paste code snippets please!
Plystire
22
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 8th Oct 2007 02:24
Next time you want to test it, go to File->Preferences and check the box next to "Show Entity Game Info" in the debug section.

When you test the game you will have some text appear where your trigger area is... you will see in this text a part that says "S:#" where the # is what state the script is currently in... if you were using the script that I suggested, it should say "S:1" since it should be in state=1.

This can be useful if you have a different state for each of your scripts actions.

One thing you can do to have this help out a lot is re-program your script to something like this:



That way while viewing your debug text, you can see what state the script is in, and judging by the state, you'll know if the script is correctly determining your player's health.

If it turns out that it is, you may need to start looking into how your images are made, or even... what directory they are in and if that directory is in the correct place to be called from this script.


The one and only,
~PlystirE~

In Soviet Russia, road forks you!

Login to post a reply

Server time is: 2025-05-21 12:30:16
Your offset time is: 2025-05-21 12:30:16