Score as money

Started by AndersM, Wed 13/07/2005 21:19:25

Previous topic - Next topic

AndersM

Many years ago I asked about some way of using score as money. i got an working answer then, but i lost it.

I'ts easy to add / remove score if the player buys / earns money, but the thing is how to solve the problem if the score is to low.

like if he tries to buy something that cost $ 100 and only have the score 50. there would be some kind of

'if score < 100 display 'you cant afford that'

any suggestions?

Rui 'Trovatore' Pires

...there is. ain'0t there? game.score? Or something to that effect?
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Ubel

Yes, for example (this script is for 2.6):

if (game.score < 100) {
Ã,  Display ("You don't have enough money.");
}
else {
Ã,  Display ("You bought it.");
Ã,  AddInventory (1);
}

That could work.

Pod

you forgot to remove the money from the game score :)
This way, he'd get things for free!

Bad Voo-doo man

Couldn't you just use a global int, and display it somewhere on the screen or something to that effect?
<img>Image Comming Soon!</img>
The Fall of Reach (A Halo fan game)
STORY: 100%
GRAPHICS: 2%
CODE: .56%

Gilbert

Yes, but game.score is just one lazy super easy method if you don't need that to serve other purposes.

Nethros

#6
Pablo, You must be lucky never paying for something you buy! ;) I'll change your script so It is how most the people trades stuff. :D

Code: ags
if (game.score < 100) {
Ã,  Display ("You don't have enough money.");
}
else {
Ã,  Display ("You bought it.");
Ã,  AddInventory (1);
Ã,  [B]GiveScore(-100);[/B]
}


This does something like this:

This is if he DIDN'T have enough money.

Trader: Hello!
Girlbrush Peepwood: Hello!
Trader: Wanna buy a car for 100$?
*Girlbrush doesn't have that much.*
Girlbrush Peepwood: I don't have that much, sorry.

Now if he HAD 100$

Trader: Hello!
Girlbrush Peepwood: Hello!
Trader: Wanna buy a car for 100$?
*Girlbrush has that much.*
Girlbrush Peepwood: Sure thing, here's the dough!
*Guybrush gives the Trader 100$ and recieves the car in his inventory. (Really, These stuff is annoying me. HOW THE HELL CAN PEOPLE CARRY AROUND BIG STUFF IN THEIR POCKETS? I know my game characters does it too, but It's just weird!)*

I added GiveScore(-100);. If you use the minus it will be negative and you will LOSE score instead of GETTING score. I had a posted a thread like this, asking about exactly same thing.

PS: In the script, there is nothing that has to do with Girlbrush ;)

Hope this helps. And most thanks to Pablo, I wouldn't know the script if he didn't post it ;)

Ubel

I just thought it would be much nicer if you got everything for free... ::)

Okay okay, I forgot it. Thanks for correcting me.

Nethros

No problem ;) And you're right, I'm so poor I can't even buy World of Warcraft.  :(


SMF spam blocked by CleanTalk