ID:179858
Oct 20 2001, 8:25 am
|
|
Is there a way to make a verb that if a var islocked==1 it picks something from a list, and you can make one more likely to happen than another?
|
In response to Spuzzum
|
|
Spuzzum wrote:
Valderalgx wrote: Oh, thanks, but one problem...when i put it in the verb it wont let me give the usr a message and change the var to 0. |
In response to Valderalgx
|
|
Valderalgx wrote:
Spuzzum wrote: wait I got that, but now I have: mob/verb/picklock(obj/door/d as <font color=red>what</font> in oview(1)) if(d.islocked==1) d.islocked=pick( BLAH) if(d.islocked==1) usr<<"You failed to pick the lock!" else usr<<"you picked the lock the only problem is I don't know how to change the<font color=red> what</font> to something so it has effect only for the door not other stuff. |
In response to Valderalgx
|
|
the only problem is I don't know how to change the<font color=red> what</font> to something so it has effect only for the door not other stuff. You're making that more difficult than needed. You shouldn't pick something from a list in that case: if(prob(whateverskillformula)) usr << "You picked the lock!" else usr << "You failed to pick the lock." As for the verb targetting question, you'd be better off making the 'pick lock' a verb that belongs to the door instead of the mob. Eg. obj/door/verb/pick_lock() set src in oview(1) |
In response to Spuzzum
|
|
Spuzzum wrote:
the only problem is I don't know how to change the<font color=red> what</font> to something so it has effect only for the door not other stuff. But what if I wanted only a mob called theif to have the verb? |
In response to Valderalgx
|
|
Valderalgx wrote:
Spuzzum wrote: Good point -- unfortunately, there is no universal solution to this problem, since there are two things: 1) Mobs get verb and can try to lockpick anything. 2) Objs get verb and anyone can try to lockpick it. |
In response to Spuzzum
|
|
Spuzzum wrote:
Valderalgx wrote: Well there is one solution using if(istype()) to check if it is the proper mob to pick the locks. |
In response to Nadrew
|
|
Nadrew wrote:
Spuzzum wrote: True, but then the verb is still avalible to other mobs just it wont work. [EDIT] would this work? obj/door/proc/picklock() and where it changes the usr to mob/theif put usr.verbs+=/obj/door/proc/picklock() |
Ok, I fixed the part about getting it to locate in the mob/theifs verbs, but this is the part i am having trouble with
obj/door/proc/Picklock() set src in oview(1) First of all this doesn't work it doesn't show up in the verbs panel This does work usr.verbs+=/obj/door/proc/Picklock in the login code and obj/door/proc/Picklock() if(I dont know what to put here so it checks obj/door's islocked var, I was thinking in the () put obj/door/D, but it pops up a screen to choose stuff out of (not what i want) Help!!!!!! |
In response to Valderalgx
|
|
Valderalgx wrote:
Ok, I fixed the part about getting it to locate in the mob/theifs verbs, but this is the part i am having trouble with Since the verb belongs to a obj you can't add it to a mob the code that was given to you before adds the verb when the door is one tile away and removes it when the door is more then one tile away. |
var/whatever = pick(prob(30);"Blah", prob(50);"Blargh", prob(90);"Aieee")