Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Matti on Sat 24/01/2009 13:11:29

Title: [SOLVED] Character.Walk(x,y) - Variables don't work
Post by: Matti on Sat 24/01/2009 13:11:29
I really don't know what's going on here. I just want a character to go to certain coordinates, represented by variables.

When I write something like this (in the room's rep ex), nothing happens:


gx=100;gy=450;
character[1].Walk(gx,gy);


Strangely enough this doesn't work either:


character[1].Walk(100,450);


When I use a randomizer, it works fine (without variables):


a=Random(10);
if (a==5) {character[1].Walk(100,450);


What the heck is going on here? Any idea what could cause a problem?


And another thing: First I used "r" instead of"a" as the variable in this post. The result was (in the preview) that the random line wasn't shown at all and the "r" in the next line was written "are". I needed to put the "r"s here in quotation marks..
Title: Re: Character.Walk(x,y) - Variables don't work
Post by: Khris on Sat 24/01/2009 13:28:19
If you put a .Walk line in rep_ex it gets called 40 times per second, the character never has the chance to leave the spot they're on.
Title: Re: Character.Walk(x,y) - Variables don't work
Post by: Matti on Sat 24/01/2009 13:40:56
Haha, stupid me. Thanks, that - of course - was the problem.