ID:270816
 
How do i make a move go in a straigh line.

Ex:
(... Is attack)

(Person).............(Enemy)
Look at Get_Step, that should help a lot.
In response to Pakbaum
Pakbaum wrote:
Look at Get_Step, that should help a lot.

mob/Jutsu/verb/IceNeedle()
set category = "Ninjutsu"
set name = "Ice Needle"
if(usr.resting){usr<<"Not while resting!";return}
var/mob/IceNeedle/N = new /obj/IceNeedle(usr.loc)
if(usr.dir == "East")
get_step(usr.loc,"East")
if(usr.dir == "West")
get_step(usr.loc,"West")
if(usr.dir == "North")
get_step(usr.loc,"North")
if(usr.dir == "South")
get_step(usr.loc,"South")

it says get_step :warning: statement has no effet

what is the point of get_step if im trying to send it in a straight line?
In otherwords i want it to keep going in a line, till it hits something.
In response to Chibi-Gohan0
get_step(usr.loc,EAST)

not "East"
In response to XzDoG
mob/Jutsu/verb/IceNeedle()
set category = "Ninjutsu"
set name = "Ice Needle"
if(usr.resting){usr<<"Not while resting!";return}
var/mob/IceNeedle/N = new /obj/IceNeedle(usr.loc)
if(usr.dir == "East")
get_step(usr.loc,EAST)
if(usr.dir == "West")
get_step(usr.loc,WEST)
if(usr.dir == "North")
get_step(usr.loc,NORTH)
if(usr.dir == "South")
get_step(usr.loc,SOUTH)

it still says the same thing = get_step :warning: statement has no effect
In response to Chibi-Gohan0
Now that I look at what your doing, just use walk(). I don't think get_step does what you think it does.
In response to XzDoG
You're correct about that, get_step get's the location of the direction stated (one step ahead) and returns that location.. so yea, it's suppose to be either step() or walk()

Btw, == "West" => wrong >.>

- GhostAnime
In response to XzDoG
Just replace get_step with walk?
In response to Chibi-Gohan0
Look up walk() and step() before proceeding with which one you chose to go with :/ DM Reference/F1 in DM is there for a reason >.>

- GhostAnime
In response to GhostAnime
after reading it, i got the the part where:

mob/Jutsu/verb/IceNeedle()
set category = "Ninjutsu"
set name = "Ice Needle"
if(usr.resting){usr<<"Not while resting!";return}
var/obj/IceNeedle/N = new /obj/IceNeedle(usr.loc)
if(usr.dir == "East")
walk(N,EAST)
if(usr.dir == "West")
walk(N,WEST)
if(usr.dir == "North")
walk(N,NORTH)
if(usr.dir == "South")
walk(N,SOUTH)

It succesfully create the needle, but dosent go annywhere.
According to what i read, walk should have worked.
In response to Chibi-Gohan0
Directions are not text strings. You can't do if(dir=="East"), you have to do if(dir==EAST) just like for walk()/get_step().
In response to DeathAwaitsU
DeathAwaitsU wrote:
Directions are not text strings. You can't do if(dir=="East"), you have to do if(dir==EAST) just like for walk()/get_step().

Ok thanks. now it fires it. But now what if i want it to hit a mob, and do damage?

Could i add Enter() to the needle? or would that only work in reverse?
In response to Chibi-Gohan0
Ok well first of all, this seems a bit illogical:

var/mob/IceNeedle/N = new /obj/IceNeedle(usr.loc)

Why are suddenly creating a mob? I think it'd be better to do

var/obj/IceNeedle/N = new(usr.loc)

As for your collision problem, look up Bump(). Enter() only really works passively. It'd probably be worth your time to read this entire article:

http://members.byond.com/?post=4289
In response to DeathAwaitsU
DeathAwaitsU wrote:
Ok well first of all, this seems a bit illogical:

var/mob/IceNeedle/N = new /obj/IceNeedle(usr.loc)

Why are suddenly creating a mob? I think it'd be better to do

var/obj/IceNeedle/N = new(usr.loc)

As for your collision problem, look up Bump(). Enter() only really works passively. It'd probably be worth your time to read this entire article:

http://members.byond.com/?post=4289

the mob was previousely, i allready fixed that, sorry i dident change it.

as for the url, i need something to bump into the needles, such as a npc(already have) and do damage
In response to Chibi-Gohan0
You would want Bump than()
obj/WII
density=1//important!
verb/Throw()
set src in usr
owner=usr
loc=usr.loc
walk(src,NORTH)
Bump(mob/A)//This will NOT look for mobs only, it CAN include other dense objects
if(ismob(A))//For Bump(), Enter() and other related procs, make sure you check that it actually is a mob or so forth
A.Dmg(23,owner)
del(A)//deletes the object if it hits anything dense


- GhostAnime
In response to GhostAnime
What if there was a way to make it that if the needles at all bumps ANNY mob it'd do damage, as for this give non npc mobs(walls,ect) inf hp or allot annyway?

-So you'd make all mobs in the world sensative to if annything hits it, if its the needles, do dmg?
In response to Chibi-Gohan0
Either way, i fixed it.
Thanks guys for the other help with sending it flying.