ID:144825
 
Code:
macro
a return "Punch"


Problem description: The problem is this: When I put this in a dms file, it says it's correct. But when I try to press "a", it says nothing was assigned to it. Do you know what's wrong?

You need to make an actual verb to go with it... think macro as a verb shortcut (keyword: verb not proc)
macro
a return "Awsome"
s return "Stupid 1"
d return "Stupid 2"


mob/verb
Awsome
world<<"OMZDKUSDG! THSI ROX0RZ!!!one!on1eone!1"
Stupid(i as num)
if(i==2)world<<"You are stupid... you dumbass."
else world<<"OMG, I wonder what this shiny red button does..."


- GhostAnime
In response to GhostAnime
I did make a verb. sorry i didn't post that before.

here's the verb:
mob/verb
Punch()
set category="Attacks"
var/obj/k=new/obj/n
k.dir=usr.dir
k.loc=usr.loc
step(k,k.dir)
var/turf/t=k.loc
for(var/mob/M as mob in t)
if(!usr.punching && !M.NFC && !usr.Attacking)
usr.Attacking=1
spawn(1) usr.ComboHits()
spawn(1) usr.ComboList()
usr.punching=1
var/Damage=(usr.Atk+usr.Atk_BONUS+roll(d6))-(M.Def+M.Def_BONUS)
if(Damage>=1)
usr << "You punch [M], doing <b>[Damage]</b> damage!"
M << "[usr] punched you, doing <b>[Damage]</b> damage!"
M.HP-=Damage
DeathCheck(M)
else
usr << "You punch [M], but you did no damage!"
M << "[usr] punched you, but did no damage!"
sleep(1)
usr.punching=0
usr.Attacking=0
del(k)
return
else if(usr.punching || usr.Attacking)
del(k)
return
else if(M.NFC)
usr<<"You can't fight non-fighting characters."
del(k)
return
if(!usr.Attacking && !usr.punching)
usr.Attacking=1
usr.punching=1
spawn(1) usr.ComboHits()
spawn(1) usr.ComboList()
sleep(1)
usr.Attacking=0
usr.punching=0
del(k)
return
else if(usr.Attacking || usr.punching)
del(k)
return


EDIT: There's 2 variables (Attacking & punching) for a reason. I'm making a combo system.

(credit given to people who actually thought of this before me.)
In response to Xkirby2
Is the little ALT button activated in the bottom left hand corner of DS? Try that if it isn't.

- GunRunner
In response to GunRunner
It is. It might have to do with the "client/script" thing i added. The macros are part of the script, right?

EDIT: It was the client/script thing I added, so, how do I make it so that I have a blue text box with white text and still keep the macros? Is it possible?
In response to Xkirby2
Xkirby2 wrote:
So, how do I make it so that I have a blue text box with white text and still keep the macros? Is it possible?

Yep, you just combine the two. I prefer doing it all under client/script:
client/script = {"
<STYLE>BODY {background: blue; color: white}</STYLE>

macro
a return "Punch"
"}


Edit: *Cough* >.>
Thanks for the catch Mysame!
In response to DarkCampainger
Polo