Reply
 
Thread Tools Display Modes
Old 07-16-13, 08:35 AM   #1
shyrotam
A Cliff Giant
Join Date: Jan 2010
Posts: 73
alter lua file?

I dont know any of this coding stuff. I tried making a simple change to the .lua file of an addon in the saved variables folder but it didn't appear to have the effect i wanted. Am I missing a step? thanks.
shyrotam is offline   Reply With Quote
Old 07-16-13, 08:48 AM   #2
p3lim
Mmmrrrggglll
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,167
All savedvariable files save on reload/exit, are you trying to change them while ingame?
p3lim is offline   Reply With Quote
Old 07-16-13, 09:03 AM   #3
bsmorgan
A Wyrmkin Dreamwalker
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 58
Originally Posted by shyrotam View Post
I tried making a simple change to the .lua file of an addon in the saved variables folder but it didn't appear to have the effect i wanted.
SavedVariables are read when a character logs on and written when a character logs off. Any changes made while WoW is running with a character logged on will be lost.

The Interface\AddOns\<...> .toc files are read when WoW starts and the .lua and .xml files are read when a character logs on or /reload is issued while a character is logged on. This means that adding a new addon needs to be done while WoW is not running but changes to the code of an existing addon can be recognized when a /reload is issued or logging a character off and on again.

If this confuses you, then use this rule: Only make changes when WoW is not running!

The rules are complicated because Blizzard wants to prevent external programs from making real-time changes.
bsmorgan is offline   Reply With Quote
Old 07-16-13, 11:18 AM   #4
shyrotam
A Cliff Giant
Join Date: Jan 2010
Posts: 73
that was it. it totally works. thanks.
shyrotam is offline   Reply With Quote
Old 07-28-13, 02:48 PM   #5
shyrotam
A Cliff Giant
Join Date: Jan 2010
Posts: 73
I exited the game, altered the lua file, logged in and everything worked fine.

Until I exited the game again and the lua file has reverted back to its original form.

Is there something i can do to "maintain" my lua file changes? Thx
shyrotam is offline   Reply With Quote
Old 07-28-13, 03:22 PM   #6
Nibelheim
local roygbi-
 
Nibelheim's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 1,495
Originally Posted by shyrotam View Post
I exited the game, altered the lua file, logged in and everything worked fine.

Until I exited the game again and the lua file has reverted back to its original form.

Is there something i can do to "maintain" my lua file changes? Thx
Making the file read-only may work (right click > Properties). Change to read-only after you've made your change Note, however, the addon this Lua file belongs to will no longer be able to make changes to it. Only other way to prevent your changes from being altered by the addon is to alter the addon itself.
__________________
Nibelheim is offline   Reply With Quote
Old 07-28-13, 04:46 PM   #7
jeffy162
Premium Member
 
jeffy162's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 1,784
In other words. make your changes to the \wow\Interface\AddOns\YourAddOnHere\yourAddOnHere.lua, rather than the SavedVariables.
__________________
Ahhhh, the vagueries of the aging mind. Wait.... What was I saying?


Last edited by jeffy162 : 07-28-13 at 04:53 PM.
jeffy162 is offline   Reply With Quote
Reply

Go BackWoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » alter lua file?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off