Forums » Community Projects

Learning the ropes

May 02, 2009 Palamedes link
So I am playing with creating my own addon and I will have questions.. I thought I would ask one here and then use this thread to ask all my questions instead of creating new threads every time..

Question 1; My plans are to create a fairly complex hash of data that I will want to be able to reference each time a user logs in and plays the game. How do we save and reload our data from within our plugin?
May 03, 2009 maq link
gkini.WriteString and gkini.LoadString save stuff to config.ini
but they are broken for string longer then ~770 characters
this is good for simple settings

SaveSystemNotes LoadSystemNotes work on file located in
vodir/setting/<charname>/system<id>notes.txt
actual systems have id's from 1 to 30 but you can use any number
so that's actually the way to go
only possible issue is, it'll be character sepcific
(tho if you really want you can get around that)

for serialization you can use spickle and unspickle functions. (or of course anything else you like, json, xml or w/e but spickle is built in)
spickle takes table as argument and return string that you can later give to unspickle and get similar table.
so like
SaveSystemNotes(spickle(my_table), 12345)
my_table = unspickle(LoadSystemNotes(12345))

you can find details on http://www.vo-wiki.com/racecar
May 03, 2009 Palamedes link
Awesome Maq thank you..
May 03, 2009 Palamedes link
Pretty sure I know the answer to this question already but.. here goes;

Is it possible to tie into other namespaces such that I can add elements to their iup?

Read: Can I add a button to the station UI below "Inventory" or something of that nature?
May 03, 2009 maq link
You can add elements to gui with iup.Append, tho you need to do bit of reverse engeneering to figure out what to append to.
Takes some familiarity with iup.

It has nothing to do with namespaces.

Most people just make a separate dialog for their plugin and make a command to show it.