Jump to content
Alloder.pro: about Allods with love
Search In
  • More options...
Find results that contain...
Find results in...

New program for writers

We turn from quantity to quality and tell you how we will supplement the Allods Team program with rewards in rubles.

More

The new Updater

Let us to introduce the new addon updater software and to share the details

Read more

Alloder 2.0

We have started the process of project evolve, and this relates not only, and not even primarily of the site's view

Read more

the new ConfigSection API


Guest Morted
 Share

Recommended Posts

Hi there,

if have a quick question about the new AP functions:

How can you save/load data in custom Config.txt files?

AddonsTools does so, and TargetManager as well.

But how the hell do you do it? (i tried understanding your code, of cause)

shouldnt this save an entry to the "local" config.txt:

local cfg = {}

cfg["test"] = "insert"

userMods.SetAvatarConfigSection(common.GetAddonName(),cfg)

but it doesnt work.

Could anyone tell me why?

Link to comment
Share on other sites

I use:

Code:
local lConfig = userMods.GetAvatarConfigSection( common.GetAddonName().."DnD" ) or {}

This creates "lConfig" variable. If there is data in section called "addonnameDnD" then lConfig takes that data, otherwise lConfig is an empty table.

Then i use:

I change lConfig variable (for example set lConfig.DNDenabled to true) and use:

Code:
userMods.SetAvatarConfigSection( common.GetAddonName().."DnD", lConfig )

And that works fine. Do you get any errors, or can you show a little bit more of code?

The data is not saved into some custom config.txt, it's saved into user.cfg and global.cfg files.

Link to comment
Share on other sites

well how DO you save/read the custom config.txt then?^^

There must be a way of accessing those files, this is from the AddonDesc of TargetsManager:

<Item href="Scripts/Globals.luac" />

<Item href="config.txt" />

<Item href="Locales/Locales.lua" />

but how the hell do they work with the config.txt?

Link to comment
Share on other sites

Please ask icreator about her addons and stuff, but her config.txt is just a simple lua script. Cant modify it from ingame.

It's usefull since she has all files compiled and you can't change them, but that one is not compiled and you can change it. And it's extension is txt instead of lua so ppl can edit it with notepad without explanation.

But it's still a lua script. It's executable lua script. No more.

You may have

<Item href="config.txt" />

<Item href="Documents/Mypornmovie.avi" />

But it'll (i believe) still work if it's just a lua script.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

By using our site you agree to the Terms of Use