I'm stuck at a place in my code where I'm not sure how to proceed. What I need to happen is when the turf is entered and the condition that the mob/pc hands have a clay tool in it, it shows the Dig() verb. and only if they have the tool in their hands, otherwise it won't show. verb += is what I'm thinking I need but not sure.. anyways heres the code:
clay
icon = 'sand.dmi'
icon_state = "clay"
Entered(mob/pc/M)
if (M.hands == "clay tool")
verb/Dig()
LJR
ID:149859
![]() Feb 5 2002, 10:49 am
|
|
clay
icon = 'sand.dmi' icon_state = "clay" Entered(mob/pc/M) verb/Dig() ..() if (M.hands == "clay tool") M.verbs +=/mob/hidden/verb/dig else ..() Exited(mob/pc/M) M.verbs-=-/mob/hidden/verb/dig // Hidden Verbs mob/hidden verb Dig() This is what I'm trying to do now.. The mob/hidden is a mob that will never be created on the map, but will contain all my hidden verbs that can be added. LJR |
Ok I got the Entered(), Exited() one working.
Now I need to do kind of the same thing, but not with the person Entering the tile. When they get within oview(1) of the tile which has a density of 1, it will give you the option to mine the mountain. But since the mountain has a density of 1, you can't enter it, so just when u get close the verb will be added if you are holding a pick. Any ideas?? |
Try something like this:
turf This is untested, so tell me how it works out. -Rcet |
You may be onto something here, but I don't even want the verb to show up if they don't have a pick in hand.
I got the code too add and remove verbs, just not how to check if they are nearby opposed to entering to activate the check. LJR |
LordJR wrote:
Well ok, then you need something like this: turf Try that. -Rcet |
Two possibilities I can think of off hand...
1) create an /area/mountain_view or something like that, and place it around all your mountains. Then go back to the Entered() proc soloution. 2) mob I'm not sure how efficient that second one would be... You might need to test if /dig is in verbs before adding or removing it, but it might work. This also would fail if you use src.loc = locate to teleport and such, so you would have to set up a seperate /proc to test the location after that type of direct move. flick() |
Rcet wrote:
> turf You can't set src at runtime, only at compile time I believe. And in this case, the only way there would be a usr, is if they had already used the verb. |
turf/Musical_/Entered(O)
..()
var/mob/M = O
M.verbs += /obj/musical_/verb/play_music
Hope that helps.
Alathon