Status bars

Jakefett98
Hi, I was given a game written in basic, which I have everything but the code to. It was given to me by a man I know, who wrote it back in the '70s. I am reproducing it, and since it is text based, Quest seemed like the best bet. Now, I have a question.

Status bars/messages
I have two statuses that I need displayed... but I don't know how to do it. Oxygen & lamp power. How would I have these things timed to display a message? Then if they run down you die.

I might have some more questions, so bear with me, I'm new to the program.

Anonynn
I don't know if I'm going to help you correctly but here's how you display things if I remember correctly.

Go to the Player.Object,
Click on the Attributes Tab,
Look to "Status Attributes"
Add
Key: oxygen
Value: Oxygen: !

Key: lamp_power
Value: Lamp: ! (or Lamp Power: !) Whatever you want the player to see.

Next, on the same tab,
Look at "Attributes"
Add
oxygen (make it an integer: 0)

Add
lamp_power (make it an integer: 0)

They should display now. Then you can set up variables like when player enters so and so room, or whatever...

Set variable:player.oxygen = player.oxygen + 100
Set variable:player.lamp_power = player.lamp_power + 100

If you want them to subtract, there are numerous ways of doing it.

You could have each room have a script that does this...

If expression: not player.oxygen = 0
then
Set variable:player.oxygen = player.oxygen - 1
etc

OR

You can set up a "Turn Script"
Game (tree of stuff)
Right Click
Add
Turn-Script
Name: oxygen_and_lamp_power
Click the "Enabled when game begins" box
Then set up the script to - 1 from both per turn.
But make sure you set up that if it isn't 0 then subtract (or it'll start going into negative values)

After that in the same Turn Script...you can do something like...
if (player.oxygen < 0) {
player.health = 0
Msg ("")
Finish Game
}
if (player.lamp_power < 0) {
player.health = 0
Msg ("")
Finish Game
}

Or something like that ^_^

Hope I helped!

HegemonKhan
if you want~mean actual bar depictions:

viewtopic.php?f=18&t=5770

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums