Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: shaungaryevans on Tue 24/03/2009 22:34:54

Title: Help with if statements
Post by: shaungaryevans on Tue 24/03/2009 22:34:54
hi,

I put this if statement in:

if (cEgo.walk(150.345)){
  object[10].Visible = true;
  object[11].Visible = true;
  object[12].Visible = true;
  object[15].Visible = true;
}
else{
  object[10].Visible = false;
  object[11].Visible = false;
  object[12].Visible = false;
  object[15].Visible = false;
}

But it don't work. Can anybody help me finding the problem please?
Title: Re: Help with if statements
Post by: GarageGothic on Tue 24/03/2009 22:49:58
What exactly are you trying to do? Are you checking if the character is standing at a specific coordinate? If so, you should try looking up "Regions events" in the manual.

Edit: As for the problems in your code 1) cEgo.Walk(150.345) is an invalid format, you need a comma between the coordinate sets not a period, 2) Even more important, your if statement checks for cEgo.Walk returning true - as far as I know the Walk function doesn't return any value.
Title: Re: Help with if statements
Post by: shaungaryevans on Wed 25/03/2009 21:50:30
Thank you very much, the regions work. Thanks :)
Title: Re: Help with if statements
Post by: Cpt Ezz on Mon 30/03/2009 06:34:43
i know it has been the question has been answered
but a more easy and simple way of doing that is to use a big hotspot on the ground and use the character walk on function.
Title: Re: Help with if statements
Post by: Khris on Mon 30/03/2009 13:38:20
No, regions are a better way to do it.