"Down" Makes my Game Stop Working

At the beginning of my game you can only go down. I can type anything else and I will get the typical response to the command, but as soon as I type "down", nothing comes up. Then when I try typing something again, I can't even enter the command.


What happens if you move the player to the destination room in the editor, and then try to play the game? Is the problem with the down command or is it with entering the room?

What scripts do you have on the exit? And on the destination room?


I don't know, my game forever stays white when I move the player in the editor.


I'd usually guess that in that case, the exit script for the first room or the enter room for the one below are taking forever.
There's a lot of ways this can happen, some more obvious than others, and Quest isn't always the best language for figuring out why. I've had a fair few problems with that myself, usually turning out to be due to some typo. In the worst case, one took me two days to figure out what I'd done wrong.

Maybe someone can help you find the issue if you share the scripts that should be running at the point where it stops responding; or a link to the game.


<!--Saved by Quest 5.7.6404.16853-->
<asl version="550">
  <include ref="English.aslx" />
  <include ref="Core.aslx" />
  <game name="A Break From Bloodshed">
    <inherit name="theme_novella" />
    <gameid>4996880d-97f4-46da-b9f4-6e0d3539c85f</gameid>
    <version>1.0</version>
    <firstpublished>2017</firstpublished>
    <author>Brandon Michon-Cave</author>
    <category>Simulation</category>
    <description>An allied fighter pilot must survive on a South Pacific island after being shot down by a Japanese zero fighter during WWII.</description>
    <defaultfont>'Times New Roman', Times, serif</defaultfont>
    <menufont>Georgia, serif</menufont>
    <attr name="autodescription_youarein_useprefix" type="boolean">false</attr>
    <showborder type="boolean">false</showborder>
    <menuhoverbackground>LightSlateGray</menuhoverbackground>
    <setcustompadding />
    <autodisplayverbs type="boolean">false</autodisplayverbs>
    <autodescription />
    <echohyperlinks type="boolean">false</echohyperlinks>
    <showlocation type="boolean">false</showlocation>
    <appendobjectdescription />
    <enablehyperlinks type="boolean">false</enablehyperlinks>
    <attr name="autodescription_youcansee" type="int">3</attr>
    <attr name="autodescription_youcango" type="int">4</attr>
    <attr name="autodescription_description" type="int">2</attr>
    <showscore />
    <showhealth />
    <feature_limitinventory />
    <feature_lightdark />
    <feature_advancedscripts />
    <start type="script">
      set (Time, "minutes", 540)
      set (Cold, "value", 0)
      set (Hunger, "value", 0)
      set (Thirst, "value", 0)
      set (Sleep, "value", 0)
    </start>
    <unresolvedcommandhandler type="script">
    </unresolvedcommandhandler>
    <onhealthzero type="script">
      finish
      msg ("You have died.")
    </onhealthzero>
  </game>
  <verb>
    <property>exit</property>
    <pattern>exit</pattern>
    <defaultexpression>"You can't exit " + object.article + "."</defaultexpression>
  </verb>
  <verb>
    <property>follow</property>
    <pattern>follow</pattern>
    <defaultexpression>"You can't follow " + object.article + "."</defaultexpression>
  </verb>
  <verb>
    <property>enter</property>
    <pattern>enter</pattern>
    <defaultexpression>"You can't enter " + object.article + "."</defaultexpression>
  </verb>
  <object name="Time">
    <inherit name="editor_object" />
    <visible type="boolean">false</visible>
    <attr name="feature_startscript" type="boolean">false</attr>
    <usedefaultprefix type="boolean">false</usedefaultprefix>
    <drop type="boolean">false</drop>
  </object>
  <turnscript name="Time Movement">
    <enabled />
    <script>
      Time.minutes = Time.minutes + 12
      if (Time.minutes = 1440) {
        Time.minutes = 0
      }
    </script>
  </turnscript>
  <turnscript name="Hazard Effects">
    <enabled />
    <script>
      if (Cold.value = 100) {
        SetTurnTimeout (1) {
          Hunger.value = Hunger.value - 5
        }
      }
      if (Hunger.value = 100) {
        SetTurnTimeout (1) {
          DecreaseHealth (5)
        }
      }
      if (Thirst.value = 100) {
        SetTurnTimeout (1) {
          DecreaseHealth (5)
        }
      }
      if (Sleep.value = 100) {
        Time.minutes = Time.minutes + 240
        Sleep.value = Sleep.value - 50
        msg ("You fell asleep from exhaustion. You wake up some hours later still feeling tired.")
      }
    </script>
  </turnscript>
  <object name="ROOMS">
    <inherit name="editor_room" />
    <usedefaultprefix type="boolean">false</usedefaultprefix>
    <object name="Mountain Base">
      <inherit name="editor_room" />
      <alias>Mountain Base</alias>
      <usedefaultprefix type="boolean">false</usedefaultprefix>
      <objectslistprefix>You can see:</objectslistprefix>
      <firstenter type="script">
        msg ("You stop at the base of a mountain. Way upon it was where the smoke came from.")
      </firstenter>
      <beforefirstenter type="script">
        RandomObjectChance
      </beforefirstenter>
      <exit alias="west" to="Jungle">
        <inherit name="westdirection" />
      </exit>
    </object>
    <object name="Parachute Landing">
      <inherit name="editor_room" />
      <usedefaultprefix type="boolean">false</usedefaultprefix>
      <alias>Parachute Landing</alias>
      <objectslistprefix>You can see:</objectslistprefix>
      <firstenter type="script">
        msg ("You un-clip yourself from the parachute and land on the thick shrubs below. Smoke is visible in the distance above the trees.")
      </firstenter>
      <beforefirstenter type="script">
        RandomObjectChance
      </beforefirstenter>
      <object name="Caught Parachute">
        <alias>Caught Parachute</alias>
        <usedefaultprefix type="boolean">false</usedefaultprefix>
        <scenery />
        <description>You hear the sounds of lush forest life making a variety of noises. You open your eyes to see you have survived being shot down by a Japanese zero fighter. Your parachute hangs a few feet off the ground and sways from your movement.</description>
        <firstenter type="script">
        </firstenter>
        <exit alias="down" to="Parachute Landing">
          <inherit name="downdirection" />
          <visible />
          <scenery type="boolean">false</scenery>
        </exit>
        <object name="player">
          <inherit name="editor_object" />
          <inherit name="editor_player" />
        </object>
      </object>
      <object name="Smoke">
        <inherit name="editor_object" />
        <alias>Smoke</alias>
        <scenery />
        <drop type="boolean">false</drop>
        <follow type="script">
          MoveObject (player, Jungle)
        </follow>
      </object>
      <exit alias="east" to="Jungle">
        <inherit name="eastdirection" />
      </exit>
    </object>
    <object name="Crash Sight">
      <inherit name="editor_room" />
      <usedefaultprefix type="boolean">false</usedefaultprefix>
      <alias>Crash Sight</alias>
      <description type="string"></description>
      <objectslistprefix>You can see:</objectslistprefix>
      <firstenter type="script">
        msg ("The trees behind the plane are broken and clipped. One of the wings has been torn off and sits beside the plane, a few feet back.")
      </firstenter>
      <object name="P15D Mustang">
        <description type="string"></description>
        <usedefaultprefix type="boolean">false</usedefaultprefix>
        <scenery />
        <objectslistprefix>You can see:</objectslistprefix>
        <firstenter type="script">
          msg ("The windows are shattered into oblivion and pieces of metal fragmentation from the control panel lie about.")
        </firstenter>
        <exit alias="out" to="Crash Sight">
          <inherit name="outdirection" />
        </exit>
      </object>
      <exit alias="in" to="P15D Mustang">
        <inherit name="indirection" />
      </exit>
      <command name="Enter Mustang">
        <pattern>enter mustang; go in mustang; enter plane; go in plane; enter p15d; go in p15d; enter p15d mustang; go in p15d mustang</pattern>
        <script>
          MoveObject (player, P15D Mustang)
        </script>
      </command>
    </object>
    <object name="Jungle">
      <inherit name="editor_room" />
      <usedefaultprefix type="boolean">false</usedefaultprefix>
      <alias>Jungle</alias>
      <firstenter type="script">
        msg ("After 12 minutes of walking, the smoke subsides.Thankfully you took note of it's general location, way up on a mountain.")
      </firstenter>
      <beforefirstenter type="script">
        RandomObjectChance
      </beforefirstenter>
      <exit alias="west" to="Parachute Landing">
        <inherit name="westdirection" />
      </exit>
      <exit alias="east" to="Mountain Base">
        <inherit name="eastdirection" />
      </exit>
    </object>
  </object>
  <object name="OBJECTS">
    <inherit name="editor_room" />
    <object name="Sticks">
      <inherit name="editor_object" />
      <take />
      <attr name="feature_usegive" type="boolean">false</attr>
      <alt type="stringlist">
        <value>Stick</value>
      </alt>
      <usedefaultprefix type="boolean">false</usedefaultprefix>
    </object>
    <object name="Stones">
      <inherit name="editor_object" />
      <take />
      <alt type="stringlist">
        <value>Stone</value>
      </alt>
      <usedefaultprefix type="boolean">false</usedefaultprefix>
    </object>
    <object name="Shelter">
      <inherit name="editor_object" />
    </object>
    <object name="Cordage">
      <inherit name="editor_object" />
      <take />
      <usedefaultprefix type="boolean">false</usedefaultprefix>
    </object>
    <object name="Fire Pit">
      <inherit name="editor_object" />
    </object>
    <object name="Hatchet">
      <inherit name="editor_object" />
      <take />
    </object>
    <object name="Edged Stone">
      <inherit name="editor_object" />
      <take />
      <usedefaultprefix type="boolean">false</usedefaultprefix>
      <prefix>an</prefix>
    </object>
    <object name="Spear">
      <inherit name="editor_object" />
      <take />
    </object>
    <object name="Torch">
      <inherit name="editor_object" />
      <take />
    </object>
    <object name="Bow">
      <inherit name="editor_object" />
      <take />
      <attr name="feature_usegive" type="boolean">false</attr>
      <alias>Bow</alias>
      <feature_startscript />
      <use type="script">
        if () {
        }
      </use>
      <attr name="_initialise_" type="script">
        Bow.arrows = 0
      </attr>
    </object>
    <object name="Arrow">
      <inherit name="editor_object" />
      <take />
      <usedefaultprefix type="boolean">false</usedefaultprefix>
      <attr name="feature_usegive" type="boolean">false</attr>
      <prefix>an</prefix>
    </object>
    <object name="Backpack">
      <inherit name="editor_object" />
      <take />
    </object>
    <object name="Fishing Rod">
      <inherit name="editor_object" />
      <take />
    </object>
    <object name="Water Bucket">
      <inherit name="editor_object" />
      <take />
    </object>
    <object name="Water Collector">
      <inherit name="editor_object" />
    </object>
    <object name="Poncho">
      <inherit name="editor_object" />
      <inherit name="wearable" />
      <take />
      <feature_wearable />
      <attr name="wear_layer" type="int">1</attr>
      <wearmsg>You are now wearing the poncho.</wearmsg>
      <removemsg>You have taken off the poncho.</removemsg>
      <wear_slots type="stringlist">
        <value>Torso</value>
      </wear_slots>
    </object>
    <object name="Wrapping">
      <inherit name="editor_object" />
      <take />
    </object>
    <object name="Bandage">
      <inherit name="editor_object" />
      <take />
    </object>
    <object name="Noose Trap">
      <inherit name="editor_object" />
    </object>
    <object name="Cambium">
      <inherit name="editor_object" />
      <take />
      <usedefaultprefix type="boolean">false</usedefaultprefix>
    </object>
    <object name="Boar">
      <inherit name="editor_object" />
      <object name="Animal Skin">
        <inherit name="editor_object" />
      </object>
      <object name="Raw Boar Meat">
        <inherit name="editor_object" />
      </object>
    </object>
    <object name="Hide">
      <inherit name="editor_object" />
      <take />
      <usedefaultprefix type="boolean">false</usedefaultprefix>
    </object>
    <object name="Trees">
      <inherit name="editor_object" />
      <inherit name="surface" />
      <alt type="stringlist">
        <value>Tree</value>
      </alt>
      <usedefaultprefix type="boolean">false</usedefaultprefix>
      <feature_container />
      <hidechildren />
      <listchildren />
      <attr name="feature_startscript" type="boolean">false</attr>
      <take type="boolean">false</take>
      <attr name="_initialise_" type="script"><![CDATA[
        this.regrows_after_turns = 50
        this.regrow => {
          if (HasObject(this, "original_location")) {
            newstone = CloneObjectAndMove (this, this.original_location)
            newstone.turns_since_picked = null
          }
        }
      ]]></attr>
      <object name="Bark">
        <inherit name="editor_object" />
        <take />
        <usedefaultprefix type="boolean">false</usedefaultprefix>
      </object>
      <object name="Large Leaves">
        <inherit name="editor_object" />
        <take />
        <alt type="stringlist">
          <value>Large Leaf</value>
          <value>Leaf</value>
        </alt>
        <usedefaultprefix type="boolean">false</usedefaultprefix>
      </object>
      <object name="TreeLog">
        <inherit name="editor_object" />
        <alias>Log</alias>
        <usedefaultprefix />
      </object>
    </object>
    <object name="Sap Tree">
      <inherit name="editor_object" />
      <object name="Sap">
        <inherit name="editor_object" />
        <usedefaultprefix type="boolean">false</usedefaultprefix>
      </object>
    </object>
    <object name="Aloe Vera">
      <inherit name="editor_object" />
      <usedefaultprefix type="boolean">false</usedefaultprefix>
      <attr name="feature_usegive" type="boolean">false</attr>
      <feature_startscript />
      <take type="script">
        if (not HasInt(this, "turns_since_picked")) {
          this.turns_since_picked = 0
          this.original_location = this.parent
        }
        AddToInventory (this)
        msg ("You pick up some Aloe Vera.")
      </take>
      <ontake type="script">
      </ontake>
      <attr name="_initialise_" type="script"><![CDATA[
        this.regrows_after_turns = 3
        this.regrow => {
          if (HasObject(this, "original_location")) {
            newstone = CloneObjectAndMove (this, this.original_location)
            newstone.turns_since_picked = null
          }
        }
      ]]></attr>
    </object>
    <object name="Worm">
      <inherit name="editor_object" />
      <usedefaultprefix />
      <scenery />
      <feature_startscript />
      <take type="script">
        AddToInventory (this)
        msg ("You pick up some Aloe Vera.")
        if (not HasInt(this, "turns_since_picked")) {
          this.turns_since_picked = 0
          this.original_location = this.parent
        }
      </take>
      <attr name="_initialise_" type="script"><![CDATA[
        this.regrows_after_turns = 50
        this.regrow => {
          if (HasObject(this, "original_location")) {
            newstone = CloneObjectAndMove (this, this.original_location)
            newstone.turns_since_picked = null
          }
        }
      ]]></attr>
    </object>
    <object name="Thorn Bush">
      <inherit name="editor_object" />
      <take />
      <object name="Thorn">
        <inherit name="editor_object" />
        <take />
      </object>
    </object>
    <object name="Cooked Boar Meat">
      <inherit name="editor_object" />
    </object>
  </object>
  <object name="Cold">
    <inherit name="editor_object" />
  </object>
  <object name="Hunger">
    <inherit name="editor_object" />
  </object>
  <object name="Thirst">
    <inherit name="editor_object" />
  </object>
  <object name="Sleep">
    <inherit name="editor_object" />
  </object>
  <turnscript name="Hazards">
    <enabled />
    <script><![CDATA[
      if (Time.minutes > 1259) {
        if (Time.minutes < 540) {
          Cold.value = Cold.value + 5
        }
      }
      Hunger.value = Hunger.value + 0.5
      Thirst.value = Thirst.value + 1
      Sleep.value = Sleep.value + 1.3
    ]]></script>
  </turnscript>
  <command name="Kill Boar">
    <pattern>kill boar, attack boar, hunt boar, chase boar</pattern>
    <script><![CDATA[
      if (ListContains(ScopeReachable(), Boar)) {
        if (Got(Bow)) {
          if (Bow.arrows > 0) {
          }
        }
      }
    ]]></script>
  </command>
  <command name="Craft Arrow">
    <pattern>Craft Arrow</pattern>
    <script><![CDATA[
      Bow.arrows = Bow.arrows + 1
      if (Bow.arrows = 1) {
        msg ("You now have 1 arrow.")
      }
      if (Bow.arrows > 1) {
        msg ("You now have " + Bow.arrows + " arrows.")
      }
    ]]></script>
  </command>
  <command name="Craft Bow">
    <pattern>Craft Bow</pattern>
    <script>
      CloneObjectAndMove (Bow, player)
      msg ("You have crafted a bow.")
    </script>
  </command>
  <turnscript name="Regenerative">
    <script>
      foreach (object, AllObjects()) {
        if (HasInt(object, "turns_since_picked")) {
          object.turns_since_picked = object.turns_since_picked + 1
          if (object.turns_since_picked = object.regrows_after_turns) {
            do (object, "regrow")
          }
        }
      }
    </script>
  </turnscript>
  <function name="RandomObjectChance">
    while (RandomChance(50)) {
      CloneObjectAndMove (Large Leaves, player.parent)
    }
    while (RandomChance(50)) {
      CloneObjectAndMove (Stones, player.parent)
    }
    while (RandomChance(50)) {
      CloneObjectAndMove (Sticks, player.parent)
    }
    while (RandomChance(100)) {
      CloneObjectAndMove (Aloe Vera, player.parent)
    }
    while (RandomChance(10)) {
      CloneObjectAndMove (Sap Tree, player.parent)
    }
    if (RandomChance(10)) {
      CloneObjectAndMove (Boar, player.parent)
    }
    CloneObjectAndMove (Trees, player.parent)
    while (RandomChance(50)) {
      CloneObjectAndMove (Worm, player.parent)
    }
    while (RandomChance(10)) {
      CloneObjectAndMove (Thorn Bush, player.parent)
    }
  </function>
  <function name="ChanceToKillBoar">
  </function>
</asl>

I had that problem when I messed with the commands too much. Never write a command without an "if" first, you will destroy your entire game.

This is better on the online editor, where you can just add and delete things to a code freely without it being much of a big deal. Until your game decays like mine did. I don't even know the problem, the thing or the editor just remembers everything I typed. Only on that single game.


K.V.
 while (RandomChance(100)) {
   CloneObjectAndMove (Aloe Vera, player.parent)
 }

This is the problem.

It looks like you want the Aloe Vera to clone no matter what, so just lose the while on that one.


Here's the script for that function after I tampered with it:

RandomObjectChance

while (RandomChance(50)) {
  CloneObjectAndMove (Large Leaves, player.parent)
}
while (RandomChance(50)) {
  CloneObjectAndMove (Stones, player.parent)
}
while (RandomChance(50)) {
  CloneObjectAndMove (Sticks, player.parent)
}
// while (RandomChance(100)) {
  CloneObjectAndMove (Aloe Vera, player.parent)
  // }
while (RandomChance(10)) {
  CloneObjectAndMove (Sap Tree, player.parent)
}
if (RandomChance(10)) {
  CloneObjectAndMove (Boar, player.parent)
}
CloneObjectAndMove (Trees, player.parent)
while (RandomChance(50)) {
  CloneObjectAndMove (Worm, player.parent)
}
while (RandomChance(10)) {
  CloneObjectAndMove (Thorn Bush, player.parent)
}

K.V.

jmnevil54,

I initially thought it may be a command issue, too.

...but Quest apparently just doesn't like RandomChance(100).


K.V. you turned the while into notes?


K.V.

Just that one.

It was the cause of the freeze-up.

Caught Parachute
You hear the sounds of lush forest life making a variety of noises. You open your eyes to see you have survived being shot down by a Japanese zero fighter. Your parachute hangs a few feet off the ground and sways from your movement.
You can go down.

> d

Parachute Landing
You can see: Aloe Vera and Trees.
You can go east.
You un-clip yourself from the parachute and land on the thick shrubs below. Smoke is visible in the distance above the trees.


I just realized the RandomChance(100) may have been intended to be 10, and it's just a typo.

If that is the case, simply changing the 100 to 10 would be the proper fix.

At first, I assumed we just wanted a 100% chance of Aloe Vera being cloned.


K.V.

jmne,

I just commented out the top and bottom line:

// while (RandomChance(100)) {
  CloneObjectAndMove (Aloe Vera, player.parent)
  // }

It's the same things as this to Quest now:

 CloneObjectAndMove (Aloe Vera, player.parent)

I know.


K.V.
if (result = "I know.") {
  jmne.smart_cookie = true
}

Hah! You crack me up, K.V.


I deliberately made random chance 100 and did so only temporarily in order to test something out with Aloe Vera. Anyway, I've set it do that before and Quest was fine. Aloe Vera spawned in every room and nothing froze. Weird.


K.V.

I deliberately made random chance 100 and did so only temporarily in order to test something out with Aloe Vera.

That's what my instinct told me. It's when I start thinking: that's when I have problems! ha-ha!

I've set it do that before and Quest was fine.

It's the while. It works perfectly fine if you use if (RandomChance(100)).

... for some reason...

Oh!

While there is a random chance of 100% would be forever.


Oh, that's right. It only started happening after "while".


if (random chance (100)) {
}
That?


K.V.

jmne,

if (RandomChance(100)) {
  msg ("This works without a hitch.")
}
while (RandomChance(100)) {
  msg ("This is an infinite loop.")
}

While the random chance is successful, while keeps repeating itself as long as the random chance keeps succeeding. (I hope I said that correctly. mrangel just showed us this trick recently.)


just to repeat what KV said, in my own commenting/explanatory way:

RandomChance (100) = always successful/true

while (successful/true) {
-> do this
}
// if not-successful/not-true, do these next scripts here (or exit back to normal game play)

thus:

while (RandomChance (100)) {
-> this is done (looped) infinitely, but a computer's and/or quest's resources aren't infinite, and thus quest crashes ('infinite loop crash')
}


Description from an expert: Infinite object spawning = Quest blowing up!!!


Maybe not blowing up. But it keeps on adding one more, and doesn't show you the results until it's added an infinite number (which of course requires both a computer with infinite memory, and an infinite amount of time to finish)


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

Support

Forums