ID:266827
 
Ok I know how to make an obj but I don't know how to make it the same as the users direction, and is there an easier way to do this:

if(usr.dir==NORTH)
new/obj/lasers(usr.x,usr.y+1,usr.z)
if(usr.dir==SOUTH)
new/obj/lasers(usr.x,usr.y-1,usr.z)
etc...
var/obj/A = new/obj/lasers(usr.x,usr.y+1,usr.z)
A.dir = usr.dir
In response to WildBlood
Here is my code now


mob/verb/testlaser()
if(usr.dir==NORTHWEST)
var/obj/A=new/obj/lasers(usr.x+1,usr.y+1,usr.z)
A.dir=usr.dir


It dosn't create the lasers?
In response to DBZ Kidd
Take away that if statment you have,

var/obj/A=new/obj/lasers(get_step(usr,usr.dir))
A.dir=usr.dir
In response to WildBlood
Still didn't work

obj/lasers
icon='weapons.dmi'
icon_state="lasers"

That's my obj code
In response to DBZ Kidd
I don't know if there is somthing wrong with my icon, but even if I create using new/obj/lasers(usr.loc) it still dosn't appear, is there something wrong with my Dream Maker or what.
In response to DBZ Kidd
Probably something wrong with your icon.
In response to Foomer
I have no idea what could be wrong with it it looks fine the icon_state's all line up does anyone know what can possible be wrong.
In response to DBZ Kidd
Does the icon work? (You may have mistyped the icon_state) Goto the map editor and try to place one.
In response to Nova2000
Ya it works I did that
In response to DBZ Kidd
Try this then:

create the object where you want it, then have it return it's location.

<code>var/obj/laser/A = new(get_step(src,src.dir)) A.dir = src.dir world << "[A.x], [A.y], [A.z]"</code>

And see if it was created where you wanted it.
In response to Foomer
How can I move it in the direction that it's headin then delete it after like 5 secs?
In response to DBZ Kidd
Use the walk() proc and spawn() a delete in the New() proc.