I've been looking at various tutorials or guides, and google, and experimenting myself, but I can't seem to get my hands on this right.
I've seen many games have it so I know its possible, and I thought I'd maybe try my luck here, so here's my problem:
I want players to have spells, but to be able to use the spell, they have to have learned it ( makes sense ).
I'm assuming spells will be verbs that can be used, but here's the thing, I can't seem to find how to make the verb appear ONLY if the person has learned that certain spell, and how to make it unusable, even by the command, to use if you haven't learned it. Could anyone maybe give me a helping hand, or point me out to a reference that could help me get it?
Thanks in advance, will
ID:156177
![]() Dec 12 2010, 4:45 pm
|
|
I added it to my code, but it doesn't really seem to work, i know the varaible spell_telepathy really equals to one during the test, is there some sort of place where I should actually run the proc? I'm kinda new to DM, so it still confuses me.
proc Condition() if ( spell_telepathy == 1 ) { src.verbs += typesof(/spells/verb/telepathy) } |
You can run the proc anywhere as it runs constantly as a check for the condition. It looks like you have done some sort of C programming, which I heard was acceptable in DM to a point. A proc typically runs in this form.
mob Hope this works for you. |
Yeah I know, but those brackets help me read the code clearer, since i'm used to C and PHP.
I've narrowed down the problem to that line you gave me usr.verbs += typesof(/spells/verb/telepathy) It seems thats the line thats not doing anything, since the if statement itself reveals true and the proc actually executes and sends me back a message. Any idea of what I could have done wrong here? spells verb telepathy(D as text, M as text) set src in usr D << "[usr] says: [M]" This is the actual verb, thanks a lot by the way. PS: how do you do that quote thing with the codes? |
Well the main problem is that you included the name of the actual verb. You only need to name the group or "list". So:
usr.verbs += typesof(/spells/verb)//that's it You insert code snippets by using <"DM"> and closing it with </"DM"> (without the quotes and no spaces) |
I see, but if I don't use the actual name of the verb, won't that just add all the spells in the actual group? That's gonna be a problem if I have to create a separate group for each individual spell....
|
That should be it.