Hey now that I have my triggers working and I am now wanting to capture the data into a table. The table will be persistant table. I am going to save the information with table.save and I want to load the table when my profile loads.
What is the best practice to do this? I saw there is a an event called sysLoadEvent but I am not sure how to do them correctly.
Any suggestions?
Creating, Loading and Saving Tables best practices
Re: Creating, Loading and Saving Tables best practices
See http://mudlet.org/asciidoc/manual.html#savingVariables
sysLoadEvent is when your profile is being loaded. It might be a good idea to load your serialized data as well then.
sysLoadEvent is when your profile is being loaded. It might be a good idea to load your serialized data as well then.
Re: Creating, Loading and Saving Tables best practices
I've read through the manual and it kind of explains it, but I wanted to know how you gurus handle it. Also the event are really explained. I did watch the video but is it the same for system events?
Re: Creating, Loading and Saving Tables best practices
I decided to post here instead of making a new thread, but not quite sure if it should go here.
Anyway, table.save() and table.load() saves tables to files inside the Mudlet installation folder, not into the GetMudletHomeDir() folder (in windows: %userprofile%\.config\Mudlet\<ProfileName>)
This means mudlet overwrites saved tables if multiple profiles are used. In addition, table.load() throws an error if the file can't be found. I tried wrapping it with
Anyway, table.save() and table.load() saves tables to files inside the Mudlet installation folder, not into the GetMudletHomeDir() folder (in windows: %userprofile%\.config\Mudlet\<ProfileName>)
This means mudlet overwrites saved tables if multiple profiles are used. In addition, table.load() throws an error if the file can't be found. I tried wrapping it with
but that seems to only capture the error if the pcall is around the final called function, not when wrapped around the table.load() call itself.
Re: Creating, Loading and Saving Tables best practices
See "Saving via table.save & table.load" of the manual, it describes how to save it in the proper file location, not the installation directory which is not accessible on all platforms.