Problem 1:
I am simply trying to make a little shadow icon follow around underneath it's owner. Normally I would go with "Attach it to the icon!", but that doesn't look very well when you incorporate jumping. I tried some simple tricks but nothing seems to come out quite right. Right now I'm getting desperate, and have gone so far as to do this:
shadow
proc
at_owner()
if(x != owner.x) return 0
if(y != owner.y) return 0
if(z != owner.z) return 0
if(step_x != owner.step_x) return 0
if(step_y != owner.step_y) return 0
return 1
action(t)
#ifdef LIBRARY_DEBUG
if(trace) trace.event("[world.time]: start action:")
#endif
if(path || destination)
follow_path()
else
owner << at_owner()
if(!src.at_owner())
src.move_to(owner) // Note: This doesn't even work. The shadow doesn't move.
else
if(moved)
moved = 0
else
slow_down()
#ifdef LIBRARY_DEBUG
if(trace) trace.event("[world.time]: end action:")
#endif
I could really use some guidance here on how to keep things smooth without needlessly overriding the mob's movement. I'd much rather have the shadow take care of itself than have to be constantly accounting for it throughout my code.
Problem 2:
There is a strange collision problem with your movement that irks me. I mentioned this before on the forums. I have a large, dense object (In this case, a building), specifically:
The body of the building has a pwidth of 223 and a pheight of 105. It has a pdepth of 96.
The roof of the building has a pwidth of 239, a pheight of 120, and a pdepth of 150.
When I try to run into the sides, I can go partway into the building before being automatically shoved out. This isn't a high priority in the gameplay department, but in aesthetics it is quite high on the list.
Problem 3:
This ties into the last problem, referring to the building. I'm looking for the easiest way to make the building "slippery", so the mob won't land on the face of the building, and will keep falling instead. I'm sure this is easy, but after the previous two problems my brain is a bit fried.
Lastly, Problem 4:
I'm having some pdepth issues. I changed all of my custom elevation things over to pdepth, and I just want to make it do some simple tasks:
- If there is something in your next step that has a higher pdepth than you, you can't step! (Somewhat works - refer to problem 2. Movement shouldn't happen, but instead it happens and then the system realizes that it shouldn't have and pushes them back out)
- If you are on an object, you should obviously inherit their pdepth. (Works)
- If your pdepth is greater than or equal to the pdepth of the object beneath you, you can still move. (Doesn't work. I can jump onto the roof of my building (150 pdepth), but I can't move anymore without jumping again.)
- If you fall, a proc should be called when you land so you can easily incorporate things like fall damage. (I have not seen this, if this exists already or is easily implemented, please tell me where.)
Thank you for your time, and thank you for reading to this.
Also, you should probably use set_pos() instead of move_to(). The move_to() proc has some crazy pathfinding stuff involved that you definitely don't need. If you would use the mob to update the shadow, you'd do this:
But if you want to keep it on the shadow, you'll have to do the other thing.
Problem 2: I don't see why what's happening to you. What you say makes me think the collision is squishy, but it's not meant to be squishy. Things have solid edges and collide precisely. Do you see this problem in the top-down-demo? (note to F_a: top-down is birds-eye-view, that demo is side-view)
Problem 3: Again, this doesn't happen to me. This library's pixel movement and collision has smooth edges in all axes. That is, you can slide along all sides of a box in all directions. There's nothing catching or causing you to stick.
Problem 4:
a. If there's something with pdepth>0 in your next step, normally you'll bump into it. If you're asking to have something like stair physics where you'll automatically hop up to step on it instead of bump into it, you can probably do that like this:
b. I don't see why you'd want to do this, but if it works for you, that's good.
c. Normally, you can walk on top of things like this. It actually shouldn't be much different from walking on turfs, which act as an actual floor. By default, can_bump() returns 1 for turfs because you'd fall through the ground otherwise.
d. I'm not sure, but is bump() called? If so, I'd expect d=VERTICAL and a=whatever you landed on (floor, top of a building, etc)
Basically, there's some things that are happening for you that aren't standard in the Pixel Movement library. If you haven't already, you should look at the top-down-demo that comes with the library. If you're not sure about what collision's supposed to look like, all of the demos will show you that what you're seeing shouldn't be happening.