new here. is it possible to make open "sandbox" type games with quest?

not sure if "sandbox" is the right word for it, but i mean a text-based game where there's no definitive end to the story and the character can just continue living day to day.

sorry it this is a dumb question. i'm really clueless at the moment about how to make games but i'm excited to learn.


The game can be as long as you are willing to write the story.

There are two games textadventure and gamebook.
Textadventure sounds more sandbox as the player can move as in a map, and the game does not stops until the game creator forces the player to lose the game if he does something stupid.

Gamebook is the simpler one and needs less coding or understanding, but it is what it is, a book, players just flip the pages until the game creator runs out of story to write. Even though this is simpler to make, it requires the game creator to be more hardworking to generate more story content or such.


Just make everything routine reactions and responses to characters and items, instead of a story, except maybe in the introduction to everything, where you'd use the script firsttime, and under firsttime you add an msg to read first time only.
Add timers with a clock that changes more quickly than realtime, and make time or clock a status attribute of player. Also timers can be used for variable weather patterns that affect anything or everything in the game. The if script is good for that. For instance if you create an attribute, maybe called weather, to an item that is present in the game, then change it from string to integer, you can associate different types of weather with different integers and change that integer every so often with a timer. If snow is what you want every time the attribute integer is = 3, then
If (anything.weather = 3) {
msg ("Look it 's snowing again. Let's make an igloo. ")
}
The if script with a msg can also be attached to an NPC object's verb for talk to. Different characters can also say different things at different times of day
If (game.time > 21 or game.time < 5) {
playsound (yawn.mp3, false, false)
msg ("It is too late to talk. Come back during daylight.")
If (game.weather = 1) {
msg ("Oh, well, at least it is nice outside, if there is no one to talk to here.")
}
else if (game.weather = 2){
playsound (raining.mp3, false , false)
msg ("Now, what?")
}
else {
msg ("And check the furnace. It must be broken.")
}
}

There are all kinds of scripts and activities you can add to make an open gameplay text adventure game. You can also add random events, and you can keep upgrading and improving the game after it is published. You just have to re-upload the changed game.
My games are basically open game play with some story.


K02e
Title: big forest
Description: simulation game
Purpose: free coding template by foxrain4

According to wikipedia:
Sandbox games are often associated with an open world concept which gives the players freedom of movement and progression in the game's world.

So maybe you are trying to make an open world game?

An advanced open world game example would be:
https://textadventures.co.uk/games/view/WyXV0Ib9JkOPQyzA1NHSww/infinite-maze-2021
Tutorial to learn how to build the advanced open world maze:
https://textadventures.co.uk/forum/quest/topic/igcf62bri0ovenfu0aapwg/how-to-create-infinite-maze
If you need help for infinite maze, you have to ask mrangel, it is too advanced for me.

Or perhaps you just want an easy to build open world game.
I have just the right code for you then, to copy and paste.

To copy this code:

  1. Startup your quest textadventure, on the right side of the big play button, you can see a code view button </>
  2. Copy my code to replace the code in the text box, click code view button again.
  3. Viola, it is done, press play button to test out the game and modify the code to your preference.
<!--Saved by Quest 5.8.6836.13983-->
<asl version="580">
  <include ref="English.aslx" />
  <include ref="Core.aslx" />
  <game name="test">
    <gameid>94709152-c03c-46b8-a33d-2296a9a21c0e</gameid>
    <version>1.0</version>
    <firstpublished>2024</firstpublished>
    <start type="script">
      player.lumber = 0
      player.water = 550
      player.petfood = 5550
      player.buildingmaterial = 550
      player.gold = 550
      player.chickenfarmgold = 0
      player.cowfarmgold = 0
      player.chickenfarm = 0
      player.cowfarm = 0
      player.angelpetlevel = 0
      player.dragonpetlevel = 0
      player.wolf = 0
      player.lavender = 0
    </start>
  </game>
  <object name="room">
    <inherit name="editor_room" />
    <isroom />
    <firstenter type="script">
      player.x = 0
      player.y = 0
    </firstenter>
    <enter type="script">
      msg ("X: "+player.x+" Y: "+player.y)
    </enter>
    <object name="player">
      <inherit name="editor_object" />
      <inherit name="editor_player" />
      <object name="axe">
        <inherit name="editor_object" />
        <drop />
        <displayverbs type="stringlist">
          <value>Take</value>
        </displayverbs>
        <inventoryverbs type="stringlist">
          <value>Drop</value>
        </inventoryverbs>
        <useit type="script">
          if (ListContains(ScopeVisible(), pine tree)) {
            RemoveObject (pine tree)
            player.lumber = player.lumber+50
            msg ("Lumber: "+player.lumber)
          }
        </useit>
        <take />
      </object>
      <object name="bucket">
        <inherit name="editor_object" />
        <drop />
        <displayverbs type="stringlist">
          <value>Take</value>
        </displayverbs>
        <inventoryverbs type="stringlist">
          <value>Drop</value>
        </inventoryverbs>
        <useit type="script">
          if (ListContains(ScopeVisible(), river)) {
            RemoveObject (river)
            player.water = player.water+50
            msg ("Water: "+player.water)
          }
        </useit>
        <take />
      </object>
      <object name="scythe">
        <inherit name="editor_object" />
        <drop />
        <displayverbs type="stringlist">
          <value>Take</value>
        </displayverbs>
        <inventoryverbs type="stringlist">
          <value>Drop</value>
        </inventoryverbs>
        <useit type="script">
          if (ListContains(ScopeVisible(), grass fields)) {
            RemoveObject (grass fields)
            player.petfood = player.petfood+50
            msg ("Pet food: "+player.petfood)
          }
        </useit>
        <take />
      </object>
      <object name="pickaxe">
        <inherit name="editor_object" />
        <drop />
        <displayverbs type="stringlist">
          <value>Take</value>
        </displayverbs>
        <inventoryverbs type="stringlist">
          <value>Drop</value>
        </inventoryverbs>
        <useit type="script">
          if (ListContains(ScopeVisible(), stones)) {
            RemoveObject (stones)
            player.buildingmaterial = player.buildingmaterial+50
            msg ("Building material: "+player.buildingmaterial)
          }
        </useit>
        <take />
      </object>
      <object name="stats">
        <inherit name="editor_object" />
        <useit type="script"><![CDATA[
          ClearScreen
          msg ("Screen have been cleared.")
          msg ("Lumber: "+player.lumber)
          msg ("Water: "+player.water)
          msg ("Pet food: "+player.petfood)
          msg ("Building material: "+player.buildingmaterial)
          msg ("Gold: "+player.gold)
          msg ("Chicken farm gold: "+player.chickenfarmgold)
          msg ("Cow farm gold: "+player.cowfarmgold)
          msg ("Chicken farms: "+player.chickenfarm)
          msg ("Cow farms: "+player.cowfarm)
          msg ("")
          msg ("Tutorial:<br/>Axe breaks pine trees.<br/>Bucket receives water.<br/>Scythe cuts grass.<br/>Pickaxe mines stones.")
        ]]></useit>
        <take />
        <displayverbs type="stringlist">
          <value>Take</value>
        </displayverbs>
        <inventoryverbs type="stringlist">
          <value>Drop</value>
        </inventoryverbs>
      </object>
    </object>
    <exit alias="east" to="room1">
      <inherit name="eastdirection" />
      <runscript />
      <script type="script">
        player.x = player.x+1
        msg ("X: "+player.x+" Y: "+player.y)
        all spawners
      </script>
    </exit>
    <exit alias="south" to="room2">
      <inherit name="southdirection" />
      <runscript />
      <script type="script">
        player.y = player.y-1
        msg ("X: "+player.x+" Y: "+player.y)
        all spawners
      </script>
    </exit>
    <exit alias="west" to="room3">
      <inherit name="westdirection" />
      <runscript />
      <script type="script">
        player.x = player.x-1
        msg ("X: "+player.x+" Y: "+player.y)
        all spawners
      </script>
    </exit>
    <exit alias="north" to="room4">
      <inherit name="northdirection" />
      <runscript />
      <script type="script">
        player.y = player.y+1
        msg ("X: "+player.x+" Y: "+player.y)
        all spawners
      </script>
    </exit>
  </object>
  <object name="room1">
    <inherit name="editor_room" />
    <exit alias="west" to="room">
      <inherit name="westdirection" />
    </exit>
  </object>
  <object name="room2">
    <inherit name="editor_room" />
    <exit alias="north" to="room">
      <inherit name="northdirection" />
    </exit>
  </object>
  <object name="room3">
    <inherit name="editor_room" />
    <exit alias="east" to="room">
      <inherit name="eastdirection" />
    </exit>
  </object>
  <object name="room4">
    <inherit name="editor_room" />
    <exit alias="south" to="room">
      <inherit name="southdirection" />
    </exit>
  </object>
  <object name="room holder">
    <inherit name="editor_room" />
    <object name="pine tree">
      <inherit name="editor_object" />
    </object>
    <object name="river">
      <inherit name="editor_object" />
    </object>
    <object name="grass fields">
      <inherit name="editor_object" />
    </object>
    <object name="stones">
      <inherit name="editor_object" />
    </object>
    <object name="peter">
      <inherit name="editor_object" />
      <buy1 type="string"></buy1>
      <displayverbs type="stringlist">
        <value>Look at</value>
      </displayverbs>
      <look><![CDATA[buy a: chicken farm<br/>cost: 50 lumber<br/><br/>buy b: cow farm<br/>cost: 50 lumber<br/>100 buildingmaterial]]></look>
      <buya type="script"><![CDATA[
        if (player.lumber>49) {
          msg ("Purchased succeeded.")
          player.lumber = player.lumber-50
          msg ("Lumber: "+player.lumber)
          MakeObjectVisible (chicken farm)
          AddToInventory (chicken farm)
          player.chickenfarm = player.chickenfarm+1
          msg ("Chicken farms: "+player.chickenfarm)
        }
        else {
          msg ("You do not have enough funds.")
        }
      ]]></buya>
      <buyb type="script"><![CDATA[
        if (player.buildingmaterial>99 and player.lumber>49) {
          msg ("Purchased succeeded.")
          player.lumber = player.lumber-50
          player.buildingmaterial = player.buildingmaterial-100
          msg ("Lumber: "+player.lumber)
          msg ("Building material: "+player.buildingmaterial)
          MakeObjectVisible (cow farm)
          AddToInventory (cow farm)
          player.cowfarm = player.cowfarm+1
          msg ("Cow farms: "+player.cowfarm)
        }
        else {
          msg ("You do not have enough funds.")
        }
      ]]></buyb>
    </object>
    <object name="mary">
      <inherit name="editor_object" />
      <displayverbs type="stringlist">
        <value>Look at</value>
      </displayverbs>
      <buyb type="script"><![CDATA[
        if (player.gold>149) {
          msg ("Purchased succeeded.")
          MakeObjectVisible (dragon pet)
          AddToInventory (dragon pet)
          player.gold = player.gold-150
          msg ("Gold: "+player.gold)
        }
        else {
          msg ("You do not have enough funds.")
        }
      ]]></buyb>
      <look><![CDATA[buy a: angel pet<br/>cost: 50 gold<br/><br/>buy b: dragon pet<br/>cost: 150 gold]]></look>
      <buya type="script"><![CDATA[
        if (player.gold>49) {
          msg ("Purchased succeeded.")
          MakeObjectVisible (angel pet)
          AddToInventory (angel pet)
          player.gold = player.gold-50
          msg ("Gold: "+player.gold)
        }
        else {
          msg ("You do not have enough funds.")
        }
      ]]></buya>
    </object>
    <object name="heather">
      <inherit name="editor_object" />
      <displayverbs type="stringlist">
        <value>Look at</value>
      </displayverbs>
      <look><![CDATA[buy a: jacket<br/>cost: 50 water<br/><br/>buy b: furniture<br/>cost: 50 buildingmaterial]]></look>
      <buya type="script"><![CDATA[
        if (player.water>49) {
          msg ("Purchased succeeded.")
          CloneObjectAndMove (jacket, player)
          player.water = player.water-50
          msg ("Water: "+player.water)
        }
        else {
          msg ("You do not have enough funds.")
        }
      ]]></buya>
      <buyb type="script"><![CDATA[
        if (player.buildingmaterial>49) {
          msg ("Purchased succeeded.")
          CloneObjectAndMove (furniture, player)
          player.buildingmaterial = player.buildingmaterial-50
          msg ("Building material: "+player.buildingmaterial)
        }
        else {
          msg ("You do not have enough funds.")
        }
      ]]></buyb>
    </object>
    <object name="sandman">
      <inherit name="editor_object" />
      <displayverbs type="stringlist">
        <value>Look at</value>
      </displayverbs>
      <look><![CDATA[buy a: build a bigger forest to attract wolves.<br/>cost: 50 lumber<br/><br/>buy b: build a bigger lake to encourage more lavender to grow.<br/>cost: 150 water<br/><br/>Reset all: This will remove all your purchased items from sandman.<br/>cost: free]]></look>
      <buya type="script"><![CDATA[
        if (player.lumber>49) {
          msg ("Purchased succeeded.")
          player.lumber = player.lumber-50
          msg ("Lumber: "+player.lumber)
          player.wolf = 1
        }
        else {
          msg ("You do not have enough funds.")
        }
      ]]></buya>
      <buyb type="script"><![CDATA[
        if (player.water>149) {
          msg ("Purchased succeeded.")
          player.water = player.water-50
          msg ("Water: "+player.water)
          player.lavender = 1
        }
        else {
          msg ("You do not have enough funds.")
        }
      ]]></buyb>
      <resetall type="script">
        player.wolf = 0
        player.lavender = 0
        msg ("Reset completed.")
      </resetall>
    </object>
    <object name="flower">
      <inherit name="editor_object" />
    </object>
    <object name="pathway">
      <inherit name="editor_object" />
    </object>
    <object name="cloud">
      <inherit name="editor_object" />
    </object>
    <object name="cave">
      <inherit name="editor_object" />
    </object>
    <object name="chicken farm">
      <inherit name="editor_object" />
      <take />
      <displayverbs type="stringlist">
        <value>Take</value>
      </displayverbs>
      <inventoryverbs type="stringlist">
        <value>Drop</value>
      </inventoryverbs>
      <useit type="script">
        player.gold = player.gold+player.chickenfarmgold
        player.chickenfarmgold = 0
        msg ("Gold: "+player.gold)
      </useit>
    </object>
    <object name="cow farm">
      <inherit name="editor_object" />
      <take />
      <displayverbs type="stringlist">
        <value>Take</value>
      </displayverbs>
      <inventoryverbs type="stringlist">
        <value>Drop</value>
      </inventoryverbs>
      <useit type="script">
        player.gold = player.gold+player.cowfarmgold
        player.cowfarmgold = 0
        msg ("Gold: "+player.gold)
      </useit>
    </object>
    <object name="angel pet">
      <inherit name="editor_object" />
      <take />
      <inventoryverbs type="stringlist">
        <value>Drop</value>
      </inventoryverbs>
      <displayverbs type="stringlist">
        <value>Take</value>
      </displayverbs>
      <feed type="script"><![CDATA[
        if (player.petfood>49) {
          player.petfood = player.petfood-50
          msg ("Pet food: "+player.petfood)
          if (RandomChance(50)) {
            msg ("Your pet has leveled up!")
            player.angelpetlevel = player.angelpetlevel+1
            angel pet.alias = "angel pet Lv. "+player.angelpetlevel
          }
          if (RandomChance(50)) {
            msg ("Your pet has leveled up!")
            player.angelpetlevel = player.angelpetlevel+1
            angel pet.alias = "angel pet Lv. "+player.angelpetlevel
          }
          if (RandomChance(50)) {
            msg ("Your pet has leveled up!")
            player.angelpetlevel = player.angelpetlevel+1
            angel pet.alias = "angel pet Lv. "+player.angelpetlevel
          }
          if (RandomChance(50)) {
            msg ("Your pet has leveled up!")
            player.angelpetlevel = player.angelpetlevel+1
            angel pet.alias = "angel pet Lv. "+player.angelpetlevel
          }
          if (RandomChance(50)) {
            msg ("Your pet has leveled up!")
            player.angelpetlevel = player.angelpetlevel+1
            angel pet.alias = "angel pet Lv. "+player.angelpetlevel
          }
        }
        else {
          msg ("You do not have enough funds.")
        }
      ]]></feed>
      <useit type="script">
        msg ("Your angel pet kindly brings you back to spawn point.")
        player.x = 0
        player.y = 0
        msg ("X: "+player.x+" Y: "+player.y)
        all spawners
      </useit>
      <levelinformation type="script"><![CDATA[
        msg ("At angel pet level 10 and above, you are more likely to see swans.<br/>This process is irreversible.")
      ]]></levelinformation>
    </object>
    <object name="dragon pet">
      <inherit name="editor_object" />
      <take />
      <displayverbs type="stringlist">
        <value>Take</value>
      </displayverbs>
      <inventoryverbs type="stringlist">
        <value>Drop</value>
      </inventoryverbs>
      <feed type="script"><![CDATA[
        if (player.petfood>49) {
          player.petfood = player.petfood-50
          msg ("Pet food: "+player.petfood)
          if (RandomChance(50)) {
            msg ("Your pet has leveled up!")
            player.dragonpetlevel = player.dragonpetlevel+1
            dragon pet.alias = "dragon pet Lv. "+player.dragonpetlevel
          }
          if (RandomChance(50)) {
            msg ("Your pet has leveled up!")
            player.dragonpetlevel = player.dragonpetlevel+1
            dragon pet.alias = "dragon pet Lv. "+player.dragonpetlevel
          }
          if (RandomChance(50)) {
            msg ("Your pet has leveled up!")
            player.dragonpetlevel = player.dragonpetlevel+1
            dragon pet.alias = "dragon pet Lv. "+player.dragonpetlevel
          }
          if (RandomChance(50)) {
            msg ("Your pet has leveled up!")
            player.dragonpetlevel = player.dragonpetlevel+1
            dragon pet.alias = "dragon pet Lv. "+player.dragonpetlevel
          }
          if (RandomChance(50)) {
            msg ("Your pet has leveled up!")
            player.dragonpetlevel = player.dragonpetlevel+1
            dragon pet.alias = "dragon pet Lv. "+player.dragonpetlevel
          }
        }
        else {
          msg ("You do not have enough funds.")
        }
      ]]></feed>
      <useit type="script">
        msg ("Your dragon pet has gone crazy and flies you to a random area.")
        x = GetRandomInt(-1000,1000)
        y = GetRandomInt(-1000,1000)
        player.x = x
        player.y = y
        msg ("X: "+player.x+" Y: "+player.y)
        all spawners
      </useit>
      <levelinformation type="script"><![CDATA[
        msg ("At dragon pet level 10 and above, you are more likely to see lizards.<br/>This process is irreversible.")
      ]]></levelinformation>
    </object>
    <object name="jacket">
      <inherit name="editor_object" />
      <changename type="script">
        msg ("Type in the new name for this object into the text bar.")
        get input {
          this.alias = ""+ result
        }
      </changename>
      <take />
      <destroy type="script">
        msg ("Item have been destroyed.")
        RemoveObject (this)
      </destroy>
      <displayverbs type="stringlist">
        <value>Take</value>
      </displayverbs>
      <inventoryverbs type="stringlist">
        <value>Drop</value>
      </inventoryverbs>
    </object>
    <object name="furniture">
      <inherit name="editor_object" />
      <changename type="script">
        msg ("Type in the new name for this object into the text bar.")
        get input {
          this.alias = ""+ result
        }
      </changename>
      <take />
      <destroy type="script">
        msg ("Item have been destroyed.")
        RemoveObject (this)
      </destroy>
      <displayverbs type="stringlist">
        <value>Take</value>
      </displayverbs>
      <inventoryverbs type="stringlist">
        <value>Drop</value>
      </inventoryverbs>
    </object>
    <object name="wolf">
      <inherit name="editor_object" />
    </object>
    <object name="lavender">
      <inherit name="editor_object" />
    </object>
    <object name="lizard">
      <inherit name="editor_object" />
    </object>
    <object name="swan">
      <inherit name="editor_object" />
    </object>
  </object>
  <verb>
    <property>useit</property>
    <pattern>use it</pattern>
    <defaultexpression>"You can't use it " + object.article + "."</defaultexpression>
  </verb>
  <verb>
    <property>buya</property>
    <pattern>buy a</pattern>
    <defaultexpression>"You can't buy a " + object.article + "."</defaultexpression>
  </verb>
  <verb>
    <property>buyb</property>
    <pattern>buy b</pattern>
    <defaultexpression>"You can't buy b " + object.article + "."</defaultexpression>
  </verb>
  <verb>
    <property>feed</property>
    <pattern>feed</pattern>
    <defaultexpression>"You can't feed " + object.article + "."</defaultexpression>
  </verb>
  <verb>
    <property>changename</property>
    <pattern>change name</pattern>
    <defaultexpression>"You can't change name " + object.article + "."</defaultexpression>
  </verb>
  <verb>
    <property>resetall</property>
    <pattern>reset all</pattern>
    <defaultexpression>"You can't reset all " + object.article + "."</defaultexpression>
  </verb>
  <verb>
    <property>destroy</property>
    <pattern>destroy</pattern>
    <defaultexpression>"You can't destroy " + object.article + "."</defaultexpression>
  </verb>
  <verb>
    <property>levelinformation</property>
    <pattern>level information</pattern>
    <defaultexpression>"You can't level information " + object.article + "."</defaultexpression>
  </verb>
  <function name="scenery spawner"><![CDATA[
    if (player.x>0) {
      if (RandomChance(20)) {
        MoveObjectHere (pine tree)
        MakeObjectVisible (pine tree)
      }
    }
    if (player.x<0) {
      if (RandomChance(20)) {
        MoveObjectHere (river)
        MakeObjectVisible (river)
      }
    }
    if (player.y>0) {
      if (RandomChance(20)) {
        MoveObjectHere (grass fields)
        MakeObjectVisible (grass fields)
      }
    }
    if (player.y<0) {
      if (RandomChance(20)) {
        MoveObjectHere (stones)
        MakeObjectVisible (stones)
      }
    }
  ]]></function>
  <function name="npc spawner">
    if (RandomChance(20)) {
      MoveObjectHere (peter)
      MakeObjectVisible (peter)
    }
    if (RandomChance(20)) {
      MoveObjectHere (mary)
      MakeObjectVisible (mary)
    }
    if (RandomChance(20)) {
      MoveObjectHere (heather)
      MakeObjectVisible (heather)
    }
    if (RandomChance(20)) {
      MoveObjectHere (sandman)
      MakeObjectVisible (sandman)
    }
  </function>
  <function name="scenery2 spawner"><![CDATA[
    if (RandomChance(20)) {
      MoveObjectHere (flower)
      MakeObjectVisible (flower)
    }
    if (RandomChance(20)) {
      MoveObjectHere (pathway)
      MakeObjectVisible (pathway)
    }
    if (RandomChance(20)) {
      MoveObjectHere (cloud)
      MakeObjectVisible (cloud)
    }
    if (RandomChance(20)) {
      MoveObjectHere (cave)
      MakeObjectVisible (cave)
    }
    if (player.wolf=1) {
      if (RandomChance(20)) {
        MoveObjectHere (wolf)
        MakeObjectVisible (wolf)
      }
    }
    if (player.lavender=1) {
      if (RandomChance(20)) {
        MoveObjectHere (lavender)
        MakeObjectVisible (lavender)
      }
    }
    if (player.angelpetlevel>9) {
      if (RandomChance(20)) {
        MoveObjectHere (swan)
        MakeObjectVisible (swan)
      }
    }
    if (player.dragonpetlevel>9) {
      if (RandomChance(20)) {
        MoveObjectHere (lizard)
        MakeObjectVisible (lizard)
      }
    }
  ]]></function>
  <function name="all spawners">
    object deleter
    scenery spawner
    npc spawner
    scenery2 spawner
  </function>
  <function name="object deleter">
    RemoveObject (pine tree)
    RemoveObject (river)
    RemoveObject (grass fields)
    RemoveObject (stones)
    RemoveObject (peter)
    RemoveObject (mary)
    RemoveObject (heather)
    RemoveObject (sandman)
    RemoveObject (flower)
    RemoveObject (pathway)
    RemoveObject (cloud)
    RemoveObject (cave)
    RemoveObject (wolf)
    RemoveObject (lavender)
    RemoveObject (lizard)
    RemoveObject (swan)
  </function>
  <timer name="farms">
    <interval>10</interval>
    <enabled />
    <script>
      player.chickenfarmgold = player.chickenfarmgold+10*player.chickenfarm
      player.cowfarmgold = player.cowfarmgold+30*player.cowfarm
    </script>
  </timer>
</asl>

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

Support

Forums