[SOLVED] Character.Walk(x,y) - Variables don't work

Started by Matti, Sat 24/01/2009 13:11:29

Previous topic - Next topic

Matti

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:

Code: ags

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


Strangely enough this doesn't work either:

Code: ags

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


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

Code: ags

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..

Khris

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.

Matti

Haha, stupid me. Thanks, that - of course - was the problem.

SMF spam blocked by CleanTalk