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 / Clickable hud?

Author
Message
Dragon slayer
18
Years of Service
User Offline
Joined: 3rd Nov 2006
Location: Bourbonnais Illinois
Posted: 6th Nov 2012 19:20
Is it possible to make a script that will call up a hud that could have a list of options that can be clicked on? Is there already one of those in FPSC? I don't know if there is, or what to look for?

Thanks
Dragonslayer
kingofmk98
13
Years of Service
User Offline
Joined: 30th Jul 2011
Location: Everywhere
Posted: 6th Nov 2012 19:27 Edited at: 6th Nov 2012 19:27
yes it is possible but i really don't know to much on how to make them, well at least im pretty sure you can.


Dragon slayer
18
Years of Service
User Offline
Joined: 3rd Nov 2006
Location: Bourbonnais Illinois
Posted: 6th Nov 2012 20:01
Well I don't know a lot about making them either. I have been back and forth between this and DBP. Still not sure if I want to make a game with FPSC or DBP but am really enjoying learning DBP. I am really afraid if I start a game in FPSC I will get into it and put DBP on the back burner and I don't want to do that! Anyway

I think you can make this script maybe someone more in the know will post here!
Dragon slayer
18
Years of Service
User Offline
Joined: 3rd Nov 2006
Location: Bourbonnais Illinois
Posted: 6th Nov 2012 20:15
Actually I want the script to be triggered when player steps into a building. I want the hud to come up and say you have entered such and such building. I am so and so what would you like to do? and then a list of options that they can do in that building.

I am not sure how to do it so I guess the best way to learn is to make the hud, try to script it, set up a bldg. and test it.
BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 6th Nov 2012 20:20 Edited at: 6th Nov 2012 20:21
Quote: "Is it possible to make a script that will call up a hud that could have a list of options that can be clicked on?"


Take a look at the "Titlepage.fpi" or "setuplevel.fpi" scripts that are located in your "\languagebank\english\gamebank\GAMEFOLDER" (where GAMEFOLDER is where your files for the development are). By default, the editor uses "languagebank\english\gamebank\mygame\". These scripts contain "buttons" that the user clicks. That should get you thinking in the direction. The section specific I am referring to is "; Game Menu" for these two files, and specifically the "hudselectionmade=x" command which refers to the huds that are defined in the beginning of the script.

For example, in a "titlepage.fpi":



In the third "state=0" line we have the "loadgame.tga" button defined and it uses hudtype 2. Notice in the fourth "state=4" line we have "hudselectionmade=2". That means the player clicked that hud, and therefore run the command(s0 specified.

NOTE- my above example is from my current version and may not be the same as the newer versions, but the concept still is the same.

One thing to keep in mind when doing things like this- if you want a script in the game to display a hud where players can click, you may need to use the "pausegame/resumegame" commands. otherwise, the game continues to run when they access this and they may miss out something important.

Quote: "Actually I want the script to be triggered when player steps into a building. I want the hud to come up and say you have entered such and such building. I am so and so what would you like to do? and then a list of options that they can do in that building."


You can do so by having the hud displayed and then the script has lines with the "scancodekeypressed=x" for each choice. When they select the key, this happens, etc.


There's no problem that can't be solved without applying a little scripting.
Dragon slayer
18
Years of Service
User Offline
Joined: 3rd Nov 2006
Location: Bourbonnais Illinois
Posted: 6th Nov 2012 21:36
I will look at these scripts. I was looking at a list of conditions in the guide and saw this.

HUDSELECTIONMADE=X is true when the user has clicked HUD button X

So that told me it can be done. I actually forgot about these. I have never gone all the way through and built a game or final exe. I should throw a few things on a quick map and do that.
unfamillia
14
Years of Service
User Offline
Joined: 26th Jul 2010
Location: Preston, Lancashire
Posted: 9th Nov 2012 13:53
I have wondered about this myself. I have seen a few games with computer monitors with actual working menus on them.

I have always wondered how people achieve this!

Unfamillia

BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 9th Nov 2012 16:45
Quote: " I have seen a few games with computer monitors with actual working menus on them.

I have always wondered how people achieve this!"


There are a couple of ways to do it. One is to animate the computer screen using FragMotion by "animating" specific parts of the monitor screen (ex: selecting a button causes the button to move and a new screen comes up). Another method is to use the "videotexture" technique that was introduced into the source. By selecting a key to press can determine what "video" is played on the model.


There's no problem that can't be solved without applying a little scripting.
Meows
13
Years of Service
User Offline
Joined: 12th Oct 2011
Location: Totally over the Rainbow
Posted: 9th Nov 2012 17:06
Ched80 :: Maptastic - The clickable map creation kit

http://forum.thegamecreators.com/?m=forum_view&t=187353&b=21


Login to post a reply

Server time is: 2024-11-23 19:51:13
Your offset time is: 2024-11-23 19:51:13