Ok, I'm trying to make less verb in the panel fro a new game by using the HUD System, I know there's a way to do this, but...I don't feel like having tons of if()'s and else's every where's, when I know there's probably something simpler out there there...ok, here's problem:
I want to make a button called "Talk" where, if you're facing certain mobs...it cals their Talk() verb which is set to hidden. But, it won't allow me to...any ideas or suggestions?
ID:176221
Feb 6 2003, 4:03 pm
|
|
Well, first you have to create the basic NPC group, which contains the Talk() proc..
mob/npc Now to create a sample NPC.. mob/npc/Sample_Guy Now onto the real thing.. The Speak() verb.. mob/verb I think that will work. It's not tested. Tell me if it helps. Ooops, almost forgot. Now just make an object on the hud call this verb, under the Click() proc. Or just make the verb a proc, and call that. ~>Volte |
In response to Ter13
|
|
well, like I said...I knew all that stuff, but...I wanted something simpler, not pretaining so I have to insert every mob as an if()
|
In response to Goku72
|
|
what do you mean? insert every new mob as an if? just do what the other guy did! give evey mob a dialogue var, and if they do something special , define a new npc sub-type!
|
In response to Ter13
|
|
Yes, but...it's not just "TEXT" it's options...
|
In response to Goku72
|
|
Goku72 wrote:
Yes, but...it's not just "TEXT" it's options... Then just use this.. I modified my original code that I made for you: mob/npc Hope it helps you. ~>Volte |
if you aren't putting it in a panel, just define it as a proc!
mob
npc
proc
talk(var/mob/M)
M << "blah blah blah"
return 1
obj
hud
talkbutton
Click()
var/turf/T = get_step(usr.mob,usr.mob.dir)
if(!isnull(T))
for(var/mob/npc/M in T.contents)
M.talk(usr.mob)
return 1
else
return 0
and that should do it! In short, the proc is the same as a verb but it won't show up in any verb panels unless you tell it to. In short, if you are going to manually call a function through general code, it's best to put it into a proc.
I hope this works for you, bye!
[edit] I fixed the hbutton thing, I got it wrong!