HP system/ Save system

This forum is meant for posting anything related to Adventure Maker that doesn't fit in the other forums.Please post technical questions in the Technical Support Forum!

Moderators: time-killer-games, Vengeance66, Candle, reneuend, GM-Support

HP system/ Save system

Postby henhooligan » Mon Feb 11, 2008 5:08 am

I'd like to know how to either a Health Point system where after X seconds in a frame, you lose a health point, and if you lost enough health points you'd be taken to the "game over" frame...

Or I'd like a way to disable saves on certain frames, and allow saves again on different frames. Either HP or Save is okay with me, preferably HP... I need this because the game's going to be too easy without this...

Can anyone help me on this?
henhooligan
New Member
 
Posts: 1
Joined: Mon Feb 11, 2008 4:55 am

Postby Candle » Mon Feb 11, 2008 6:19 am

For number 1 you should be able to make this work for that.
16. How to create a "score" system?

First you need to create a new integer variable that will hold the score. To do so, click the "Variables..." button that is under the VBScript text field in the "Hotspot Properties" window and click "New Integer Variable...". Let's call the new variable MYSCORE.

To increase the value of the score by 1, simply use the following code:
MYSCORE = MYSCORE + 1

If you want to tell the player what his or her score is, use the following code:
msgbox MYSCORE

If you want to use a sentence such as "Your score is:", then use the following code:
msgbox "Your score is: " + cstr(MYSCORE)

The reason why the cstr function is used is that you can only add two variables of the same type. Since "Your score is:" is a string and MYSCORE is an integer, you need to convert it to string (with the cstr function) before you can use the "+" operation.

If you want to say "You have not completed the game" if the score is lower than, say, 1000 points, use the following code:
if MYSCORE < 1000 then msgbox "You have not completed the game."


For the save games part you can do this .

20. How to completely replace the drop-down menu that appears when pressing Esc?

You can replace the default drop-down menu with a custom STATIC menu. To do so, follow these steps:

1. Go to the "Options" tab of the "Project Properties" window and check the option "Remove the drop-down menu at the top of the screen".
2. Create a new frame called for example "MyToolbar".
3. Double-click to edit the frame. Create the buttons that allow to show the "Load Game" and "Save Game" windows, as well as the button to quit the game. To do so, you can use the "PopupLoadGame" and "PopupSaveGame" commands, as explained on the "Language Reference" page. Note that if you have created a custom startup menu (refer to the "Creating a custom startup menu" page for details), you may prefer to just create a single button on the "MyToolbar" frame, which leads to the custom startup menu frame.
4. Close the "MyToolbar" frame and click "Runtime Frames Merging".
5. Select all the frames from the list on the left (use the Shift or Ctrl keys), then select the "MyToolbar" frame from the drop-down menu on the right, and then click the "Assign" button. Then click OK to close the window.

All the frames of your game will contain the hotspots that you have created inside the "MyToolbar" frame.

You can find this and more in the help file that came with AM or on the web site here.
Welcome to the forums.
Please don't PM me questions, ask here in the forums!
``````````````
Between grand theft and a legal fee, there only stands a law degree.
User avatar
Candle
Administrator
 
Posts: 3077
Joined: Sat Feb 07, 2004 2:21 am
Location: Rudy's Bar

Postby Chromegloss55 » Tue Feb 12, 2008 7:55 pm

Question 1:

There is a way of creating that system, it's very easy. In VB Global Procedures type this;

Code: Select all
Sub HealthTake

Health = Health - 1

If Health <= 0 then Action.GoToFrame"Game Over"

End Sub


Obviously replace 'Game Over' with the name of the Game Over frame.

In the VBScript tab of Frame Properties type:

Code: Select all
Action.CreateTimedEvent X, "HealthTake", True


Where X is the number of seconds between each health point being taken away.


Question 2:

On any frames where you want to disable the SaveMenu or LoadMenu tabs simply type this into Frame Properties

Code: Select all
SaveMenuObject.Enabled = False
LoadMenuObject.Enabled = False


To enable them again, replace 'False' with 'True'.

Hope that helps...
_________________
definition of recession
Chromegloss55
Forum Master
 
Posts: 630
Joined: Sat Nov 03, 2007 2:49 pm
Location: God Knows!


Return to Adventure Maker General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests

cron