Definitions Help

Eorzea Time
 
 
 
言語: JP EN FR DE
日本語版のFFXIVPRO利用したい場合は、上記の"JP"を設定して、又はjp.ffxivpro.comを直接に利用してもいいです
users online
フォーラム » Windower » Support » Definitions Help
Definitions Help
Offline
Posts: 428
By Selindrile 2016-05-26 15:00:00  
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
サーバ: Ragnarok
Game: FFXI
user: Enceladus
Posts: 658
By Ragnarok.Flippant 2016-05-26 15:40:35  
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  
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.