Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Icey on Sat 30/10/2010 02:19:52

Title: Multiple scores in game
Post by: Icey on Sat 30/10/2010 02:19:52
Is it possible to have more then one scores because I want to have one that is for a currency system and 1 for main score and one for EXP.
Title: Re: Multiple scores in game
Post by: Matti on Sat 30/10/2010 02:26:23
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=41937.0
Title: Re: Multiple scores in game
Post by: Icey on Sat 30/10/2010 02:53:26
Thanks. 
Title: Re: Multiple scores in game
Post by: monkey0506 on Sat 30/10/2010 02:56:50
If you're storing experience..are you working on an RPG? If so, will other characters have experience? If so, you might consider using a dynamic array instead of just having a slew of individual variables:

int RPG_Experience[];

function game_start() {
  RPG_Experience = new int[Game.CharacterCount];
}

// ..set character's experience..
RPG_Experience[player.ID] += 25;

// ..get character's experience..
lblExp.Text = String.Format("EXP: %d", RPG_Experience[player.ID]);
Title: Re: Multiple scores in game
Post by: Icey on Sat 30/10/2010 13:12:57
Oh, this should work. the game will only have one player to fight with though.
Title: Re: Multiple scores in game
Post by: monkey0506 on Sat 30/10/2010 13:45:36
Well in that case use the score for the score and just create one variable instead of an array.