[SOLVED] Character just won't walk to where he is told!

Started by Tenacious Stu, Tue 04/10/2011 14:06:03

Previous topic - Next topic

Tenacious Stu

In my script I have the usual cCharacter.Walk (x,y,etc), that is supposed to make to character stand in front of an object when the player clicks on it then an animation will start. However unless the player is right in front of the object it apears that the character will walk up to the correct y coordinate then completley ignore the x and start doing the animation. I have tried all sorts to stop this happening, I even tried putting in waypoints, but it just didn't work. It's like the character refuses to walk where I want him!

The way he has to walk is by walking up and then to the right to get to the object, but he walks up and then doesn't walk right?

Code: ags

cSam.Walk(228, 119, eBlock, eWalkableAreas);//SAM WALKS TO OBJECT
cSam.x=228; //THIS IS TO MAKE SURE HE IS IN FRONT OF OBJECT
cSam.y=119; 
Wait(10);
cSam.LockView(18); //ANIMATION
cSam.Animate(0, 10, eOnce, eBlock, eForwards);


With the code above, he just walks to the y location and then teleports the rest of the way. This has been doing my absolute nut in for ages >:(, I really hope someone can help me.

Thanks in advance for any replies. :)

pcj

I'm assuming you've got the walkable area set up correctly...

Try setting the object's Solid property to false.  If that works you might need to tweak its BlockingWidth or BlockingHeight property (if you want to keep it solid).
Space Quest: Vohaul Strikes Back is now available to download!

Khris

And if you press Ctrl-A you can see the walkable areas minus the rectangles cut out by solid objects/characters.

Tenacious Stu

I cannot thank you guys enough. After changing EVERY object to solid=false, I tried using the Ctrl+A to check the walkable areas and noticed that when the player was in certain parts of the room the walkable pathway was blocked off for some reason causing the player to 'Teleport' when they got there. After reading through the rooms code, I realsied that there was code in there for a mirror effect that I had since decided not to use, but I still had the characters mirror image walking around the room (But it's view wasn't visible, so I couldn't see it). So everytime I was below a certain point in the room, the mirror image (which the game must have thought as being a solid character) was stood in the way meaning my character couldn't reach the walk to point. Phew, thank you guys. Big help.

SMF spam blocked by CleanTalk