a good example of the talents whose IDs have colons are inscriptions
This makes addon developpings and debuggings involving these talents annoying. i.e. You can safely type game.player.T_RUSH, but something like game.player.T_INFUSION:_REGENERATION_2 is not going to work.
and I see no downsides of this, except for the efforts to do so.
Please Remove all Colons from Talent IDs
Moderator: Moderator
-
- Wyrmic
- Posts: 212
- Joined: Sat Sep 29, 2018 3:43 am
Re: Please Remove all Colons from Talent IDs
You can bypass it with square brackets instead of the . indexing of tables.
So game.player["T_INFUSION:_REGENERATION_2"] should work.
So game.player["T_INFUSION:_REGENERATION_2"] should work.
My feedback meter decays into coding. Give me feedback and I make mods.
-
- Wyrmic
- Posts: 212
- Joined: Sat Sep 29, 2018 3:43 am
Re: Please Remove all Colons from Talent IDs
yeah, this works, but what if I'm trying to build such a table in a data file? Using quotations in key seems not working, neither does using colons of course.
Re: Please Remove all Colons from Talent IDs
What are you trying to do that isn't working?
There is no reason that syntax would work in one place, but not in another.
There is no reason that syntax would work in one place, but not in another.
My feedback meter decays into coding. Give me feedback and I make mods.
-
- Wyrmic
- Posts: 212
- Joined: Sat Sep 29, 2018 3:43 am
Re: Please Remove all Colons from Talent IDs
I'm trying to write an addon and I want to import a table where some keys are talent IDs from a data file.
plus, when debugging, using [] won't give you auto-complete.
plus, when debugging, using [] won't give you auto-complete.
Re: Please Remove all Colons from Talent IDs
Subtly hinting that you should post the code that isn't working...
My feedback meter decays into coding. Give me feedback and I make mods.
-
- Sher'Tul Godslayer
- Posts: 2521
- Joined: Thu Jan 23, 2003 8:13 pm
- Location: A shallow water area south of Bree
- Contact:
Re: Please Remove all Colons from Talent IDs
The [] syntax can be used in table indexes too. For instance, here's a fragment from a talent point plan vault file generated by (and designed to be reloaded by) my Talent Point Planner addon:helminthauge wrote:I'm trying to write an addon and I want to import a table where some keys are talent IDs from a data file.
Code: Select all
wire_version = 3
talents = {
["T_VITALITY"] = 1,
["T_UNENDING_FRENZY"] = 5,
["T_WINDBLADE"] = 1,
["T_ACTIVATE_OBJECT_20"] = 1,
["T_ACTIVATE_OBJECT_14"] = 1,
["T_SECONDARY:_PAIN_SUPPRESSION_1"] = 1,
["T_LIGHT_ARMOUR_TRAINING"] = 1,
["T_QUICK_RECOVERY"] = 5,
"Blessed are the yeeks, for they shall inherit Arda..."
-
- Wyrmic
- Posts: 212
- Joined: Sat Sep 29, 2018 3:43 am
Re: Please Remove all Colons from Talent IDs
ok, thx Zizzo. seems I'd better actually go to learn Lua