My current system for saving and loading players' verbs is fairly volatile...
I use params2list() for the mob's verbs and then save that list.
To load, I just reverse this process...
for(var/v in vrbs) usr.verbs +=v)
I'm pretty vague on how I have it exactly, as I don't access to my project from this computer, and don't have internet on the computer that has it.
Good times.
The short of it is that I make the verbs a list, and save that list. And reverse that process to load the verbs.
The thing is, I've been experiencing a few errors that I cannot yet explain, the result of which is that the reading/loading of the list is stopped midway through and thus, a lot of attack verbs are not loaded, and re-logging usually doesn't fix this.
The only way around this is to edit the players variables which is tedious and cannot be relied to fully fix the player.
Is there a better way to save and load verbs so as to prevent/minimize permanent verb loss?
ID:273070
![]() Aug 17 2009, 4:13 pm
|
|
![]() Aug 17 2009, 6:35 pm
|
|
Search the forums. There are many threads on this topic.
|
Just spent a good while searching and reading, but couldn't find anything strikingly useful.
Found out that I can just save and load the verbs var rather than transforming it into lists each time... But would that really stop verbs being lost from the savefile forever? |
Verbs will not be lost if you don't make any mistakes. :) Computers will rarely do something 'randomly', or something you don't instruct them to. You just might not be speaking clearly enough for the computer to understand. I'd say the simplest way to save your verbs is to keep any new verbs in a separate list. Then on loading check if the list exists, and if so, loop through them and add them to your verbs. This should result in NOTHING being lost, as long as you don't forget to add it to your separate list. A simple way to not forget that is use a proc() to handle it for you. Such as: mob/proc/AddVerb(VerbyVerb) |
The simplest way to save verbs is to not screw around with the verbs list and to just throw objs into contents to hold any additional commands that you may need.
|