- Feb 22, 2022
- 43
- 42
Hi!
I am stuck on this issue now for over a day. I am trying to create a way for me to dynamically create quests. For that, I use a widget
My issue is the following:
I want to use this array now in javascript to create a custom modal. I have created one that works when i put in the values manually.
What I can't figure out is how to connect the two, so that I can use something like this
to create the specific modal using the name I declared in the widget.
I hope my explanation made sense.
I am stuck on this issue now for over a day. I am trying to create a way for me to dynamically create quests. For that, I use a widget
Code:
<<widget "createQuest">>
<<set _questID = _args[0]>>
<<set _questName = _args[1]>>
<<set _questDescription = _args[2]>>
<<set _questMoneyReward = _args[3] || 0>>
<<set _questXPReward = _args[4] || 0>>
<<set _questConsequences = _args[5] || "N/A">>
<<set _questConditions = _args[6] || "N/A">>
<<set State.variables[_questID] = {
name: _questName,
description: _questDescription,
moneyReward: _questMoneyReward,
xpReward: _questXPReward,
consequences: _questConsequences,
conditions: _questConditions,
}>>
<<run $activeQuests.push(_name[])>>
<<print "Created Quest: " + JSON.stringify(State.variables[_name])>>
<<else>>
<<print "Quest with name '" + _name + "' already exists. Use a different name.">>
<</if>>
<</widget>>
I want to use this array now in javascript to create a custom modal. I have created one that works when i put in the values manually.
You don't have permission to view the spoiler content.
Log in or register now.
What I can't figure out is how to connect the two, so that I can use something like this
<<class "nameOfQuestionModal">><<link "He offers you a quest">>
<</link>><</class>>
to create the specific modal using the name I declared in the widget.
I hope my explanation made sense.