Use our Text to PDF Converter to effortlessly convert multiple text files into PDF format.
Advertisment
console.log(firstEvent.description[0]); firstEvent.options[0].option.forEach(opt => { console.log(`- ${opt.text[0]}`); });
parser.parseString(lifeData, (err, result) => { let playerStats = {}; result.lifeSelector.playerStats[0].stat.forEach(stat => { playerStats[stat.$.name] = parseInt(stat.$.initial); });
<chapter id="soldier"> <scene id="battle"> <description>War comes. Do you charge or wait?</description> <choiceList> <choice action="victoryEnding"> <text>Charge heroically. (Requires strength > 8)</text> <effect> <modify var="reputation" by="+50"/> <addInventory>Sword of Valor</addInventory> </effect> </choice> <choice action="deathEnding"> <text>Retreat and live as a deserter.</text> <effect> <modify var="reputation" by="-100"/> <gameOver reason="Cowardice" /> </effect> </choice> </choiceList> </scene> </chapter>
console.log(firstEvent.description[0]); firstEvent.options[0].option.forEach(opt => { console.log(`- ${opt.text[0]}`); });
parser.parseString(lifeData, (err, result) => { let playerStats = {}; result.lifeSelector.playerStats[0].stat.forEach(stat => { playerStats[stat.$.name] = parseInt(stat.$.initial); });
<chapter id="soldier"> <scene id="battle"> <description>War comes. Do you charge or wait?</description> <choiceList> <choice action="victoryEnding"> <text>Charge heroically. (Requires strength > 8)</text> <effect> <modify var="reputation" by="+50"/> <addInventory>Sword of Valor</addInventory> </effect> </choice> <choice action="deathEnding"> <text>Retreat and live as a deserter.</text> <effect> <modify var="reputation" by="-100"/> <gameOver reason="Cowardice" /> </effect> </choice> </choiceList> </scene> </chapter>