ID:155037
 
I was wondering is it possible to make certain objs have pixel movement like if i want a bullet to move 15 pixels a step is it possible?

example
obj 
fireball
icon='fire.dmi'
step_size=15


or w/e it is thats used for the pixel movement or would i have to go with a overall kind of thing if so can someone gimme a example how its done?
That's exactly it.
In response to Kaiochao
so it would walk base don step size? like this?
obj
fireball
icon='fireballdmi'
step_size=15

mob
verb
shoot()
var/obj/fireball/F=new
F.loc=usr.loc
walk(F,usr.dir,0)

and the fireball will literally walk 15 pixels?
In response to Mastergamerx
Well yes, and no.

Only because you defined a new pixel movement speed in the "walk" arguments.

Instead of
walk(F,dir,0)


You would simply use
walk(F,dir,F.step_size)


However you can also not even have "<t>F.step_size</t>, since by default it will use the default step_size of the argument that is walking.
In response to Speedro
ok so one problem occurs if i set it like dat its the lag of the blast but aside form that when i give the object the step size and fire the blast the player himself moves at that step rate when the player doesnt even have that as a set thing
In response to Speedro
Speedro wrote:
Well yes, and no.

Only because you defined a new pixel movement speed in the "walk" arguments.

Instead of
walk(F,dir,0)

You would simply use
walk(F,dir,F.step_size)

However you can also not even have "<t>F.step_size</t>, since by default it will use the default step_size of the argument that is walking.

0 or nothing at all still uses the reference's step_size. Either way though, the 0 in his walk() proc isn't for the step_size. It's for the lag(or delay between movements) argument.

walk(Ref,Dir,Lag=0,Speed=0)
Speed: Speed to move, in pixels. 0 uses Ref.step_size.
In response to Mastergamerxxx
Mastergamerxxx wrote:
ok so one problem occurs if i set it like dat its the lag of the blast but aside form that when i give the object the step size and fire the blast the player himself moves at that step rate when the player doesnt even have that as a set thing

Any step_size that isn't set in multiples of 32 will disable gliding.
In response to AbdelJN
well weird cause if i put it to 16 it disables gliding which is a multiple and is there any way to fix this so it will glide at any step size?
In response to Mastergamerxxx
Mastergamerxxx wrote:
well weird cause if i put it to 16 it disables gliding which is a multiple and is there any way to fix this so it will glide at any step size?

Sorry, my bad. I meant they have to be rounded to the nearest 32. For example. 32, 64, 96, 128 and so on. And no there isn't. I wish there was.
In response to AbdelJN
well is there any way i can increase the sped of a moving object cause the normal speed is a tad bit slow and i kinda was hopin this would make a good alternative but makin it 64 step is a tad to fast
In response to Mastergamerxxx
Mastergamerxxx wrote:
well is there any way i can increase the sped of a moving object cause the normal speed is a tad bit slow and i kinda was hopin this would make a good alternative but makin it 64 step is a tad to fast

can't do anything in between 32 and 64 without effecting gliding. I use 64 or sometimes 96 for fast projectiles