mob/basic/verb/Sushin(mob/M in world
Problem description: how to call that verb
eg: usr.Sushin()
I want to do a Hud so i need some of those verbs to be called via the obj
ID:143119
Dec 12 2007, 2:06 pm
|
|
Code:
mob/basic/verb/Sushin(mob/M in world Problem description: how to call that verb eg: usr.Sushin() I want to do a Hud so i need some of those verbs to be called via the obj |
Dec 12 2007, 2:29 pm
|
|
Verbs are called in precisely the same manner as procs.
|
If either one of you would have stopped to examine his problem for one blasted second you'd have seen that your advice doesn't touch the heart of the matter here at all.
Anyway, Cybork, a verb can be called just like a proc, but you have to supply the arguments yourself (arguments are the things between the parenthesis, like 'M in world'). So, to call the Sushin verb, you'd have to call it like this: usr.Sushin(target) The problem is that just calling Sushin() (without arguments) won't ask the user to choose a mob, like clicking a verb in a panel would do. You have to get around this by using something like the input() proc, which you can read about in the reference. So, when your button is pressed something like this should happen: var/mob/target = input(usr,"Target who?","Sushin") as mob in world If you're using a button in a custom skin, then you'll need to put that into a new verb; you can call it Sushin_button() or something like that. To prevent the verb from showing up in a verb panel, you can make it's name start with a period. All in all, the verb might look something like this: mob/basic/verb/Sushin_button() Lastly, you'll just need to make sure that your button calls ".Sushin" when it is pressed. And that's it. Really simple, didn't take me long to think up or write at all, and it wouldn't have taken either of the other guys who posted very long to help out, either, if they'd just take a moment to think what's it's like to be new to BYOND. |
In response to Kaiochao2536
|
|
the problem is that the verb cant be called
coz there aint no mob/basic/verb/Sushin var.... if i put Sushin it wont work... i guess i wud have 2 do: usr.basic/Sushin or something :S |
In response to Cybork
|
|
You would first need a variable of type /mob/basic, and declared as type /mob/basic. So, for example:
var/mob/basic/M = usr Then, you can call M.whatever(). Just like a proc. |
In response to Garthor
|
|
nope ... doesnt work
|