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 / Im lost with this HUD tutorial #4 by Plystire

Author
Message
Skynet Games
16
Years of Service
User Offline
Joined: 20th Sep 2008
Location: At home, building stuff.
Posted: 8th Aug 2011 23:00
It should be the 4th line in the second block of code. (4th line after the space)

Using our scripting knowledge attained thus far, let's break down what's going on here:

Check if the script's "state" variable is set to "0".
If it is, then:
- Prepare the engine to make a new HUD.
- Set the Center of the HUD 5% across the screen and 5% down the screen.
- Load an image called "lives.tga" into the HUD.
- Finish making the HUD as a "display" HUD.

Awesome!!! We have already covered everything used in this line! And from the name of the image loaded, you can probably guess that this HUD has something to do with the "Lives" HUD shown in the game. Well it does! In fact, it is the text shown on your screen that reads "LIVES".



Quote: "- Set the Center of the HUD 5% across the screen and 5% down the screen."


looking at this tutorial, i see in the code above. It doesn't have the (%) but plystire is saying set the hudx=5, and the hudy=5 to hudx=5% and hudy=5% Im lost here, do i put the (%) sign in with the code or does he mean something else by it?

and i have downloaded the file he submitted, but i broke it down in to three parts. Health1, Ammo1, and Lives1

Can some one give me some help here because i don't think I'm understanding what hes saying..

Speed of the wolf, power of the pack!!
http://www.wolfgames.110mb.com/home.html
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 9th Aug 2011 02:42
The value for hudx; and hudy; is a percentage of the screen width and height. The numerical value is all that’s needed. There is one thing missing from your snippet and the tutorial; hudtype=1.



WickedX
Skynet Games
16
Years of Service
User Offline
Joined: 20th Sep 2008
Location: At home, building stuff.
Posted: 9th Aug 2011 04:15
Here is a screenshot of a hud i designed, now i would like to know how to import this in to FPSC. Im clueless as to what to do next, do i have to brake this down like cut the hud in to sections and save it as different jpg segments and then go in to fpi editpad and position the hud back on the screen in pieces?

Speed of the wolf, power of the pack!!
http://www.wolfgames.110mb.com/home.html

Attachments

Login to view attachments
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 9th Aug 2011 05:42 Edited at: 9th Aug 2011 05:44
Here is an in-game screenshot using your image.



The image doesn't need to be split up. but you do need to use DDS or TGA file format and add a alpha channel transparency. Back up the setuplevel.fpi script in the "languagebank\english\gamebank\mygame" folder and replace with this.



I will leave it to you to reposition the numeric hud's too match.

Edit: Attached is the TGA image I used.

WickedX

Attachments

Login to view attachments
Skynet Games
16
Years of Service
User Offline
Joined: 20th Sep 2008
Location: At home, building stuff.
Posted: 9th Aug 2011 20:53
How do i get it to show up in FPSC?

Speed of the wolf, power of the pack!!
http://www.wolfgames.110mb.com/home.html
Skynet Games
16
Years of Service
User Offline
Joined: 20th Sep 2008
Location: At home, building stuff.
Posted: 10th Aug 2011 04:39
Come on guys, i see the view counter going up and still not many replies? Now i thank WickedXGames for his help. But I'm now snagged on how to get this in to FPSC, i did what he said. I took the code and put it in the FPI edit pad, THEN! i took the fpi document (script file) and put it in the directory the tutorial said to put it in, Now. I took the image in put it ware it said to put it as well and it STILL isn't showing up, I've been working on this all day moving the files around from directory to directory, then figured ok. If it's not a directory problem then it has to be an issue in the code.. Now i been looking it over and i don't see anything wrong with it accept the fact i need to resize it, but i noticed when i took damage THATS when my hud showed up but only for a split second and it looked All red and distorted? then the hud vanished.

How do i get it to actually keep the hud ON SCREEN when you first launch it?

Now i know many of you have lives and this question has been asked over, and over, and over, and over. But I'm 2 levels in to this project and i don't want to quit now, i have an idea in my head and i want to turn it in to a game. No matter how bad the hud may look or how basic the graphics look, but to me it looks like something i would enjoy doing. And yes, i have been enjoying this project for awhile now. But i am hung up on this and i really want to get the hud working, so can some one tell me what I'm not doing right?

Option one, tried and failed.
I took a trigger zone and put it outside of the level with the setuplevel script that was changed to specify my hud, i put the script in the global settings and then put the hud in the "Lives" selection, temp.tga followed by the directory the image is in. Still didn't work, then i tried the ammo, then the health and so on.

Then i tried to put it in the damage part "eyehud" didnt work, so im at a standstill.

Speed of the wolf, power of the pack!!
http://www.wolfgames.110mb.com/home.html
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 10th Aug 2011 06:44
I have put it all together in the attachment. Extract it to you desktop for study. Then copy it to your FPSC directory. Start FPSC make a small room or level. Then run a level test. Oh, and don't forget to lay a Start Marker are the hud's won't appear.

WickedX

Attachments

Login to view attachments
Skynet Games
16
Years of Service
User Offline
Joined: 20th Sep 2008
Location: At home, building stuff.
Posted: 10th Aug 2011 07:54 Edited at: 10th Aug 2011 08:05
I have a sneaking suspicion those greened out lines had something to do with my problem...

By the way i have the files in the correct folder. Now what do i do about the global script?

Speed of the wolf, power of the pack!!
http://www.wolfgames.110mb.com/home.html
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 10th Aug 2011 18:50 Edited at: 10th Aug 2011 18:53
Quote: "I have a sneaking suspicion those greened out lines had something to do with my problem..."


Wrong; Since I replaced the lives HUD with yours, I just commented out the health and ammo.

The setuplevel.fpi script is the global script.
Skynet Games
16
Years of Service
User Offline
Joined: 20th Sep 2008
Location: At home, building stuff.
Posted: 10th Aug 2011 21:06
Ok, i went in to the global script and positioned the hud in to the center of the screen as best i could, 50 across and 49 down. Now how do i scale it so that it fills the screen and i still cant figure out how to get it to show up in the game.

Speed of the wolf, power of the pack!!
http://www.wolfgames.110mb.com/home.html
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 12th Aug 2011 07:48
Post your setuplevel.fpi script here (in a code snippet) so we can see what you've done and what may have gone wrong.

Scaling the image is up to you. Whatever size you've made it, that's how large it will be in the game.


~Plystire

A rose is only a rose until it is held and cherished -- then it becomes a treasure.
Skynet Games
16
Years of Service
User Offline
Joined: 20th Sep 2008
Location: At home, building stuff.
Posted: 13th Aug 2011 02:30 Edited at: 13th Aug 2011 02:34
Quote: "Post your setuplevel.fpi script here (in a code snippet) so we can see what you've done and what may have gone wrong.

Scaling the image is up to you. Whatever size you've made it, that's how large it will be in the game.


~Plystire"


I think i have it some what figured out. But the problem is when i run it in test mode in FPSC the hud doesn't show up, but when i compiled the game and ran it. The damn thing showed up, and i was thinking to my self "The hell?"

here is the code


This is the line of code i changed


My question is that why didn't it show up in the test/debug mode of FPSC but it showed up when i tested it in a compiled version.

Speed of the wolf, power of the pack!!
http://www.wolfgames.110mb.com/home.html
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 13th Aug 2011 02:32
Hi Chris,

I got your email. There are a couple things I don’t understand. You talk about a trigger zone. I have no clue why you need a trigger zone to display this HUD. Also you mention the global script. The “setuplevel.fpi” is the global script. I have altered the script so if you edit it with FPSC editor it will probably reset to the default. Extract my download and copy it to you FPSC directory. Do not edit the global setting in FPSC, use FPI Editpad or Notepad if you need to edit anything else in the global script (setuplevel.fpi). If this doesn’t work then I’ll need more details of the steps your taking and the scripts.

Hope this helps.
Skynet Games
16
Years of Service
User Offline
Joined: 20th Sep 2008
Location: At home, building stuff.
Posted: 13th Aug 2011 02:38
Quote: "Hi Chris,

I got your email. There are a couple things I don’t understand. You talk about a trigger zone. I have no clue why you need a trigger zone to display this HUD. Also you mention the global script. The “setuplevel.fpi” is the global script. I have altered the script so if you edit it with FPSC editor it will probably reset to the default. Extract my download and copy it to you FPSC directory. Do not edit the global setting in FPSC, use FPI Editpad or Notepad if you need to edit anything else in the global script (setuplevel.fpi). If this doesn’t work then I’ll need more details of the steps your taking and the scripts.

Hope this helps. "


Thanks wicked, i have made a video of the test game. But this is when i ran it as a compiled game, you wont see the little bars down below like you normally would in the test/debug part of it.

http://www.youtube.com/watch?v=CAFQ7wzRHaw&feature=channel_video_title

Speed of the wolf, power of the pack!!
http://www.wolfgames.110mb.com/home.html

Login to post a reply

Server time is: 2024-11-27 23:09:36
Your offset time is: 2024-11-27 23:09:36