Please Remove all Colons from Talent IDs

All new ideas for the upcoming releases of ToME 4.x.x should be discussed here

Moderator: Moderator

Post Reply
Message
Author
helminthauge
Wyrmic
Posts: 212
Joined: Sat Sep 29, 2018 3:43 am

Please Remove all Colons from Talent IDs

#1 Post by helminthauge »

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.

HousePet
Perspiring Physicist
Posts: 6215
Joined: Sun Sep 09, 2012 7:43 am

Re: Please Remove all Colons from Talent IDs

#2 Post by HousePet »

You can bypass it with square brackets instead of the . indexing of tables.

So game.player["T_INFUSION:_REGENERATION_2"] should work.
My feedback meter decays into coding. Give me feedback and I make mods.

helminthauge
Wyrmic
Posts: 212
Joined: Sat Sep 29, 2018 3:43 am

Re: Please Remove all Colons from Talent IDs

#3 Post by helminthauge »

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.

HousePet
Perspiring Physicist
Posts: 6215
Joined: Sun Sep 09, 2012 7:43 am

Re: Please Remove all Colons from Talent IDs

#4 Post by HousePet »

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.
My feedback meter decays into coding. Give me feedback and I make mods.

helminthauge
Wyrmic
Posts: 212
Joined: Sat Sep 29, 2018 3:43 am

Re: Please Remove all Colons from Talent IDs

#5 Post by helminthauge »

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.

HousePet
Perspiring Physicist
Posts: 6215
Joined: Sun Sep 09, 2012 7:43 am

Re: Please Remove all Colons from Talent IDs

#6 Post by HousePet »

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.

Zizzo
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

#7 Post by Zizzo »

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.
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:

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..."

helminthauge
Wyrmic
Posts: 212
Joined: Sat Sep 29, 2018 3:43 am

Re: Please Remove all Colons from Talent IDs

#8 Post by helminthauge »

ok, thx Zizzo. seems I'd better actually go to learn Lua

Post Reply