-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Sometimes you want to refer to a skill in a hyperlink to a nested tooltip e.g. [Stunned|Skill+stunned_effect]
. However, this requires you to manually type the name of the skill as the text i.e. Stunned
. If a mod or something changes the name of the actual stunned_effect
to something like Stupefied
then the hyperlink text doesn't know about this.
A proposal to make it possible to dynamically generate the text could be to add another flag for parseString such as [Obj/
. Any hyperlinks starting from this inside parseString will be parsed with a special system:
[Obj/Name/scripts/skills/effects/stunned_effect|Skill+stunned_effect]
- The
Obj/
starter tag tells the system that there is some script defined ahead. - The next
Name
tells which field of the script we want. - The next is the script path. This will be instantiated by the parser, and then
instance.m[field]
will be accessed and set as the text value wherefield
is what's given in point 2.
Perhaps this can be made even simpler for frequently used items:
[|SkillName+stunned_effect]
We pass an empty string as text and instead of Skill
we use SkillName
because Name is probably the most commonly accessed field for this purpose.
This also brings me to a second point:
Instead of using only filenames perhaps we should require entire script paths in the ExtraData. Because the curent system of only filename necessitates that two file names never match in the entire skills/
folder. Perhaps this is an unnecessary restriction and we can instead do: [Stunned|Skill+scripts/skills/effects/stunned_effect]
and that's fine?
In this case the above problem can be solved as:
[|SkillName+scripts/skills/effects/stunned_effect]