[Solved]Character/Cursor Movement Bug

Started by thevioletfalcon, Wed 13/05/2020 22:31:18

Previous topic - Next topic

thevioletfalcon

After importing a custom cursor for my recently started horror game, Soul of Grief, I test-ran the game to see if the cursor worked properly. For some reason, I couldn't move my character downwards. I checked the walk-able areas, and I couldn't find any issue. Also, my cursor won't move to left edge of the screen. Does anyone know a solution?

Khris

Check the cursor's hotspot. Open it in the editor and you will see a small cross on the image. You can either click to move it, or enter the coordinates manually in the properties. Chances are the hotspot is pretty far from the part of the cursor image you think you're clicking with.

thevioletfalcon

I checked the hotspot. No problem there.

Crimson Wizard

There's not enough information to be sure about what the problem is. How does your custom cursor look like?

Quote from: thevioletfalcon on Wed 13/05/2020 22:31:18Also, my cursor won't move to left edge of the screen.

Are you playing in windowed mode? I can only think about mouse cursor crossing window border and AGS loosing focus before game cursor gets to edge (this happens sometimes).

thevioletfalcon

It's crosshair, but with an open space in the center, so it just looks like 4 perpendicular lines.(I couldn't figure out how to insert the image here.)

Khris

When you say the character couldn't move downwards, did you mean you click below and nothing happens? Or do they move elsewhere? At all?
Did you check the walkable areas in-game using Ctrl+A?

To show an image, upload it on imgur.com. When it's done, right click the image in the browser and click "copy image location".
Now click the image button (1st icon in 2nd row) and press Ctrl+V to paste the url in between the bbCode tags that appeared.


thevioletfalcon

I can move my cursor down, but I don't move down when I click there. I can move right and left though. I did check the walkable areas in-game. No problems there.

Khris

#7
Right, this is kind of crazy, but here's what's happening: when you click the image to set the hotspot, the coordinates that are put in the cursor settings are actually exactly half of the supposed coordinates.
I assume that the plan was to show the image at 2x zoom to make it easier to place the hotspot via click, however this was implemented in the hotspot calculation but not in the "editor draws cursor image" part.

Do this: first, crop that huge image. You can do that right in the sprite manager, simply right-click the image and select "Crop sprite edges". (you can skip this step though if you want)

Next, go back to editing the cursor, click the center of the cross, then duplicate the values for HotspotX and HotspotY. It should now work fine in-game.
This is perfectly future-proof btw, the only thing that's broken is the editor calculation.

Nobody has noticed this yet because 99% of hotspots are very close to or in the top left corner and I also guess it's a recent bug.

thevioletfalcon

Thank you. The problem is solved now.

Crimson Wizard

Quote from: Khris on Fri 15/05/2020 00:38:56
Right, this is kind of crazy, but here's what's happening: when you click the image to set the hotspot, the coordinates that are put in the cursor settings are actually exactly half of the supposed coordinates.
I assume that the plan was to show the image at 2x zoom to make it easier to place the hotspot via click, however this was implemented in the hotspot calculation but not in the "editor draws cursor image" part.

Nobody has noticed this yet because 99% of hotspots are very close to or in the top left corner and I also guess it's a recent bug.

Khris, could you open a bug ticket in our repository about this? There's another patch planned for 3.5.0 already, if there's actually a bug we could fix it as a part of it.
(https://github.com/adventuregamestudio/ags/issues)

Khris


SMF spam blocked by CleanTalk