Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: barefoot on Mon 31/01/2011 17:27:21

Title: SOLVED: Display total points and act accordinaly
Post by: barefoot on Mon 31/01/2011 17:27:21
Hi

Main Player collects points ($) by obtaining cash and goods.. so far so good...

I have been looking for the answer to this:

I need another character to check the main player's total points and display text and do things according to how much the main player has.

eg

if Main Player has say over 15000 points then display and do this..

else do this..

So its really just knowing how to script it in.

Hope ive explained ok. cheers for any help you can give

barefoot









Title: Re: Display total points and act accordinaly
Post by: barefoot on Mon 31/01/2011 17:41:54
This seems to do the trick (unless you know better):


(Have used fake total for this exercise)


function room_AfterFadeIn()
{
  Display("You arrive at Lazlo's dirty, dingy room!");
  cfence.Say("Hiya Fanito, long time no see!");
  cPaul.Say("Hi Lazlo. How's business?");
  cfence.Say("So so. What you got?");
  Display("He looks at what you've got");
  Total = (Total + 10000);
   Display("Total: $%d", Total);
   
{
   if (Total>12000)
   
Display("well done Fanito");
   
   
   else  Display("Bad luck Fanito");
 {

}  
}
}


barefoot