Definitions Help

Language: JP EN DE FR
2010-09-08
New Items
users online
Forum » Windower » Support » Definitions Help
Definitions Help
Offline
Posts: 428
By Selindrile 2016-05-26 15:00:00
Link | Quote | Reply
 
Editing Kinematics files, have been doing a lot to them as of late, am revamping the weather effects somewhat and running into an annoying situation, I need to be able to handle augmentable backs but the way he was handling them was just setting gear.name to a string held in a variable, I need to be able to also pass the augments table, can't get this to work, can anyone tell me where I'm going wrong?
Code
	if spell.element == world.weather_element or spell.element == world.day_element then
		gear.ElementalObi = {name="Hachirin-no-Obi"}
		gear.ElementalCape = {name="Twilight Cape"}
		
	else
		gear.ElementalObi = gear.default.obi_waist
		gear.ElementalCape = gear.default.obi_back
	end


and those default will have things in them such as:
Code
gear.nuke_jse_back = {name="Nantosuelta's Cape",augments={'INT+20','Mag. Acc+20 /Mag. Dmg.+20','"Mag.Atk.Bns."+10'}}
	gear.idle_jse_back = {name="Nantosuelta's Cape",augments={'HP+60','Eva.+20 /Mag. Eva.+20','Pet: "Regen"+9'}}
	
	gear.obi_cure_back = {name="Tempered Cape +1"}
	gear.obi_cure_waist = {name="Witful Belt"}

	gear.obi_low_nuke_back = gear.nuke_jse_back
	gear.obi_low_nuke_waist = {name="Sekhmet Corset"}

	gear.obi_high_nuke_back = gear.nuke_jse_back
	gear.obi_high_nuke_waist = {name="Yamabuki-no-Obi"}
 Ragnarok.Flippant
Offline
Server: Ragnarok
Game: FFXI
user: Enceladus
Posts: 658
By Ragnarok.Flippant 2016-05-26 15:40:35
Link | Quote | Reply
 
Tables get passed by reference. If you have variable1 = table1, then variable2 = variable1, variable2 is actually now just pointing to the place where table1 was put in memory. If you change table1 from variable1's reference point, variable2 will see those changes (and vice versa). But if you just point variable1 to a new table, variable2 doesn't care; it's still looking at table1.

In other words, you're pointing gear.ElementalCape to a new table, but sets.whateverSetYouUse.back is still pointing to the first table, which hasn't changed.

One solution may be to change the 'name' index (like Mote had it), then set an 'augments' index (you can '= nil' to remove it from the table when using Twilight Cape).
Offline
Posts: 428
By Selindrile 2016-05-28 01:01:08
Link | Quote | Reply
 
Thanks for the help, ended up just doing a workaround in post_midcast though as I couldn't get an index to work, since augments itself is a sub-table even.
Log in to post.