ID:2319055
 
(See the best response by FKI.)
hey i need help on one thing on my attack i would like to add onther line
like this --> https://imgur.com/a/Ny5dD
and this is the effect of the attack
how can i do that thanks for the help !
Code:
                bone_amount = 7 + src.s_level
var/modifier = 1
M.in_bind = 1
for(var/i = bone_amount, i>0, i--)
var/obj/JutsuEffects/Ash_Pile/pulse = new/obj/JutsuEffects/Ash_Pile(M,dmg)
pulse.loc = M.loc
pulse.dir = M.dir
if(pulse.dir == NORTH)
pulse.step_x = M.step_x
pulse.step_y = M.step_y + (32*modifier)
if(pulse.dir == NORTHEAST)
pulse.step_x = M.step_x + (32*modifier)
pulse.step_y = M.step_y + (32*modifier)
if(pulse.dir == NORTHWEST)
pulse.step_x = M.step_x - (32*modifier)
pulse.step_y = M.step_y + (32*modifier)
if(pulse.dir == EAST)
pulse.step_x = M.step_x + (32*modifier)
pulse.step_y = M.step_y
if(pulse.dir == SOUTHEAST)
pulse.step_x = M.step_x + (32*modifier)
pulse.step_y = M.step_y - (32*modifier)
if(pulse.dir == SOUTH)
pulse.step_x = M.step_x
pulse.step_y = M.step_y - (32*modifier)
if(pulse.dir == SOUTHWEST)
pulse.step_x = M.step_x - (32*modifier)
pulse.step_y = M.step_y - (32*modifier)
if(pulse.dir == WEST)
pulse.step_x = M.step_x - (32*modifier)
pulse.step_y = M.step_y


Problem description:

Best response
What you want to do is offset the jutsu object's location to have the objects appear in rows. For example, if you know the jutsu is to be facing NORTH, then you would be creating a row of 3 jutsu objects horizontally at the desired location, and offsetting two of those objects to the left and right respectively. You can achieve this using get_step(), locate(), or Move() to modify step_x/y for offsets less than tile size -- just depends on what you want.
oh ok so i just need to add get_step of the first jutsu for the 2 other and after move it with step_x/y ?
In response to Carcanox32
In so many words, yes -- if I am understanding you correctly. You know where you want the objects to be so execution should be fairly straightforward.

Feel free to show your code though as you change it and I or someone else can continue to guide you until comfortable.
I try many thing but I can figure how to fix that try get_step but I can't make it work do you have a example or something
In response to Carcanox32
get_step() will return a location, right? In other words, if there's a turf there, it will return the turf in the given direction from the given reference (if no turf exists, it will return an area, and if no area exists, it will return null). If you store what get_step() returns, you can then use that as a reference point to create your "jutsu" object.

Even further, you can then use the turn() proc (which returns a direction) in tandem with further usage of the get_step() proc to create "attached" objects to your "jutsu" object.

So in short...
1) Use get_step() to determine where to create the initial object.
2) Create the initial object.
3) In the initial object's New() proc, and using get_step() and turn() in tandem, you can create the "attached" objects on whatever side(s) you need. Just make sure you call the parent in the jutsu object's New() proc.
4) ???
5) profit
In response to Carcanox32
Post your attempt(s) and we'll tell you where you went wrong so you can try your hand at fixing it.

Don't hesitate to re-read our posts either. Read the reference again and read it some more. You can never be too familiar with your tools.

The fact that [I'm assuming] you have already created a straight-firing jutsu means you are halfway there. If you are having a hard time grasping this, that indicates to me you lack understanding of the tools (procs) mentioned in this topic that would achieve that.

Visualize how your jutsu should appear in every given direction and make those tools (procs) work for you.