Need Lots of Help with Scripting the GUI For New Blank Game

Started by emma_north1, Fri 17/10/2008 11:58:29

Previous topic - Next topic

emma_north1

I have a huge problem and I'm desperately hoping someone has the time to help me out!

I've been writing a game using the blank new game template (not the one with all the pre-imported graphics) and have noticed when I'm playing that the top bar that used to come up on the old templates which showed inventory buttons, etc. isn't there. I know that this is because that interface doesn't actually come as part of the game as I thought it did and so I have to write it myself!

This would be fine in as much as I can make the graphics no problem, but how do I write the global script that tells the game things such as:
- When the GUI should appear (ie: when the curser reaches the top of the page)
- How to turn the images of buttons into functional ones
- How to make the GUI completely functional like the one in the default game template.

If anyone can point me in the right direction for this or even better give me some instructions on scripting it would be greatly appreciated as currently all the work I've put into my game is for nothing as I have no GUI!
Emma North

auriond

Maybe this page will be of help to you :) It was very helpful to me when I was making a custom GUI.

http://www.americangirlscouts.org/agswiki/Other_features_%28manual%29#Editing_the_GUIs

You'll probably be interested in these bits:

QuoteThe "Mouse YPos" option means that the GUI only appears when the mouse vertical position moves above the y-coordinate set with the "Popup-YP" option.
- to make the GUI appear when the cursor gets to the top of the page.

http://www.americangirlscouts.org/agswiki/Other_features_%28manual%29#GUI_buttons - to make buttons functional.

You might want to refer to the scripting in the default game to see how they make the GUI functional. I just copied and pasted mine from there.

Khris

You can start a new default game, then export the GUI and import it into your own game, this way you'll only have to add the code manually.
To specify what a button does, assign it a scriptname (if it doesn't have one already), then double click the button in the editor or click the ellipses button in the button's event pane (accessible via the thunderbolt icon).
This will add the button's OnClick function to the global script, then simply put in there what the button's supposed to do (e.g. mouse.Mode = eModeInteract;).
You could probably copy and paste the GUI buttons' functions from the default game into your own game, too, but I'm not sure if this will work immediately.

To make the GUI appear when the mouse approaches the top of the screen, set the GUI's visibility to Popup Y (?), then set a y coord like 10 (this is a built-in option).

Not sure what you mean by "How to turn the images of buttons into functional ones" though.

SMF spam blocked by CleanTalk