Error running script: Unable to cast object of type 'TextAdventures.Quest.Element' to type 'System.String'.

Hello, i am trying to make an rpg style adventure but i'm struggling with even getting the character creation to start.
Every time i go to play, it has this:

You are in a room.
Error running script: Unable to cast object of type 'TextAdventures.Quest.Element' to type 'System.String'.

heres the code:

``` ```

 <!--Saved by Quest 5.7.6404.15496-->
<asl version="550">
  <include ref="English.aslx" />
  <include ref="Core.aslx" />
  <game name="Wish Fur More">
    <gameid>6fee891e-7d0c-44a3-878e-eabe2c84f2a0</gameid>
    <version>1.0</version>
    <firstpublished>2017</firstpublished>
    <cover>small tiz gift.png</cover>
    <start type="script">
    </start>
    <povstatusattributes type="stringdictionary" />
    <pov type="object">player</pov>
    <gridmap type="boolean">false</gridmap>
    <statusandcompassattop type="boolean">false</statusandcompassattop>
    <customstatuspane type="boolean">false</customstatuspane>
    <commandpane type="boolean">false</commandpane>
    <roomenter type="script">
      characterselect
    </roomenter>
    <showpanes type="boolean">false</showpanes>
    <showhealth />
  </game>
  <object name="room">
    <inherit name="editor_room" />
    <dropdestination type="object">room</dropdestination>
    <object name="player">
      <inherit name="editor_object" />
      <inherit name="editor_player" />
    </object>
  </object>
  <object name="Characters">
    <inherit name="editor_room" />
    <object name="Mage">
      <inherit name="editor_object" />
      <inherit name="editor_player" />
      <inherit name="characterclass" />
      <feature_player />
      <class>Mage</class>
      <maxhealth type="int">20</maxhealth>
      <health type="int">10</health>
      <statusattributes type="stringdictionary">
        <item>
          <key>HP</key>
          <value></value>
        </item>
        <item>
          <key>Armor</key>
          <value></value>
        </item>
        <item>
          <key>STR</key>
          <value></value>
        </item>
        <item>
          <key>DEX</key>
          <value></value>
        </item>
        <item>
          <key>INT</key>
          <value></value>
        </item>
        <item>
          <key>Equipment</key>
          <value></value>
        </item>
      </statusattributes>
      <Equipment type="object">Staff</Equipment>
    </object>
    <object name="Rogue">
      <inherit name="editor_object" />
      <inherit name="editor_player" />
      <inherit name="characterclass" />
      <feature_player />
      <class>Rogue</class>
      <maxhealth type="int">25</maxhealth>
      <health type="int">20</health>
      <statusattributes type="stringdictionary">
        <item>
          <key>HP</key>
          <value></value>
        </item>
        <item>
          <key>Armor</key>
          <value></value>
        </item>
        <item>
          <key>STR</key>
          <value></value>
        </item>
        <item>
          <key>DEX</key>
          <value></value>
        </item>
        <item>
          <key>INT</key>
          <value></value>
        </item>
        <item>
          <key>Equipment</key>
          <value></value>
        </item>
      </statusattributes>
      <Equipment type="object">Dagger</Equipment>
    </object>
    <object name="Ranger">
      <inherit name="editor_object" />
      <inherit name="editor_player" />
      <inherit name="characterclass" />
      <feature_player />
      <class>Ranger</class>
      <maxhealth type="int">30</maxhealth>
      <health type="int">25</health>
      <statusattributes type="stringdictionary">
        <item>
          <key>HP</key>
          <value></value>
        </item>
        <item>
          <key>Armor</key>
          <value></value>
        </item>
        <item>
          <key>STR</key>
          <value></value>
        </item>
        <item>
          <key>DEX</key>
          <value></value>
        </item>
        <item>
          <key>INT</key>
          <value></value>
        </item>
        <item>
          <key>Equipment</key>
          <value></value>
        </item>
      </statusattributes>
      <Equipment type="object">Bow</Equipment>
    </object>
    <object name="Fighter">
      <inherit name="editor_object" />
      <inherit name="editor_player" />
      <inherit name="characterclass" />
      <feature_player />
      <class>Fighter</class>
      <maxhealth type="int">40</maxhealth>
      <health type="int">30</health>
      <statusattributes type="stringdictionary">
        <item>
          <key>HP</key>
          <value></value>
        </item>
        <item>
          <key>Armor</key>
          <value></value>
        </item>
        <item>
          <key>STR</key>
          <value></value>
        </item>
        <item>
          <key>DEX</key>
          <value></value>
        </item>
        <item>
          <key>INT</key>
          <value></value>
        </item>
        <item>
          <key>Equipment</key>
          <value></value>
        </item>
      </statusattributes>
      <Equipment type="object">Sword</Equipment>
    </object>
    <object name="Healer">
      <inherit name="editor_object" />
      <inherit name="editor_player" />
      <inherit name="characterclass" />
      <feature_player />
      <class>Healer</class>
      <maxhealth type="int">15</maxhealth>
      <health type="int">10</health>
      <statusattributes type="stringdictionary">
        <item>
          <key>HP</key>
          <value></value>
        </item>
        <item>
          <key>Armor</key>
          <value></value>
        </item>
        <item>
          <key>STR</key>
          <value></value>
        </item>
        <item>
          <key>DEX</key>
          <value></value>
        </item>
        <item>
          <key>INT</key>
          <value></value>
        </item>
        <item>
          <key>Equipment</key>
          <value></value>
        </item>
      </statusattributes>
      <visible type="boolean">false</visible>
      <Equipment type="object">Talisman</Equipment>
    </object>
  </object>
  <object name="Weapons">
    <inherit name="editor_room" />
    <object name="Sword">
      <inherit name="editor_object" />
      <inherit name="weapontype" />
    </object>
    <object name="Staff">
      <inherit name="editor_object" />
      <inherit name="weapontype" />
    </object>
    <object name="Dagger">
      <inherit name="editor_object" />
      <inherit name="weapontype" />
    </object>
    <object name="Bow">
      <inherit name="editor_object" />
      <inherit name="weapontype" />
    </object>
    <object name="Talisman">
      <inherit name="editor_object" />
      <inherit name="weapontype" />
      <inherit name="healthitem" />
    </object>
  </object>
  <object name="Basic_Items">
    <inherit name="editor_room" />
  </object>
  <object name="Health_Items">
    <inherit name="editor_room" />
    <object name="potion_L_cure">
      <inherit name="editor_object" />
      <inherit name="healthitem" />
    </object>
    <object name="potion_M_cure">
      <inherit name="editor_object" />
      <inherit name="healthitem" />
    </object>
    <object name="potion_C_cure">
      <inherit name="editor_object" />
      <inherit name="healthitem" />
    </object>
  </object>
  <object name="Armor">
    <inherit name="editor_room" />
    <object name="robes">
      <inherit name="editor_object" />
      <inherit name="armortype" />
    </object>
    <object name="leather">
      <inherit name="editor_object" />
      <inherit name="armortype" />
    </object>
    <object name="lightchainmail">
      <inherit name="editor_object" />
      <inherit name="armortype" />
      <scenery />
    </object>
    <object name="heavyplatemail">
      <inherit name="editor_object" />
      <inherit name="armortype" />
      <scenery />
    </object>
  </object>
  <object name="Dark Cell">
    <inherit name="editor_room" />
  </object>
  <object name="Character Setup">
    <inherit name="editor_room" />
  </object>
  <type name="characterclass">
    <HP type="string"></HP>
    <Armor type="int">0</Armor>
    <STR type="int">0</STR>
    <DEX type="int">0</DEX>
    <INT type="int">0</INT>
    <health type="int">0</health>
    <maxhealth type="int">0</maxhealth>
    <class type="string"></class>
    <points type="int">10</points>
    <Libido type="int">0</Libido>
    <Equipment type="object">player</Equipment>
  </type>
  <type name="weapontype" />
  <type name="healthitem" />
  <type name="armortype" />
  <type name="itemdata" />
  <function name="characterselect"><![CDATA[
    charactermenu = NewStringList()
    list add (charactermenu, Mage)
    list add (charactermenu, Rogue)
    list add (charactermenu, Ranger)
    list add (charactermenu, Fighter)
    list add (charactermenu, Healer)
    ShowMenu ("Select Character", charactermenu, true) {
      char = "result"
      msg ("You Choose "+char+".")
      if (result <> null) {
        if (char ="Mage") {
          Ask ("So you are a \"+char+\"") {
            if (result = True) {
              ChangePOV (Mage)
              ClearScreen
              MoveObject (game pov, Character_Setup)
              game.pov.hp = ""+game.pov.health+ " / " +game.pov.maxhealth+ ""
              namingcharacter
            }
            else if (result = False) {
              characterselect
            }
          }
        }
        else if (char ="Rogue") {
          Ask ("So you are a \"+char+\"") {
            if (result = True) {
              ChangePOV (Mage)
              ClearScreen
              MoveObject (game pov, Character_Setup)
              game.pov.hp = ""+game.pov.health+ " / " +game.pov.maxhealth+ ""
              namingcharacter
            }
            else if (result = False) {
              characterselect
            }
          }
        }
        else if (char ="Ranger") {
          Ask ("So you are a \"+char+\"") {
            if (result = True) {
              ChangePOV (Mage)
              ClearScreen
              MoveObject (game pov, Character_Setup)
              game.pov.hp = ""+game.pov.health+ " / " +game.pov.maxhealth+ ""
              namingcharacter
            }
            else if (result = False) {
              characterselect
            }
          }
        }
        else if (char ="Fighter") {
          Ask ("So you are a \"+char+\"") {
            if (result = True) {
              ChangePOV (Mage)
              ClearScreen
              MoveObject (game pov, Character_Setup)
              game.pov.hp = ""+game.pov.health+ " / " +game.pov.maxhealth+ ""
              namingcharacter
            }
            else if (result = False) {
              characterselect
            }
          }
        }
        else if (char ="Healer") {
          Ask ("So you are a \"+char+\"") {
            if (result = True) {
              ChangePOV (Mage)
              ClearScreen
              MoveObject (game pov, Character_Setup)
              game.pov.hp = ""+game.pov.health+ " / " +game.pov.maxhealth+ ""
              namingcharacter
            }
            else if (result = False) {
              characterselect
            }
          }
        }
      }
      else {
        msg ("You cancled... ")
      }
    }
  ]]></function>
  <function name="namingcharacter">
  </function>
  <function name="choosinggender">
  </function>
  <function name="choosingrace">
  </function>
  <function name="assignpoints">
  </function>
</asl>   

  charactermenu = NewStringList()
    list add (charactermenu, Mage)
    list add (charactermenu, Rogue)
    list add (charactermenu, Ranger)
    list add (charactermenu, Fighter)
    list add (charactermenu, Healer)

charactermenu is a string list but you are trying to add objects to it. Try

  charactermenu = NewStringList()
    list add (charactermenu, "Mage")
    list add (charactermenu, "Rogue")
    list add (charactermenu, "Ranger")
    list add (charactermenu, "Fighter")
    list add (charactermenu, "Healer")

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums