ID:164099
 
In bleach there is the flash step and i am wondering on how to code it... i tried using the x+=usr.flashsteplv but then somehow when it reached for example lv 400, when i move, it will go to the void. anyone know a better way to code it?
Explain what Flash Step is to me a non Bleach watcher and Ill see if i can make something
In response to Lt. Pain
Alright,

This flash step is more likely to be known as quick step also or shunpo(in bleach).

Each or the flash step levels will boost your steps when you walk for example, you have level 15 flash step, and when you activate the flash step when you move one step, it will instead move 15 more steps forward with some blur effects on the character or a transparent duplicate of the player.

Im not sure if thats enough. o_o
In response to Ryouz
Ryouz, I can help, I'm a Bleach fan :D. Ok so I'm guessing you want the person to move a certain amount of steps depending on their flash step level? Its pretty easy, here's an example.
obj/blur

obj/clone

/*depending on which one you want choose either one or both,
the reason why I didn't define anything is that it can be defined and you create the object in the verb*/


var
flashlvl


mob/Shinigami
verb
Flash_Step(t as num) //remove this argument and the following if statements if you dont want a player to control the amount of steps.
if(!t) return
if(t > usr.flashlvl) return
//maybe I should be using the min() and max() procs?
if(t <= 0) return //prevent negatives
var/obj/blur/B = new() //You might not need this part, remove if it's not needed
if(B)
B.icon = 'icon path' // replace icon path with the icon path and the icon file name
B.icon_state = "icon state" //replace icon state with the icon's icon state.
var/previcon = initial(usr.icon)
var/previcons = initial(usr.icon_state)
var/list/ovrlays = list()
for(var/T in usr.overlays)
ovrlays.Add(T)//you might need brackets [] around the T
usr.icon = B
sleep(10)//this will have a one second blur animation depends on the icon file you use
walk(usr,usr.dir,1)//will make the blurred icon move towars the usr's direction
sleep(usr.flashlvl)
walk(usr,0)
usr.icon = previcon
usr.icon_state = previcons
for(var/O in ovrlays)
usr.overlays += O //if this doesn't work look below for contact information for any troubles.
ovrlays = null

Hope this helps!

If you have any further problems feel free to add me on MSN or AIM:

MSN - [email protected]
AIM - kakashi24142
In response to Kakashi24142
Thats way too many lines of code for something as small as flash step.
In response to Kakashi24142
Ugh. This is no good:

if(usr.dir == NORTH)


You're checking each of the cardinal directions and then reusing practically identical code in each. You need to look up get_step().

Furthermore, you're adding 32 to the locs when you probably only want to be adding 1. Remember, locate() goes by tiles, not pixels. This is moot however since get_step() does what you need.

Lummox JR
In response to L3mm0nX
I am guessing he, copied and pastied from some *coughrippedcough* game.
In response to Lummox JR
I'm still confuse on the codes o_o, and im not sure how to make the get_step() to work O: :S
In response to Quest Industries
stop making flase accusations. If it was from a ripped code, it was probably a really bad rip. I merely typed up the code for NORTH then copy/pasted it over again 3 more times and changed it depending on the directions. Next time you accuse a code of being ripped prove it first. And by the way Lummox Jr I'll look into it and edit my code using the get_step proc(If i can figure it out.) just so u all know, I've been coding for 1.5-1.75 months so that's probably why my code is long.
In response to Ryouz
dont worry i edited it so it's shorter now.
In response to Kakashi24142
Hmm, about this one, is it like, you click the flash step then it will move. is it? If it is i don't want this type though o_o, i want it to be like moving by our own maybe without clicking the verb rapidly, just press it once to activate then you move with flash step by yourself.
In response to Ryouz
oh ok, you should have specified that earlier. also can a person control how many steps they can move at a time?
In response to Kakashi24142
Your edit is still wrong. You're still moving by 32 entire turfs, not pixels, when clearly you want just 1 turf. You're still using specific directions instead of get_step(), which is still causing a lot of redundant code.

Lummox JR
In response to Kakashi24142
Kakashi24142 wrote:
dont worry i edited it so it's shorter now.

And yet, still has the exact same problems you were already apprised of.

Lummox JR
In response to Kakashi24142
hmm... Yep, they can change their flash steps level so. one step + the flash step lv is the movement they can make when walking if the flash step is activated. There will also be a limit to the levels. i hope you can do this :)
In response to Kakashi24142
Kakashi24142 wrote:
> mob/Shinigami
> verb
> Flash_Step()
> if(usr.flashlvl >= world.maxx || usr.flashlvl <= world.maxx || usr.flashlvl >= world.maxy || usr.flashlvl <= world.maxy)return /* I'm not sure if there's a simpler way to put it */

Unfortunately, your verb won't make it past this line. The first two conditions in the if() basically say this:
If usr.flashlvl is greater than, equal to, or less than world.maxx, return.

>          if(usr.flashlvl + usr.x >= world.maxx || usr.x - usr.flashlvl <= world.maxx ||usr.flashlvl + usr.y >= world.maxy || usr.y - usr.flashlvl <= world.maxy)
> usr << "You can't move that far!"
> return


You're doing bounds checking in every direction, instead of just the direction of movement. Suppose we're moving NORTH, and we're on the far right edge of the map, and flashlvl is 1. This if() will return after sensing that usr.flashlvl + usr.x is greater than world.maxx, even though we're not moving in that direction. You only want to check the bounds of the direction you are moving in.

>             if(usr.dir == NORTH)
> usr.loc = locate(usr.x,usr.y+32,usr.z)
> if(usr.dir == SOUTH)
> usr.loc = locate(usr.x,usr.y-32,usr.z)
> if(usr.dir == EAST)
> usr.loc = locate(usr.x+32,usr.y,usr.z)
> if(usr.dir == WEST)
> usr.loc = locate(usr.x-32,usr.y,usr.z)


I'm assuming that you want to move usr by 1 in whatever direction that usr is facing; this could be done with a simple call to step(usr, usr.dir).
>             usr.loc = locate(usr.x,usr.y+32,usr.z)


I'm not sure why we're moving NORTH afterwards...
>             del(ovrlays)  
>


I think it would just be better to set ovrlays to null, instead of calling del() on it.

Hiead
In response to Hiead
i edited it one more time, if its still wrong, someone else should help him :/
In response to Kakashi24142
uh.. sleep(flashsteplv)? isn't that like, if i have lv 40 flash step, it will cause more delay?... O_o.. Thats not what i mean O:. Flash step levels add the steps he will take.
In response to Kakashi24142
Hmm, still needs this code >.<. I stated the description on the replies O:
In response to Kakashi24142
Hmm, I still need help on this >.<
Page: 1 2