Evolution/Skill Tree/load/doc: Difference between revisions
From Portals of Phereon Wiki
Content added Content deleted
(Created page with "Pre-script preparation: Find \r\n and replace with (empty) in regex mode (text mode) Script operation: #Open web console #Set the file text, type and copy the text inside the single quotes for each skill tree #:<syntaxhighlight lang="javascript"> let skillText = { "Centaur": TEXT FROM SKILL FILE HERE, "PlantGirl": 'TEXT FROM SKILL FILE HERE', "Mermaid": 'TEXT FROM SKILL FILE HERE', "LavaGirl": 'TEXT FROM SKILL FILE HERE', "Lymean": 'TEXT FROM SKILL FILE HERE'...") |
mNo edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 9: | Line 9: | ||
let skillText = { |
let skillText = { |
||
"Centaur": TEXT FROM SKILL FILE HERE, |
"Centaur": TEXT FROM SKILL FILE HERE, |
||
"PlantGirl": |
"PlantGirl": TEXT FROM SKILL FILE HERE, |
||
"Mermaid": |
"Mermaid": TEXT FROM SKILL FILE HERE, |
||
"LavaGirl": |
"LavaGirl": TEXT FROM SKILL FILE HERE, |
||
"Lymean": |
"Lymean": TEXT FROM SKILL FILE HERE, |
||
"Succubus": |
"Succubus": TEXT FROM SKILL FILE HERE, |
||
"Harpy": |
"Harpy": TEXT FROM SKILL FILE HERE, |
||
"LizardGirl": |
"LizardGirl": TEXT FROM SKILL FILE HERE, |
||
"InsectGirl": |
"InsectGirl": TEXT FROM SKILL FILE HERE, |
||
"BeastGirl": |
"BeastGirl": TEXT FROM SKILL FILE HERE, |
||
"Shadow": |
"Shadow": TEXT FROM SKILL FILE HERE, |
||
"Tanid": |
"Tanid": TEXT FROM SKILL FILE HERE |
||
}; |
}; |
||
</syntaxhighlight> |
</syntaxhighlight> |
||
Line 39: | Line 39: | ||
return outObj; |
return outObj; |
||
} |
} |
||
json = JSON.parse(skillText); |
|||
for (const prop in skillText) { |
for (const prop in skillText) { |
||
if (skillText.hasOwnProperty(prop)) { |
if (skillText.hasOwnProperty(prop)) { |
||
Line 51: | Line 50: | ||
outputText; |
outputText; |
||
</syntaxhighlight> |
</syntaxhighlight> |
||
#Press copy button on the output string |
|||
#Replace all the text in Evolution/Skill_Tree/load with the output, remove any " before and after the output |
#Replace all the text in Evolution/Skill_Tree/load with the output, remove any " before and after the output |
Latest revision as of 07:32, 25 December 2021
Pre-script preparation:
Find \r\n and replace with (empty) in regex mode (text mode)
Script operation:
- Open web console
- Set the file text, type and copy the text inside the single quotes for each skill tree
let skillText = { "Centaur": TEXT FROM SKILL FILE HERE, "PlantGirl": TEXT FROM SKILL FILE HERE, "Mermaid": TEXT FROM SKILL FILE HERE, "LavaGirl": TEXT FROM SKILL FILE HERE, "Lymean": TEXT FROM SKILL FILE HERE, "Succubus": TEXT FROM SKILL FILE HERE, "Harpy": TEXT FROM SKILL FILE HERE, "LizardGirl": TEXT FROM SKILL FILE HERE, "InsectGirl": TEXT FROM SKILL FILE HERE, "BeastGirl": TEXT FROM SKILL FILE HERE, "Shadow": TEXT FROM SKILL FILE HERE, "Tanid": TEXT FROM SKILL FILE HERE };
- Run this script:
let json = {},outputText = ""; function createEntry(node) { let outObj = {}; outObj.name = node.name; outObj.count = node.amountPossible; outObj.costPrimary = node.pointCostPrimary; if (node.pointCostSecondary > 0) { outObj.costSecondary = node.pointCostSecondary; outObj.speciesSecondary = node.secondarySpeciesPoints; } outObj.type = node.nodeType; outObj.connectionRight = node.connectionRight; outObj.connectionBottom = node.connectionBottom; return outObj; } for (const prop in skillText) { if (skillText.hasOwnProperty(prop)) { for (var i = 0; i < skillText[prop].length; i++) { skillText[prop][i] = createEntry(skillText[prop][i]); } } } outputText += JSON.stringify(skillText); outputText += "{{Documentation}}"; outputText;
- Press copy button on the output string
- Replace all the text in Evolution/Skill_Tree/load with the output, remove any " before and after the output