ID:139104
 
Code:
magik_shield()
if("magik shield" in src.ToggledSkills)
src.ToggledSkills-="magik shield"
src.CanMove=1
for(var/obj/SkillSups/BMShield/P in src.Cache) {src.overlays-=P;del P}
else
src.ToggledSkills+="magik shield"
var/obj/SkillSups/BMShield/P=new()
//src.dir=get_dir(EAST,src)
if(src.dir==get_dir(EAST,usr))
P.pixel_x+=32
src.CanMove=0
if(src.dir=="West")
P.pixel_x-=32
src.CanMove=0
if(src.dir=="North")
P.pixel_y+=32
src.CanMove=0
if(src.dir=="South")
P.pixel_y+=32
src.CanMove=0
P.icon_state="magik shield";src.Cache+=P;src.overlays+=P


Problem description:
okay, well, no matter what i do i cant seem to get it to be created in the direction the user is facing and then also get the x,y cords to move aswell, can anyone help me with this? i tihnk im using get_dir wrong.

Hmm, I don't really know why you need to use get_dir at all here..
magik_shield()
if("magik shield" in src.ToggledSkills)
src.ToggledSkills-="magik shield"
src.CanMove=1
for(var/obj/SkillSups/BMShield/P in src.Cache) {src.overlays-=P;del P}
else
src.ToggledSkills+="magik shield"
var/obj/SkillSups/BMShield/P=new()
if(src.dir==EAST)
P.pixel_x= 32
src.CanMove=0
if(src.dir==WEST)
P.pixel_x= -32
src.CanMove=0
if(src.dir==NORTH)
P.pixel_y= 32
src.CanMove=0
if(src.dir==SOUTH)
P.pixel_y= -32
src.CanMove=0
P.icon_state="magik shield";src.Cache+=P;src.overlays+=P



dir isn't a string, that might be where you are confused :)
In response to Kenpachi12
Kenpachi12 wrote:
Hmm, I don't really know why you need to use get_dir at all here..
> magik_shield()
> if("magik shield" in src.ToggledSkills)
> src.ToggledSkills-="magik shield"
> src.CanMove=1
> for(var/obj/SkillSups/BMShield/P in src.Cache) {src.overlays-=P;del P}
> else
> src.ToggledSkills+="magik shield"
> var/obj/SkillSups/BMShield/P=new()
> if(src.dir==EAST)
> P.pixel_x= 32
> src.CanMove=0
> if(src.dir==WEST)
> P.pixel_x= -32
> src.CanMove=0
> if(src.dir==NORTH)
> P.pixel_y= 32
> src.CanMove=0
> if(src.dir==SOUTH)
> P.pixel_y= -32
> src.CanMove=0
> P.icon_state="magik shield";src.Cache+=P;src.overlays+=P

dir isn't a string, that might be where you are confused :)

well, mind giving me a decent solution cause this stil lwont work D8 i been tryin forebah.