Author Topic: Kill ship = fill up bank account  (Read 3959 times)

0 Members and 1 Guest are viewing this topic.

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Kill ship = fill up bank account
Nope. You can definitely do that. I'm just saying that if you have a player who starts with a score of 2300 say, what you would do is this right at the start of mission 1

when
-true
-modify-variable
--PlayerOriginalScore[0]
--get-player-score
---Alpha 1

So the variable would be set to 2300. Then whenever you want to know how much money the player has in the bank you simply do this.

modify-variable
- PlayerCurrentMoney[0]
- -
-- get-player-score
--- Alpha 1
-- PlayerOriginalScore[0]

Basically what you are doing is subtracting the score the player had when the campaign started (2300 in this example) from whatever his score is now. That way you only have the score he earned during your campaign.

Now if the player spends money (say 300) you can simply increase PlayerOriginalScore by 300 to 2600 and whenever you calculate what PlayerCurrentMoney is, it will be 300 less.


There are other ways of working out how you want money to work in your campaign (depending on how complex you want to make things) so if you need help, just tell us what you want to do and we'll be more than happy to help.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]