Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: aventurero on Sun 03/01/2010 23:19:39

Title: Need help with some basic coding
Post by: aventurero on Sun 03/01/2010 23:19:39
Hello, I'm making some sort of graphic adventure/rpg and my character's got properties like "strength" and "intelligence". What I need to do is that raising one of those abilities, also raises another. For example, if the player gains 1 strenght, he also gains 2 HP. Thanks for your time!  :)

P.d: sorry for my bad english, I'm argentinian.
Title: Re: Need help with some basic coding
Post by: Crimson Wizard on Mon 04/01/2010 00:09:12
Erm... so what do you find a problem exactly? I mean, what cannot you do?


EDIT: Hmm, well, I was trying to think what can cause trouble for you. Maybe you can consider adding a function like


function IncreaseStrength (int ByValue)
{
  strength += ByValue;
  maxhitpoints += ByValue * 2;
}