I have an issue in trying to solve and I would like help
knowing what it is I need to do,because I've tried several ways.I am trying to make a button let a player execute a verb by double clicking it.
the button:obj/hudbuttons/slash
icon='buttons.dmi'
icon_state="med"
screen_loc="1,4"
DblClick()
(something o.o)
the verb I want it to let the player perform when DblClicked on:mob/Sword/verb/Slash
ID:155840
Mar 5 2011, 6:05 pm
|
|
Mar 5 2011, 6:50 pm (Edited on Mar 5 2011, 7:12 pm)
|
|
Do you intend on allowing the player to both click the button as well as click a Slash verb in order to use it? Otherwise, it may be enough to simply change Slash from a verb to a proc and call it when the player clicks the button.
|
In response to Mecha Destroyer JD
|
|
yes I Suppose I can do That however I would still like to let them keep the verb in their statpanel as well
is there a way to make the button let the player perform the verb or must I change the verb to a proc? |
In response to 478975
|
|
Well to be honest, you have quite a few options:
Using your current method of onscreen buttons, you could just create another verb that would just call the slash proc although I'm sure there is another way to call a verb directly from your button without making it a proc beforehand (can't recall how to do this with certainty at the moment though) -or- Using the interface method of creating buttons, you would just set it's command to the verb and you'd still have both ways of using Slash. |
In response to Mecha Destroyer JD
|
|
I changed it to a proc btw and it gives me this error,I think its having trouble identifying the mob like that(or its just my crappy coding:P)
runtime error: Cannot read null.Health proc name: Slash (/mob/proc/Slash) usr: 478975 (/mob) src: 478975 (/mob) call stack: 478975 (/mob): Slash(null) the slash (/obj/hudbuttons/slash): Click("map", "mapwindow.map", "icon-x=16;icon-y=17;left=1;scr...") and heres part of the proc: mob/proc Slash(mob/M as mob in oview(1)) if(usr.atcking == 0) var/damage=1.5*usr.Strength usr.atcking = 1 if(M.ph ==0) usr<<"You attack [M]" view(7)<<'Sword1.wav' that is of course cutting lots of it out however if you know how to fix the problem that would be awesome |
In response to 478975
|
|
mob/verb/test_verb(args) There you go. |
In response to Bravo1
|
|
alright thanks so much bravo and you too mecha
however the button still cannot recognize the mob or whatever and im still getting my error issue |