ID:139043
 
Code:


Problem description:


Well I would copy and paste the code, but it's pretty much Just Forum_accounts pixel movement code. I was reading this: http://www.byond.com/members/ Forumaccount?command=view_post&post=113098 on how to implement them in a project, so I tried it, but when I do what it says it works and everything, but my base icon that has run and jump states etc they do not work, so when I walk around my icon is in a standing state even though it's moving. And it also lets me walk on dense objects aswell. I'm also not sure If I posted this in the correct place aswell.
You should post in the forum for Forum_account's libraries.

Movement states aren't going to work as they did with BYOND's normal movement when you're using Pixel Movement.

By default, set_state() changes your icon_state to "standing" while standing still, "moving" while moving, and "jumping" while jumping. If you set a mob's base_state, the icon_state will be set to "[base_state]-moving", etc.

I assume the dense objects you are walking through are mobs. For that, you need to override can_bump() for your player.
// By default, mobs don't bump into other mobs. 
// This will make it so mobs bump into other mobs.
mob/can_bump(mob/m) return ((density && m.density && istype(m)) || ..())
In response to Kaiochao
My turf is just a cliff, and I'm a novice programmer so I do not understand much about this pixel movement thing. I'm only using it for the jumping. I just want it to be able to jump from cliff to cliff or building to ground, etc. And the gravity system aswell. But I still want to be able to use my icon states, So I guess I can't use this resource and will have to try to revise my jump code, which isn't working properly right now(only moves the mobs icon not the client and I can't move while it jumps.

My jump code:
mob/proc/Jump(src) 
flick("Jump",src)
usr.Jump = 1

pixel_y+= 15
sleep(1)
pixel_y+= 20
sleep(1)
pixel_y+= 10
sleep(1)
pixel_y-= 15
sleep(1)
pixel_y-= 20
sleep(1)
pixel_y-= 10
if(usr.Jump==1)
sleep(30)
else
usr.Jump = 0


I tried to make it jump smoothly which it does, but the client view and mob aren't in sync, and I can't jump to cliff to cliff because when you jump you can't walk or run while doing it, so you stop jump then run, but I don't want that to happen. Also the timer doesnt work either, I want it so you can't spam the move. And yeah I kinda jsut found Forum Accounts Forum thing a few minutes before you told me of it :P



So you're saying if I use this pixel movement thing, It will not show the icon states of jumping or walking/running?

This is my cliff code, it's simple.
turf
Cliff
density = 1
icon ='turfs.dmi'
icon_state = "Cliff"


Anyways I set the density to One and the mob still just walks over it, but in his demo on implementing it, the mob Doesn't walk over the bricks that are set to one density. hmm...
In response to Chaorace
Forum_account's Pixel Movement has built-in gravity and jumping. You don't need to add your own jumping to Pixel Movement's jumping.

What I said was, if you're using one character per icon file, you need to set your moving state to "moving", your jumping state to "jumping", and your standing still state to either "standing" or just blank. By default, the library automatically sets your state appropriately.

Maybe your mob isn't dense?
In response to Kaiochao
Kaiochao wrote:
Forum_account's Pixel Movement has built-in gravity and jumping. You don't need to add your own jumping to Pixel Movement's jumping.

What I said was, if you're using one character per icon file, you need to set your moving state to "moving", your jumping state to "jumping", and your standing still state to either "standing" or just blank. By default, the library automatically sets your state appropriately.

Maybe your mob isn't dense?

Thanks it works now, but now I have one more problem. When I run it looks like the feet are moving at like the super her flash speed type thing. Could it be the camera view? Also one more question my friend, let's I add an attack verb with kick and punch seperate, cant pixel movement do those too and have it be random whether you kick or punch? I also figured out the problem with the Cliff density, It's a 200 x 200 icon and I didn't split it up, so wen I put it in the map, only the little 32 x 32 square where I clicked in order to place the Cliff, gets the density, which is odd?
In response to Chaorace
Because Pixel Movement decreases world.tick_lag to 0.25 by default, all animations will also be sped up x4 (1/world.tick_lag = 1/0.25 = 4). In the icon editor, you're going to have to multiply all the delays by 4.

For the cliff, you could change its pwidth and pheight to 200 each. I'm not sure if the collision would work properly at this size, though.

Pixel Movement isn't needed to flick() a punch or kick. Probability isn't a feature of Pixel Movement either.
flick(pick("punch","kick"), src)
In response to Kaiochao
Kaiochao wrote:
Because Pixel Movement decreases world.tick_lag to 0.25 by default, all animations will also be sped up x4 (1/world.tick_lag = 1/0.25 = 4). In the icon editor, you're going to have to multiply all the delays by 4.

For the cliff, you could change its pwidth and pheight to 200 each. I'm not sure if the collision would work properly at this size, though.

Pixel Movement isn't needed to flick() a punch or kick. Probability isn't a feature of Pixel Movement either.
> flick(pick("punch","kick"), src)

Yeah I use flick proc now for those verbs, but I wasn't sure if they're able to use in pixel movement.

And for the cliff so I should do something like this?

</dm. Cliff
density = 1
icon ='Cliff.dmi'
pwidth = 200
pheight = 200


I tested it and now when it doesn't densify(is this a word?? the whole turf of the cliff, it's still the same, but now when I run into that one dense part of it running south it'll somehow push be back to about 4 or 5 squares way