Hello there,
I’m creating a fan made Digimon visual novel, where your choices impact the type of Digimon you receive. I’m in the early testing stage where I’m seeing what’s possible. What I’m trying to figure out is how to compare multiple variables to see which is greatest and then return a different result. ChatGPT was no help and clearly doesn’t actually know how code works in Narrat. Here is the code it helped me to create:
if $virusPoints > $vaccinePoints && $virusPoints > $dataPoints && $virusPoints > $freePoints
set data.partnerType = “Virus”
“Your rebellious streak resonates strongest. A Virus-type Digimon will become your partner.”
if $vaccinePoints > $virusPoints && $vaccinePoints > $dataPoints && $vaccinePoints > $freePoints
set data.partnerType = “Vaccine”
“Your moral compass is clear. A Vaccine-type Digimon will become your partner.”
if $dataPoints > $virusPoints && $dataPoints > $vaccinePoints && $dataPoints > $freePoints
set data.partnerType = “Data”
“Your intellect leads the way. A Data-type Digimon will become your partner.”
if $freePoints > $virusPoints && $freePoints > $vaccinePoints && $freePoints > $dataPoints
set data.partnerType = “Free”
“You go with the flow. A Free-type Digimon will become your partner.”
else
“Your values are too balanced to choose one path just yet…”
Which technically works (it returns the right text when I run it) but I get multiple errors when I load the game (command if: expected 1 to 1 arguments but got 11, and command if: expected 2 to 2 arguments but got 3)
I’m confused what I’ve done wrong and why it’s still returning the right text.
Thanks,
Josh