Is there a way to check if a path to a verb exists within the code so I can remove it from a list if it doesn't exist anymore?
| |
#2 Aug 13 2012, 2:46 am
|
|
Thanks, first thread helped and I learned some.
| |
#3 Aug 13 2012, 4:15 am
|
|
Sorry to ask for help again but now I'm not sure how to send a message saying that the verb is no longer available. I have a list of the players verbs save in the save file and loop through them checking against all possible mob verbs but I just get an error when it gets to the removed verb.
| |
#4 Aug 13 2012, 4:23 am
|
|
Hey shades, since ATHK helped you out, you ought to mark his response as helpful in the top right corner of his post. It's useless nerd-points, but it is a nice thing to do nonetheless.
For your second question, you really shouldn't be saving verbs at all. This, however, seems to be a problem with savefile forward-compatability after you have removed a verb from the game's codebase, right? Can you show me the code for what you are trying to do? | |
#5 Aug 13 2012, 4:43 am
|
||
| ||
You shouldn't be using usr here. Change the usrs to src. It won't fix your error, but again, you really shouldn't be saving the verbs list. if you are, though, I'd save them as text:
And when you load it:
The DM guide says that text2path won't convert the text to a path if the type is invalid, and will return null. This should make your verb saving forward compatible. Let me know if this doesn't work. By all indications, though, it ought to. | ||||
#7 Aug 13 2012, 6:59 am
|
|
Thank you that solves it but if you wouldn't save the verb list then you would prefer to check and give verbs during character loading?
| |
#8 Aug 13 2012, 7:53 am
|
|
Nope. In all honesty, I wouldn't use clickable verbs at all. It's kind of one of the things that make your average internet gamer avoid BYOND. Not only that, but it's a gameplay abstraction, and makes you look at something that isn't on the screen.
Personally, I'd rather see a well-made HUD and macro setup. On the other hand, if you absolutely have to use unlockable verbs, I'd attach the verbs to objects, and put them in the player's contents. If you save the objects, the verbs will automatically be added to the player once the object is instantiated. In some very, very specific cases, you will want to save verbs, but as a matter of practice, you shouldn't have to do it for every object. | |
http://www.byond.com/forum/?post=152159#comment720377
typesof() will help, although adding the verbs to a list is a much better option IMO.