ID:157042
 
I would like to code Dash Tech for my game, so can someone help me ?
mob/verb/Dash()src<<"You dash!"
LaNuiit wrote:
I would like to code Dash Tech for my game, so can someone help me ?


Look for step(), Move(), while().
If you want someone to do it for you, then go to Classified Ads. If you want some opinions on how something like Dash could be produced, go to Design Philosophy.

Dashing would be just that, a quick movement. You need to be a bit more specific since there are many things to take into consideration when going about dashing such as movement speed, movement distance, when to stop, how to initiate, how they go about moving and etc.
In response to Maximus_Alex2003
I want to code the tech that when you use it you get 5 steps quicker then others, and users icon looks like it's really dashing.
In response to LaNuiit
Then you'll most likely want step() or Move(), icon_state or flick(), while() or if().
In response to Maximus_Alex2003
Can you give me a resource ore something =/
In response to LaNuiit
http://www.byond.com/docs/guide/

http://www.byond.com/docs/ref/

http://www.byond.com/members/?command=search&type=resources

Like I said earlier, this isn't classified ads so we aren't really required to just produce code. We can give you ideals of How-To do something, though.
In response to Maximus_Alex2003
i was trying to code it like this :


Dash()
set hidden = 1
var/obj/Technique/T
for(var/obj/O in usr.techniques)
if(istype(O,/obj/Technique/Dash/))
T = O
if(Dashing)
usr.frozen = 1
sleep(1)
usr.loc=locate(x+3,y,z)
usr.frozen = 0

But it gives me an error in game
In response to LaNuiit
LaNuiit wrote:
        Dash()
set hidden = 1
var/obj/Technique/T
for(var/obj/O in usr.techniques)
if(istype(O,/obj/Technique/Dash/))
T = O
if(Dashing)
usr.frozen = 1
sleep(1)
usr.loc=locate(x+3,y,z)
usr.frozen = 0

Well, It's really quite awkward of a code snippet.
Why are you defining obj/Technique/T, when you can just do that with for(var/obj/Technique/T in usr.techniques).
You don't want to use loc=locate() really, especially when you are manually adding 3 to their x. This can lead to some serious bugs like making them dash to places they shouldn't be able to.

EDIT:
Oh, you are checking if the Dash Technique /obj exists in their inventory?
Might as well make it an /obj verb that exists with the Dash /obj instead. Or just have it check in the /mob's techniques contents whether the Dash /obj exists or not.