Movement troubles...

I was just working on making a simple maze in coldstone. I made two 16x16 graphic tiles, one for the walls and the other for the background. Then I made a map, with 16x16 movement tiles and 16x16 graphic tiles. Next I drew my maze and set the access accordingly. Finally I made a character sprite, made a collision sphere of 16 px around him, and set the movement to Directional-4.

So, when I try playing it my character still moves diagonally (and when a diagonal direction is tapped the character will run around for a while and then stop...not one tile at a time), and worse he appears to walk through the walls.

Anybody know what I'm doing wrong?

------------------
(url="http://"http://jankostar.net/sanko")my Page of Garbage(/url)

Quote

Originally posted by sanko:
~snip~

Glenn or someone else may know first hand, but I seem to recall that you can't force a character into a 4-direction movement mode. Ie, you can have graphics for only the cardinal directions, but the character itself still is able to move diagonally. NPCs on the other hand can be forced into a 4-directional movement grid.

I think the "solution" is to make a checkerboard layout with access tiles, so that the player can't move diagonally. However this also means that the character has to move 2 squares before they can change their directional axis...

------------------
(url="http://"http://stark.evula.net/pogwalkthrough.htm")PoG Walkthrough and Compendium(/url) | (url="http://"http://stark.evula.net/plugins/dev_tools.htm")PoG Dev Tools(/url) | (url="http://"http://stark.evula.net/plugins/spells_expander.htm")Spells Expander(/url)
(url="http://"http://stark.evula.net")Stark.evula.net(/url) now on (url="http://"http://www.evula.net")EVula.net(/url)

It is quite possible, in my limited experience, to have both players and NPCs restricted to 4-directional movement. I'm not sure how well it works in combat (haven't got that far in the implementation of my game) but it works just fine for walking around the map.

For some reason, sanko, your problems sound a lot like what I was seeing during one of the betas. This is probably a silly question, but you are running Coldstone 1.0.1, right?

As I said, it's working without a hitch here, so I'm just going to have to throw ideas out there randomly:

-Open the animation file back up and make sure it is indeed Directional-4 and has the appropriate frame flags set for looping. Make sure this is the animation selected for the player in the Game Options.

-Does anything happen if you change the player's collision sphere? What if you use a map with larger movement tiles?

-Does the animation work correctly if you stick it on an NPC instead? Or is it still non-functional?

------------------
I don't know what I'm talking about.
(url="http://"http://homepage.mac.com/glennfield/ColdstoneBugs.html")Coldstone 1.0.1 Bug List(/url) - last update 10/10/2002

Thanks to your suggestions I've fixed a few problems. 4 directional movement works. (I must have forgotten to save my changes) 🙂 The walking through walls problem is not completely fixed but it's a lot better than it was. I did this by adjusting the collision sphere and changing the x,y coordinates of the sprite within the animation file.

Two problems remain.

First - Sometimes tapping down will move the character one tile down; other times when you tap down the character will travel halfway across the map. Also it is nearly impossible to move through gaps in my maze - the sprite will get stuck and just bounce around or it will shoot right past the gap. I've double checked the access and it's all set right. I wish I could explain a bit better. Again, the map is made up of 16x16 tiles (both movement and graphic) and no gaps or passages are any wider than one movement tile. I assume that if I made the gaps bigger it would work better - but I would prefer to keep them small. 🙂

My second problem is that whenever my game switches to the maze the game appears frozen until I hit the escape key. By frozen I mean that I can't move around, no NPCs move, and no Keydown events work. Music however continues playing, and once I hit esc, the game starts moving like normal.

I don't know if it will help or not, but here is how the event that takes you to the Maze:

1. Set's Map Position
2. Teleports to the new map
3. Changes Player Map Icon

No more no less.

I appreciate all the help so far - although it's a bit humbling when things end up being stupid mistakes on my part. 😄 Anyway, if anybody has some ideas as to what is happening here I'd love to hear them.

I am using 1.0.1, btw...

------------------
(url="http://"http://jankostar.net/sanko")my Page of Garbage(/url)

Quote

Originally posted by sanko:
Also it is nearly impossible to move through gaps in my maze - the sprite will get stuck and just bounce around or it will shoot right past the gap.

I'll bet that you have the player moving at a highish speed which is not a factor of your tile size, as I had similar problems when working with small movement grids. The problem is that character movement in Coldstone is pixel-based rather than tile-based - it moves the character by n pixels with each step, then figures out which movement tile that corresponds to, rather than the reverse. Thus, if your player has a large speed, he may move from being just barely on one side of an opening to just barely on the other in a single step, without ever "standing" on the tile in between. This can be resolved by keeping the player's speed low relative to the tile size, or, if higher speed is needed, using a speed which is a factor of the tile size (such as 8 or 16 in your case).

Quote

My second problem is that whenever my game switches to the maze the game appears frozen until I hit the escape key.

Does this happen if you use a different map?

Quote

I don't know if it will help or not, but here is how the event that takes you to the Maze

From where and in what manner is this event being called?

------------------
I don't know what I'm talking about.
(url="http://"http://homepage.mac.com/glennfield/ColdstoneBugs.html")Coldstone 1.0.1 Bug List(/url) - last update 10/10/2002

Quote

Originally posted by Glenn:
This can be resolved by keeping the player's speed low relative to the tile size, or, if higher speed is needed, using a speed which is a factor of the tile size (such as 8 or 16 in your case).

Thanks for the explanation. I set the speed to a factor of 16 and it fixed the movement problem.

Quote

Originally posted by Glenn:
**From where and in what manner is this event being called?

**

The event is linked to the Use action of an item.

Quote

Originally posted by Glenn:
**Does this happen if you use a different map?
**

Yes, but only with maps similar to the Maze map. The maze map is just as I said 16x16 tiles - with one large (800x600) stamp over the top (to create the appearance of a different interface when playing the Maze game). The other maps in my game work flawlessly.

------------------
(url="http://"http://jankostar.net/sanko")my Page of Garbage(/url)

Quote

Originally posted by sanko:
The event is linked to the Use action of an item.

Sanko,

This is your problem. The inventory screen is still "open" and needs to be closed with the escape key. But since you teleported you can no longer see the screen.

I think your best fix to this is to make the Use event into a spell, and then set your item to cast a spell with the teleport spell event listed as its calling spell. Set the uses field to -1 so it will be infinitely useable.

The spell method will close the inventory window for you so you won't have the game freeze.

You might check to see if there is an engine call to close the inventory window. I don't recall off hand if there is. If it is there though then try placing this into your event and that might take care of this also.

------------------
(url="http://"http://stark.evula.net/pogwalkthrough.htm")PoG Walkthrough and Compendium(/url) | (url="http://"http://stark.evula.net/plugins/dev_tools.htm")PoG Dev Tools(/url) | (url="http://"http://stark.evula.net/plugins/spells_expander.htm")Spells Expander(/url)
(url="http://"http://stark.evula.net")Stark.evula.net(/url) now on (url="http://"http://www.evula.net")EVula.net(/url)

Thanks! All problems solved.

------------------
(url="http://"http://jankostar.net/sanko")my Page of Garbage(/url)