ID:1824886
 
(See the best response by Ter13.)
Code:
obj
verb
PickUp()
set category = null
set src in oview(0)
src.Move(usr)
Drop()
set category = null
set src in usr
if(src.suffix == "Equipped")
usr << "\red Unequip the [src] first!"
else
src.Move(usr.loc)
var/sellvalue
proc/usingheal(var/obj/items/J,amount)
var/mob/player/M
M = usr
if (amount > (M.maxHP-M.HP))
amount = (M.maxHP-M.HP)
M.HP += amount
usr << "You used a [J]; <b>[amount] HP restored"
Del(src)
items
potions
icon = 'potions.dmi'
healingpot
name = "Healing Salve"
icon_state = "red"
sellvalue = 25
desc = "<b>Healing Salve</b>: Restores up to 50 HP"
verb/Use()
set category = null
set src in usr
usingheal(src,50)


Problem description:

When I have this in the code, all is well. However, when obj/items/potions/healingpot is placed on the map near the spawn, my mob (as well as local NPC mobs that move randomly) lose the movement state and rather than a smooth transition over the 32 pixel jump, the mobs basically teleport from the initial spot to the next tile over.

Very odd, and I have no idea how to go about fixing this.

Any insight would be greatly appreciated!
This wouldn't be caused by your healing potion. What's happening is something is kicking your world into pixel movement mode. Something has changed the bounds, step_size, or step_x/y variable of an object somewhere in your world and it's now thinking the game is in pixel movement mode.
In response to Ter13
Ter13 wrote:
This wouldn't be caused by your healing potion. What's happening is something is kicking your world into pixel movement mode. Something has changed the bounds, step_size, or step_x/y variable of an object somewhere in your world and it's now thinking the game is in pixel movement mode.

That's what I was thinking, but when I delete the potion the movement returns to normal. I repeated the placement/deletion 3-4 times to confirm.
Did you place the object on the map with step_x/step_y changed? Did you nudge the object on the map at all?
Nope, each placement was just the typical click to place. No nudges or step_x/step_y changes in the code. This is why I'm so confused!

If I run the game without the potion it's fine, but I simply place the potion on the ground and the pixel movement begins.
Would you mind zipping up your source and PMing me a copy so I can take a look? I'm pretty sure it'll be faster for me to diagnose your issue than to go back and forth.
Yeah, of course. Just an extra note, I had an NPC give me a knife to see if it would have the same effect. Not sure what that's about either.

Give me a minute. And don't hate on the sloppiness, it's been years since I've dabbled haha.
Best response
Found it.

Login.dm line 33 and 34.

obj
step_size = 8


You left the step_size of objects at 8. Just remove line 33 and 34 completely, and remove line 10 completely

mob
step_size = 32


^That's line 10. If you don't want to use pixel movement mode, just don't set step size to a value at all. It defaults to your icon size, so there's no need to set it at all if you want to use tiled movement.
Good lord. I knew it had to be something stupid on my part.
I think those were a couple of the lines that were default when I crated the environment.
Thank you very much! I appreciate the help! :)