Exit Question ^_^ [Solved]

I have a quick exit question and would like to know if I can make it a Function.

I have a giant if-script that runs if the player tries to move toward their next destination while it's night-time---and naturally it is connected to the exits of my rooms. But I was wondering, if I have this script attached to the "exit object" (aka Exit: RoomNameHere), can I instead change the code to this...

MoveObject (player, this)?

Instead of...

MoveObject (player, RoomNameHere)

Since it's on the exit? If so, I can make this if-script a Function---which I would rather do so it won't bloat my game's size. Any thoughts? Opinions?

I appreciate all of your time as well! Thank you in advance!

Anonynn.


I don't know how Exits work, if they're any different from Objects or not.

as for making an Object's Script Attribute into a Function, you certainly can, as both of these are containers for scripting:

from this:

<object name="test_1_object">
  <attr name="score_integer_attribute" type="int">-1</attr> // this is just a default value, we'd likely have some way of producing an actual score value, hopefully, obviously
  <attr name="grade_string_attribute" type="string">unknown</attr> // this is jsut a default value, the 'set_grade_script_attribute' will produce an actual grade
  <attr name="set_grade_script_attribute" type="script">
    if (this.score_integer_attribute > 89) {
      this.grade_string_attribute = "A"
    } else if (this.score_integer_attribute > 79) {
      this.grade_string_attribute = "B"
    } else if (this.score_integer_attribute > 69) {
      this.grade_string_attribute = "C"
    } else if (this.score_integer_attribute > 59) {
      this.grade_string_attribute = "D"
    } else {
      this.grade_string_attribute = "F"
    }
  </attr>
</object>

<object name="test_2_object">
  <attr name="score_integer_attribute" type="int">-1</attr>  // this is just a default value, we'd likely have some way of producing an actual score value, hopefully, obviously
  <attr name="grade_string_attribute" type="string">unknown</attr> // this is jsut a default value, the 'set_grade_script_attribute' will produce an actual grade
  <attr name="set_grade_script_attribute" type="script">
    if (this.score_integer_attribute > 89) {
      this.grade_string_attribute = "A"
    } else if (this.score_integer_attribute > 79) {
      this.grade_string_attribute = "B"
    } else if (this.score_integer_attribute > 69) {
      this.grade_string_attribute = "C"
    } else if (this.score_integer_attribute > 59) {
      this.grade_string_attribute = "D"
    } else {
      this.grade_string_attribute = "F"
    }
  </attr>
</object>

// to this (a very dynamic/general/universal/advanced/powerful/useful example):
// (I can craft code for a more specific usage, and thus a much more simple code design)

<object name="test_1_object">
  <attr name="score_integer_attribute" type="int">-1</attr> // this is just a default value, we'd likely have some way of producing an actual score value, hopefully, obviously
  <attr name="grade_string_attribute" type="string">unknown</attr> // this is jsut a default value, the 'set_grade_script_attribute' will produce an actual grade
  <attr name="set_grade_script_attribute" type="script">
    set_grade_function (this, "score_integer_attribute", "grade_string_attribute")
  </attr>
</object>

<object name="test_2_object">
  <attr name="score_integer_attribute" type="int">-1</attr>  // this is just a default value, we'd likely have some way of producing an actual score value, hopefully, obviously
  <attr name="grade_string_attribute" type="string">unknown</attr> // this is jsut a default value, the 'set_grade_script_attribute' will produce an actual grade
  <attr name="set_grade_script_attribute" type="script">
    set_grade_function (this, "score_integer_attribute", "grade_string_attribute")
  </attr>
</object>

<function name="set_grade_function" parameters="name_of_object_parameter, name_of_score_integer_attribute_parameter, name_of_grade_string_attribute_parameter">
    if (GetInt (name_of_object_parameter, name_of_score_integer_attribute_parameter) > 89) {
      set (name_of_object_parameter, name_of_grade_string_attribute_parameter, "A")
    } else if (GetInt (name_of_object_parameter, name_of_score_integer_attribute_parameter) > 79) {
      set (name_of_object_parameter, name_of_grade_string_attribute_parameter, "B")
    } else if (GetInt (name_of_object_parameter, name_of_score_integer_attribute_parameter) > 69) {
      set (name_of_object_parameter, name_of_grade_string_attribute_parameter, "C")
    } else if (GetInt (name_of_object_parameter, name_of_score_integer_attribute_parameter) > 59) {
      set (name_of_object_parameter, name_of_grade_string_attribute_parameter, "D")
    } else {
      set (name_of_object_parameter, name_of_grade_string_attribute_parameter, "F")
    }
  </attr>
</function

and instead of using a Function... there are Delegates (letting you use just the Script Attributes, but along with the 'delegate' usage, you can give your Script Attributes 'arguments/parameters' and/or a 'return type', just as if it were a Function. Though, I think learning/understanding Delegates is more difficult than using Functions, but if you're interested we can work on learning Delegate+Script_Attribute usage.


I think you want this:

MoveObject (player, this.to)?

The "to" attribute of the exit is its destination, so you want the player to go there. Alternatively:

player.parent = this.to

Thanks Pix!

Haha turns out it's pretty simple, HK! I didn't know if they were considered their own objects either! xD


well, if you ever need complexity over simplicity (upside down world of anti-Occum's Razor, you know who's posts to look at, lol)

if my Function works, it allows for you to provide it with any Object and two Attributes (some slight modification of it is needed for whatever the specific need/use of it, of course)


So I tried testing MoveObject (player, this.to) on the Exit and got this error.
Error running script: Error compiling expression 'this.to': Unknown object or variable 'this'

I'll try the other way next.
player.parent = this.to

Unfortunately, that didn't work either. Here is the script thus far if it helps. It's not finished yet. Everything seems to be working but the moving mechanic I need. Oh, this is a Function as well.

if (game.ndcycle<=2) {
  game.ndcycle = game.ndcycle + 1
}
else {
  msg ("<br/>It's a little late to travel. {once:Doing so could result in losing health, getting lost, stumbling upon enemies, falling into traps, or a combination of the two (this is especially dangerous during rain, or a storm).} Do you still want to try? {once:If so, you might want to switch on a light first if you have one!} Do anything to cancel.)<br/>")
  menulist = Split("Yes, Travel Anyway;No, Stay Put", ";")
  ShowMenu ("", menulist, true) {
    if (result = "Yes, Travel Anyway") {
      ClearScreen
      if (IsSwitchedOn(old_lantern)) {
        msg ("<br/>You ultimately decide that foregoing sleep and traveling at night{if game.rain=True: through the rain}{if game.storm=True: through the thunderous storm} to gain some extra miles in your journey is worth the risk of potentially stumbling into any unseen dangers and pitfalls. You aren't sure what the fates have in store for you, but given your decision, you resolve to be extra careful tonight. You begin to ready yourself; you gather up and secure all your belongings, study the route you want to take and then you finally (and cautiously) move forward to begin your very dangerous night hike! <br/><br/>Luckily, you have your old lantern light switched on, which helps to illuminate the way ahead like the beacon of a lighthouse{if game.rain=True:, it even cuts through the falling rain}{if game.storm=True:, it even cuts through the blinding rain much to your relief}. With the darkness effectively beaten back for a majority of the trip, you confidently move on toward your chosen direction without worry and without incident. A short time later, morning breaks...<br/><br/><font color=\"dedede\">You've arrived at your destination, although you've lost -2 health from the fatigue of traveling and not sleeping.</font color><br/>")
        game.ndcycle = game.ndcycle + 1
        player.health = player.health - 2
        player.parent = this.to
      }
      else if (IsSwitchedOn(sexy_candle)) {
        msg ("<br/>You ultimately decide that foregoing sleep and traveling at night{if game.rain=True: through the rain}{if game.storm=True: through the thunderous storm} to gain some extra miles in your journey is worth the risk of potentially stumbling into any unseen dangers and pitfalls. You aren't sure what the fates have in store for you, but given your decision, you resolve to be extra careful tonight. You begin to ready yourself; you gather up and secure all your belongings, study the route you want to take and then you finally (and cautiously) move forward to begin your very dangerous night hike! <br/><br/>Luckily, you have Aaleahya to help light your way ahead{if game.rain=True: even through the rain fall}{if game.storm=True: even through the thunderous storm}. But, interestingly enough, it's her company that you find most soothing in the all encompassing, deepening dark. With the night effectively beaten back for most of the trip thanks to her brilliant luminescence, you confidently move on toward your chosen direction without worry and without incident. A short time later, morning breaks...<br/><br/><font color=\"dedede\">You've arrived at your destination, although you've lost -2 health from the fatigue of traveling and not sleeping.</font color><br/>")
        game.ndcycle = game.ndcycle + 1
        player.health = player.health - 2
        player.parent = this.to
      }
      else {
        if (RandomChance(25)) {
          msg ("<br/>You ultimately decide that foregoing sleep and traveling at night{if game.rain=True: through the rain}{if game.storm=True: through the thunderous storm} to gain some extra miles in your journey is worth the risk of potentially stumbling into any unseen dangers and pitfalls. You aren't sure what the fates have in store for you, but given your decision, you resolve to be extra careful tonight. You begin to ready yourself; you gather up and secure all your belongings, study the route you want to take and then you finally (and cautiously) move forward to begin your very dangerous night hike! <br/>")
          if (RandomChance(25)) {
            if (game.rain=True) {
              msg ("Given you don't have a light to guide your way though, the intense prevailing darkness coupled with the light rain fall proves to be very challenging to hike through. You lose count the number of times you slip and fall, catch yourself on jagged thicket, get scratched across the face and stub various body-parts while trying to catch yourself. All and all, the trip was incredibly painful. Half-way through the night, you begin to wonder if you made a mistake trying to push on like this but with some good ole-fashioned perseverance, you continue on for another couple of hours. Finally, (after what seems like an eternity), morning finally breaks...<br/><br/><font color=\"dedede\">Due to your eventful night-time hike and the rain fall from above, as well as the injuries you've sustained and the fatigue of traveling adding up, you've lost -4 health!</font color><br/>")
              player.health = player.health - 4
              if (player.base_defence>=5) {
                msg ("<font color=\"dedede\">Although, because of how tough you are you really only lost -3 health.</font color>")
                player.health = player.health + 1
              }
              if (RandomChance(25)) {
                msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you suddenly realize that you may have gotten a bit turned around at some point or another because this place seems completely different area what you were intending to follow. Looking around, nothing about any of this seems familiar in the least, which means you're lost!<br/><br/><font color=\"dedede\">You're lost...</font color><br/><br/>**For the time being however you have been moved to your intended destination**<br/>")
                player.parent = this.to
              }
              else if (RandomChance(25)) {
                msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you suddenly realize that you may have gotten turned around at some point or another. Matter of fact, all of this seems vaguely familiar, almost like you've been here before. Wait a second. You HAVE been here before! That means you travelled ALL night to wind up right back where you started before disembarking. What a waste of time and supplies!<br/><br/><font color=\"dedede\">You're back where you started!</font color><br/>")
              }
              else {
                player.parent = this.to
              }
            }
            else if (game.storm=True) {
              msg ("Given you don't have a light to guide your way though, the exceptionally severe and dominanting darkness allied with the oppressive downpour and it's thunderous rumbles proves to be extremely dangerous to hike through. You constantly misjudge your surroundings and blunder hard to the ground, you slice open and ensnare various parts of your body on bushes and thicket, you recieve countless slashes across your face, and you stub various body-parts while trying to catch yourself from falling into mudholes, across slippery rocks and slimey trees. All and all, the trip was completely excruciating. Not even half-way through the night, you begin to wonder if you made a mistake trying to push on like this, especially with how dangerous it is but with some good ole-fashioned perseverance, you somehow manage to continue on for another couple of hours. Finally, (after what seems like a neverending night of misery and pain), morning finally breaks...<br/><br/><font color=\"dedede\">Due to your exceptionally dangerous night-time hike and the brutal storm in addition to it, as well as all the injuries you've sustained and the fatigue from traveling adding up, you've lost -6 health!</font color><br/>")
              player.health = player.health - 6
              if (player.base_defence>=5) {
                msg ("<font color=\"dedede\">Although, because of how tough you are you really only lost -5 health.</font color>")
                player.health = player.health + 1
              }
              if (RandomChance(25)) {
                msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you suddenly realize that you may have gotten a bit turned around at some point or another because this place seems completely different area what you were intending to follow. Looking around, nothing about any of this seems familiar in the least, which means you're lost!<br/><br/><font color=\"dedede\">You're lost...</font color><br/><br/>**For the time being however you have been moved to your intended destination**<br/>")
                player.parent = this.to
              }
              else if (RandomChance(25)) {
                msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you suddenly realize that you may have gotten turned around at some point or another. Matter of fact, all of this seems vaguely familiar, almost like you've been here before. Wait a second. You HAVE been here before! That means you travelled ALL night to wind up right back where you started before disembarking. What a waste of time and supplies!<br/><br/><font color=\"dedede\">You're back where you started!</font color><br/>")
              }
              else {
                player.parent = this.to
              }
            }
            else {
              msg ("<br/>Given you don't have a light to guide your way through the inky night and it's enveloping darkness, the trip proves to be quite challenging (and very chilling) to navigate! You fall a few times here and there but it's nothing too terrible. You also get stabbed by a few jagged bushes and you run into a couple of tree trunks by accident but despite these set-backs half-way through the night, you're still going strong. You manage to continue on for another couple of hours at this pace until finally, (after what seems like an eternity), morning finally breaks...<br/><br/><font color=\"dedede\">Due to your strenuous night hike, as well as some of the injuries you've sustained and the fatigue of traveling adding up, you've lot -2 health</font color><br/>")
              player.health = player.health - 2
              if (player.base_defence>=5) {
                msg ("<font color=\"dedede\">Although, because of how tough you are you really only lost -1 health.</font color>")
                player.health = player.health + 1
              }
              if (RandomChance(25)) {
                msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you suddenly realize that you may have gotten a bit turned around at some point or another because this place seems completely different area what you were intending to follow. Looking around, nothing about any of this seems familiar in the least, which means you're lost!<br/><br/><font color=\"dedede\">You're lost...</font color><br/><br/>**For the time being however you have been moved to your intended destination**<br/>")
                player.parent = this.to
              }
              else if (RandomChance(25)) {
                msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you suddenly realize that you may have gotten turned around at some point or another. Matter of fact, all of this seems vaguely familiar, almost like you've been here before. Wait a second. You HAVE been here before! That means you travelled ALL night to wind up right back where you started before disembarking. What a waste of time and supplies!<br/><br/><font color=\"dedede\">You're back where you started!</font color><br/>")
              }
              else {
                player.parent = this.to
              }
            }
          }
          else if (RandomChance(25)) {
            if (game.rain=True) {
              msg ("Given you don't have a light to guide your way though, the intense prevailing darkness coupled with the light rain fall proves to be very challenging to hike through. You lose count the number of times you slip and fall, catch yourself on jagged thicket, get scratched across the face and stub various body-parts while trying to catch yourself. All and all, the trip was incredibly painful. Half-way through the night, you begin to wonder if you made a mistake trying to push on like this but with some good ole-fashioned perseverance, you continue on for another couple of hours. Finally, (after what seems like an eternity), morning finally breaks...<br/><br/><font color=\"dedede\">Due to your eventful night-time hike and the rain fall from above, as well as the injuries you've sustained and the fatigue of traveling adding up, you've lost -5 health!</font color><br/>")
              player.health = player.health - 5
              if (player.base_defence>=5) {
                msg ("<font color=\"dedede\">Although, because of how tough you are you really only lost -4 health.</font color>")
                player.health = player.health + 1
              }
              if (RandomChance(25)) {
                msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you suddenly realize that you may have gotten a bit turned around at some point or another because this place seems completely different area what you were intending to follow. Looking around, nothing about any of this seems familiar in the least, which means you're lost!<br/><br/><font color=\"dedede\">You're lost...</font color><br/><br/>**For the time being however you have been moved to your intended destination**<br/>")
                player.parent = this.to
              }
              else if (RandomChance(25)) {
                msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you suddenly realize that you may have gotten turned around at some point or another. Matter of fact, all of this seems vaguely familiar, almost like you've been here before. Wait a second. You HAVE been here before! That means you travelled ALL night to wind up right back where you started before disembarking. What a waste of time and supplies!<br/><br/><font color=\"dedede\">You're back where you started!</font color><br/>")
              }
              else {
                player.parent = this.to
              }
            }
            else if (game.storm=True) {
              msg ("Given you don't have a light to guide your way though, the exceptionally severe and dominanting darkness allied with the oppressive downpour and it's thunderous rumbles proves to be extremely dangerous to hike through. You constantly misjudge your surroundings and blunder hard to the ground, you slice open and ensnare various parts of your body on bushes and thicket, you recieve countless slashes across your face, and you stub various body-parts while trying to catch yourself from falling into mudholes, across slippery rocks and slimey trees. All and all, the trip was completely excruciating. Not even half-way through the night, you begin to wonder if you made a mistake trying to push on like this, especially with how dangerous it is but with some good ole-fashioned perseverance, you somehow manage to continue on for another couple of hours. Finally, (after what seems like a neverending night of misery and pain), morning finally breaks...<br/><br/><font color=\"dedede\">Due to your exceptionally dangerous night-time hike and the brutal storm in addition to it, as well as all the injuries you've sustained and the fatigue from traveling adding up, you've lost -7 health!</font color><br/>")
              player.health = player.health - 7
              if (player.base_defence>=5) {
                msg ("<font color=\"dedede\">Although, because of how tough you are you really only lost -6 health.</font color>")
                player.health = player.health + 1
              }
              if (RandomChance(25)) {
                msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you suddenly realize that you may have gotten a bit turned around at some point or another because this place seems completely different area what you were intending to follow. Looking around, nothing about any of this seems familiar in the least, which means you're lost!<br/><br/><font color=\"dedede\">You're lost...</font color><br/><br/>**For the time being however you have been moved to your intended destination**<br/>")
                player.parent = this.to
              }
              else if (RandomChance(25)) {
                msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you suddenly realize that you may have gotten turned around at some point or another. Matter of fact, all of this seems vaguely familiar, almost like you've been here before. Wait a second. You HAVE been here before! That means you travelled ALL night to wind up right back where you started before disembarking. What a waste of time and supplies!<br/><br/><font color=\"dedede\">You're back where you started!</font color><br/>")
              }
              else {
                player.parent = this.to
              }
            }
            else {
              msg ("<br/>Given you don't have a light to guide your way through the inky night and it's enveloping darkness, the trip proves to be quite challenging (and very chilling) to navigate! You fall a few times here and there but it's nothing too terrible. You also get stabbed by a few jagged bushes and you run into a couple of tree trunks by accident but despite these set-backs half-way through the night, you're still going strong. You manage to continue on for another couple of hours at this pace until finally, (after what seems like an eternity), morning finally breaks...<br/><br/><font color=\"dedede\">Due to your strenuous night hike, as well as some of the injuries you've sustained and the fatigue of traveling adding up, you've lot -3 health</font color><br/>")
              player.health = player.health - 3
              if (player.base_defence>=5) {
                msg ("<font color=\"dedede\">Although, because of how tough you are you really only lost -2 health.</font color>")
                player.health = player.health + 1
              }
              if (RandomChance(25)) {
                msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you suddenly realize that you may have gotten a bit turned around at some point or another because this place seems completely different area what you were intending to follow. Looking around, nothing about any of this seems familiar in the least, which means you're lost!<br/><br/><font color=\"dedede\">You're lost...</font color><br/><br/>**For the time being however you have been moved to your intended destination**<br/>")
                player.parent = this.to
              }
              else if (RandomChance(25)) {
                msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you suddenly realize that you may have gotten turned around at some point or another. Matter of fact, all of this seems vaguely familiar, almost like you've been here before. Wait a second. You HAVE been here before! That means you travelled ALL night to wind up right back where you started before disembarking. What a waste of time and supplies!<br/><br/><font color=\"dedede\">You're back where you started!</font color><br/>")
              }
              else {
                player.parent = this.to
              }
            }
          }
          else if (RandomChance(25)) {
            if (game.rain=True) {
              msg ("Given you don't have a light to guide your way though, the intense prevailing darkness coupled with the light rain fall proves to be very challenging to hike through. You lose count the number of times you slip and fall, catch yourself on jagged thicket, get scratched across the face and stub various body-parts while trying to catch yourself. All and all, the trip was incredibly painful. Half-way through the night, you begin to wonder if you made a mistake trying to push on like this but with some good ole-fashioned perseverance, you continue on for another couple of hours. Finally, (after what seems like an eternity), morning finally breaks...<br/><br/><font color=\"dedede\">Due to your eventful night-time hike and the rain fall from above, as well as the injuries you've sustained and the fatigue of traveling adding up, you've lost -6 health!</font color><br/>")
              player.health = player.health - 6
              if (player.base_defence>=5) {
                msg ("<font color=\"dedede\">Although, because of how tough you are you really only lost -5 health.</font color>")
                player.health = player.health + 1
              }
              if (RandomChance(25)) {
                msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you suddenly realize that you may have gotten a bit turned around at some point or another because this place seems completely different area what you were intending to follow. Looking around, nothing about any of this seems familiar in the least, which means you're lost!<br/><br/><font color=\"dedede\">You're lost...</font color><br/><br/>**For the time being however you have been moved to your intended destination**<br/>")
                player.parent = this.to
              }
              else if (RandomChance(25)) {
                msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you suddenly realize that you may have gotten turned around at some point or another. Matter of fact, all of this seems vaguely familiar, almost like you've been here before. Wait a second. You HAVE been here before! That means you travelled ALL night to wind up right back where you started before disembarking. What a waste of time and supplies!<br/><br/><font color=\"dedede\">You're back where you started!</font color><br/>")
              }
              else {
                player.parent = this.to
              }
            }
            else if (game.storm=True) {
              msg ("Given you don't have a light to guide your way though, the exceptionally severe and dominanting darkness allied with the oppressive downpour and it's thunderous rumbles proves to be extremely dangerous to hike through. You constantly misjudge your surroundings and blunder hard to the ground, you slice open and ensnare various parts of your body on bushes and thicket, you recieve countless slashes across your face, and you stub various body-parts while trying to catch yourself from falling into mudholes, across slippery rocks and slimey trees. All and all, the trip was completely excruciating. Not even half-way through the night, you begin to wonder if you made a mistake trying to push on like this, especially with how dangerous it is but with some good ole-fashioned perseverance, you somehow manage to continue on for another couple of hours. Finally, (after what seems like a neverending night of misery and pain), morning finally breaks...<br/><br/><font color=\"dedede\">Due to your exceptionally dangerous night-time hike and the brutal storm in addition to it, as well as all the injuries you've sustained and the fatigue from traveling adding up, you've lost -8 health!</font color><br/>")
              player.health = player.health - 8
              if (player.base_defence>=5) {
                msg ("<font color=\"dedede\">Although, because of how tough you are you really only lost -7 health.</font color>")
                player.health = player.health + 1
              }
              if (RandomChance(25)) {
                msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you suddenly realize that you may have gotten a bit turned around at some point or another because this place seems completely different area what you were intending to follow. Looking around, nothing about any of this seems familiar in the least, which means you're lost!<br/><br/><font color=\"dedede\">You're lost...</font color><br/><br/>**For the time being however you have been moved to your intended destination**<br/>")
                player.parent = this.to
              }
              else if (RandomChance(25)) {
                msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you suddenly realize that you may have gotten turned around at some point or another. Matter of fact, all of this seems vaguely familiar, almost like you've been here before. Wait a second. You HAVE been here before! That means you travelled ALL night to wind up right back where you started before disembarking. What a waste of time and supplies!<br/><br/><font color=\"dedede\">You're back where you started!</font color><br/>")
              }
              else {
                player.parent = this.to
              }
            }
            else {
              msg ("<br/>Given you don't have a light to guide your way through the inky night and it's enveloping darkness, the trip proves to be quite challenging (and very chilling) to navigate! You fall a few times here and there but it's nothing too terrible. You also get stabbed by a few jagged bushes and you run into a couple of tree trunks by accident but despite these set-backs half-way through the night, you're still going strong. You manage to continue on for another couple of hours at this pace until finally, (after what seems like an eternity), morning finally breaks...<br/><br/><font color=\"dedede\">Due to your strenuous night hike, as well as some of the injuries you've sustained and the fatigue of traveling adding up, you've lot -4 health</font color><br/>")
              player.health = player.health - 4
              if (player.base_defence>=5) {
                msg ("<font color=\"dedede\">Although, because of how tough you are you really only lost -3 health.</font color>")
                player.health = player.health + 1
              }
              if (RandomChance(25)) {
                msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you suddenly realize that you may have gotten a bit turned around at some point or another because this place seems completely different area what you were intending to follow. Looking around, nothing about any of this seems familiar in the least, which means you're lost!<br/><br/><font color=\"dedede\">You're lost...</font color><br/><br/>**For the time being however you have been moved to your intended destination**<br/>")
                player.parent = this.to
              }
              else if (RandomChance(25)) {
                msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you suddenly realize that you may have gotten turned around at some point or another. Matter of fact, all of this seems vaguely familiar, almost like you've been here before. Wait a second. You HAVE been here before! That means you travelled ALL night to wind up right back where you started before disembarking. What a waste of time and supplies!<br/><br/><font color=\"dedede\">You're back where you started!</font color><br/>")
              }
              else {
                player.parent = this.to
              }
            }
          }
          else {
            if (game.rain=True) {
              msg ("Given you don't have a light to guide your way though, the intense prevailing darkness coupled with the light rain fall proves to be very challenging to hike through. You lose count the number of times you slip and fall, catch yourself on jagged thicket, get scratched across the face and stub various body-parts while trying to catch yourself. All and all, the trip was incredibly painful. Half-way through the night, you begin to wonder if you made a mistake trying to push on like this but with some good ole-fashioned perseverance, you continue on for another couple of hours. Finally, (after what seems like an eternity), morning finally breaks...<br/><br/><font color=\"dedede\">Due to your eventful night-time hike and the rain fall from above, as well as the injuries you've sustained and the fatigue of traveling adding up, you've lost -7 health!</font color><br/>")
              player.health = player.health - 7
              if (player.base_defence>=5) {
                msg ("<font color=\"dedede\">Although, because of how tough you are you really only lost -6 health.</font color>")
                player.health = player.health + 1
              }
              if (RandomChance(25)) {
                msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you suddenly realize that you may have gotten a bit turned around at some point or another because this place seems completely different area what you were intending to follow. Looking around, nothing about any of this seems familiar in the least, which means you're lost!<br/><br/><font color=\"dedede\">You're lost...</font color><br/><br/>**For the time being however you have been moved to your intended destination**<br/>")
                player.parent = this.to
              }
              else if (RandomChance(25)) {
                msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you suddenly realize that you may have gotten turned around at some point or another. Matter of fact, all of this seems vaguely familiar, almost like you've been here before. Wait a second. You HAVE been here before! That means you travelled ALL night to wind up right back where you started before disembarking. What a waste of time and supplies!<br/><br/><font color=\"dedede\">You're back where you started!</font color><br/>")
              }
              else {
                player.parent = this.to
              }
            }
            else if (game.storm=True) {
              msg ("Given you don't have a light to guide your way though, the exceptionally severe and dominanting darkness allied with the oppressive downpour and it's thunderous rumbles proves to be extremely dangerous to hike through. You constantly misjudge your surroundings and blunder hard to the ground, you slice open and ensnare various parts of your body on bushes and thicket, you recieve countless slashes across your face, and you stub various body-parts while trying to catch yourself from falling into mudholes, across slippery rocks and slimey trees. All and all, the trip was completely excruciating. Not even half-way through the night, you begin to wonder if you made a mistake trying to push on like this, especially with how dangerous it is but with some good ole-fashioned perseverance, you somehow manage to continue on for another couple of hours. Finally, (after what seems like a neverending night of misery and pain), morning finally breaks...<br/><br/><font color=\"dedede\">Due to your exceptionally dangerous night-time hike and the brutal storm in addition to it, as well as all the injuries you've sustained and the fatigue from traveling adding up, you've lost -9 health!</font color><br/>")
              player.health = player.health - 9
              if (player.base_defence>=5) {
                msg ("<font color=\"dedede\">Although, because of how tough you are you really only lost -8 health.</font color>")
                player.health = player.health + 1
              }
              if (RandomChance(25)) {
                msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you suddenly realize that you may have gotten a bit turned around at some point or another because this place seems completely different area what you were intending to follow. Looking around, nothing about any of this seems familiar in the least, which means you're lost!<br/><br/><font color=\"dedede\">You're lost...</font color><br/><br/>**For the time being however you have been moved to your intended destination**<br/>")
                player.parent = this.to
              }
              else if (RandomChance(25)) {
                msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you suddenly realize that you may have gotten turned around at some point or another. Matter of fact, all of this seems vaguely familiar, almost like you've been here before. Wait a second. You HAVE been here before! That means you travelled ALL night to wind up right back where you started before disembarking. What a waste of time and supplies!<br/><br/><font color=\"dedede\">You're back where you started!</font color><br/>")
              }
              else {
                player.parent = this.to
              }
            }
            else {
              msg ("<br/>Given you don't have a light to guide your way through the inky night and it's enveloping darkness, the trip proves to be quite challenging (and very chilling) to navigate! You fall a few times here and there but it's nothing too terrible. You also get stabbed by a few jagged bushes and you run into a couple of tree trunks by accident but despite these set-backs half-way through the night, you're still going strong. You manage to continue on for another couple of hours at this pace until finally, (after what seems like an eternity), morning finally breaks...<br/><br/><font color=\"dedede\">Due to your strenuous night hike, as well as some of the injuries you've sustained and the fatigue of traveling adding up, you've lot -5 health</font color><br/>")
              player.health = player.health - 5
              if (player.base_defence>=5) {
                msg ("<font color=\"dedede\">Although, because of how tough you are you really only lost -4 health.</font color>")
                player.health = player.health + 1
              }
              if (RandomChance(25)) {
                msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you suddenly realize that you may have gotten a bit turned around at some point or another because this place seems completely different area what you were intending to follow. Looking around, nothing about any of this seems familiar in the least, which means you're lost!<br/><br/><font color=\"dedede\">You're lost...</font color><br/><br/>**For the time being however you have been moved to your intended destination**<br/>")
                player.parent = this.to
              }
              else if (RandomChance(25)) {
                msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you suddenly realize that you may have gotten turned around at some point or another. Matter of fact, all of this seems vaguely familiar, almost like you've been here before. Wait a second. You HAVE been here before! That means you travelled ALL night to wind up right back where you started before disembarking. What a waste of time and supplies!<br/><br/><font color=\"dedede\">You're back where you started!</font color><br/>")
              }
              else {
                player.parent = this.to
              }
            }
          }
          msg ("<br/>Clothing Damage Placeholder. <br/>")
        }
        else if (RandomChance(25)) {
          msg ("<br/>You ultimately decide that foregoing sleep and traveling at night{if game.rain=True: through the rain}{if game.storm=True: through the thunderous storm} to gain some extra miles in your journey is worth the risk of potentially stumbling into any unseen dangers and pitfalls. You aren't sure what the fates have in store for you, but given your decision, you resolve to be extra careful tonight. You begin to ready yourself; you gather up and secure all your belongings, study the route you want to take and then you finally (and cautiously) move forward to begin your very dangerous night hike! <br/>")
          msg ("<br/>Trap/Pitfall Scenario Placeholder. <br/>")
          player.parent = this.to
        }
        else if (RandomChance(25)) {
          msg ("<br/>You ultimately decide that foregoing sleep and traveling at night{if game.rain=True: through the rain}{if game.storm=True: through the thunderous storm} to gain some extra miles in your journey is worth the risk of potentially stumbling into any unseen dangers and pitfalls. You aren't sure what the fates have in store for you, but given your decision, you resolve to be extra careful tonight. You begin to ready yourself; you gather up and secure all your belongings, study the route you want to take and then you finally (and cautiously) move forward to begin your very dangerous night hike! <br/>")
          if (RandomChance(25)) {
            msg ("<br/>Most of it is very uneventful though (as you would expect), at least for the first half of the night. But as the fates would have it, later on, much to your surprise, you accidentally stumble upon something quite strange---enough so to instantly stop you in your tracks, every inch of you freezing completely still. Up ahead, among the enroaching  thicket and the dense bushes, you can see a prominent dark figure lying on the ground, although it's difficult to make out in such low lighting{if game.rain=True:, especially so under the veil of rain}[if game.storm=True:, especially so under the veil of rain}. You aren't exactly sure what you're looking at, but it could be a long, mostly flat rock, or a sleeping animal like a small bear, or possibly even another traveller who could be sleeping, hurt or...worse. If it is someone though, you don't see any signs of a fire, or shelter either, which is a bit peculiar. On the other hand, all of this could be a trap too.<br/>")
          wait {
            ClearScreen
            msg ("After considering the possibility, you cautiously approach the darkened formation or figure, all the meanwhile, studying your surroundings carefully for any signs of deception. To your relief nothing happens. As you reach the prominent figure, you finally discover that it appears to be a dead {random:human:elven:dwarven:dragon-descended:halfling:orc-descended:gnome:dark elven:goblin:succubus:incubus:alaraune:demon:cow-taur:dryad:goo:naga:centaur:neko:wold-taur:dragon:orc:doll:bee-taur} {random:male:female} {random:lying face down in a small puddle:lying face down in the sand:lying partially turned on their side:lying on the flat of their back:lying sprawled out:lying slumped over}. Based on what you can immediately surmise{random: they must of died because of the various, deep-set wounds in their back:they must of died because of the slice across their throat:they must of died because of the pool of blood surrounding them. Likely bloodloss:they definitely died from decapitation:they must of died because of the deep-set slice into their {random:right:left} side:}<br/><br/><br/><br/>A Small Clearing<br/>A Crate/Box: condition of box different<br/>Happenchance<br/><br/><br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you realize that against all odds you somehow managed to stay on course without getting turned around or lost. It was actually a mostly uneventuful night as well. You didn't really get hurt, you didn't fall into any pitfalls or traps, you didn't find anything significant and you didn't run into anyone or anything. All and all, it was a pretty easy trip. You're just a bit tired from the entire ordeal and no sleeping a wink all night. Time to press on nonetheless!<br/><br/><font color=\"dedede\">You've lost -4 health from hiking all night and not sleeping!</font color><br/>")
          }
        }
        else if (RandomChance(25)) {
        }
        else if (RandomChance(25)) {
        }
        else {
        }
        player.health = player.health - 4
        player.parent = this.to
      }
      else if (RandomChance(25)) {
        msg ("<br/>You ultimately decide that foregoing sleep and traveling at night{if game.rain=True: through the rain}{if game.storm=True: through the thunderous storm} to gain some extra miles in your journey is worth the risk of potentially stumbling into any unseen dangers and pitfalls. You aren't sure what the fates have in store for you, but given your decision, you resolve to be extra careful tonight. You begin to ready yourself; you gather up and secure all your belongings, study the route you want to take and then you finally (and cautiously) move forward to begin your very dangerous night hike! <br/>")
        msg ("<br/>Enemy Scenario. Placeholder. <br/>")
        player.parent = this.to
      }
      else {
        msg ("<br/>You ultimately decide that foregoing sleep and traveling at night{if game.rain=True: through the rain}{if game.storm=True: through the thunderous storm} to gain some extra miles in your journey is worth the risk of potentially stumbling into any unseen dangers and pitfalls. You aren't sure what the fates have in store for you, but given your decision, you resolve to be extra careful tonight. You begin to ready yourself; you gather up and secure all your belongings, study the route you want to take and then you finally (and cautiously) move forward to begin your very dangerous night hike! <br/>")
        msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you realize that against all odds you somehow managed to stay on course without getting turned around or lost. It was actually a mostly uneventuful night as well. You didn't really get hurt, you didn't fall into any pitfalls or traps, you didn't find anything significant and you didn't run into anyone or anything. All and all, it was a pretty easy trip. You're just a bit tired from the entire ordeal and no sleeping a wink all night. Time to press on nonetheless!<br/><br/><font color=\"dedede\">You've lost -4 health from hiking all night and not sleeping!</font color><br/>")
        player.health = player.health - 4
        player.parent = this.to
      }
    }
  }
  else if (result = "No, Stay Put") {
    msg ("<br/>You decide against traveling for the time being as it's extremely dangerous, especially without a light{if game.rain=True:...not to mention the rainfall would make the trip even more treacherous}{if game.storm=True:...not to mention the rainfall would make the trip even more treacherous}. You can always \"Rest\" as well, and get a fresh start in the morning.<br/>")
  }
}
}

Anyone know an alternative that still keeps this as a function? I mean, it doesn't HAVE to be a function, but having this script will bloat the game a ton if I put it to every exit.


I did not realise this was in a function. You need to send the exit as a parameter to the function; say it is called exit, the code is then:

MoveObject (player, exit.to)

And the function call can use this.

MyFunction(this)

The only problem is this function has to apply to ALL exits of every room that apply. Wouldn't setting the exit as a parameter only apply to that one exit? Thanks for the response too, Pix!


Okay... So override the Go command to call your function instead of moving the player itself.


I wouldn't be able to do that either because the Night Travel doesn't apply to all of the 1st Chapter. @_@


So what rooms does it apply to? Is there a pattern, i.e., some rule we can check (eg only or does not apply to rooms inside another room)? If so, check if that applies in the Go command.


Oh...so you think I should make an attribute in each room where the script applies and then put that attribute check on the modified Go?


That would be one way. Or an attribute on the rooms it does not apply if there are less of them. If all the rooms are in the same area or not (eg Part 1 Group), you could check for that. Whatever will be less work!


My Go Script has already been modified (see below). Do you suggest I put an attribute in the bottom "else" where the...

else {
    player.parent = exit.to

is?
And change it to this, for example...

else {
    if (roomattributehere=True) {
    player.parent = exit.to
    }
    else if (roomattributehere=False) {
    NightTravelWT Function
    }
}

Modified "Go" Below (without above changes).

if (GetBoolean (player, "immobilized")) {
  if (HasString(player, "immobilizedmessage")) {
    msg (player.immobilizedmessage)
  }
  else {
    msg ("<br/>You cannot move! <br/>")
  }
}
else if ((player.maxvolume < GetVolume(player, false))) {
  msg ("<br/>{random:You're carrying too much to move!:You're juggling too many items!:You cannot move, things are literally dropping out of your arms with every motion you make!} {once:You'll need to find a container or to drop some of your current items.} <br/>")
}
else if (exit.locked) {
  msg (exit.lockmessage)
}
else if (HasScript(exit, "script")) {
  do (exit, "script")
}
else {
  if (exit.lookonly) {
    msg ("You can't go there.")
  }
  else {
    player.parent = exit.to
  }
}

Yes... But it would be better like this:

else {
  if (exit.to.roomattributehere) {
    player.parent = exit.to
  }
  else {
    NightTravelWT Function (exit)
  }
}

In particular, you need to pass the exit to the function as a parameter.


So would I do this on the function afterward where/when the player is moved on the exit...

MoveObject (player, exit.to)

And is the roomattributehere that goes on the rooms a string? A boolean? Is there a way I can apply it to all rooms in "Part 1 Group" (which encompasses all of the first chapter)?


Yes, to the MoveObject in the function.

roomattributehere is a Boolean. But thinking about it, if there is no way for the player to go back to the first chapter locations, you could set a flag on the game object when chapter two starts, and just check that, which would be less work than setting it for every room in chaper one.


Okie dokie.

So with the roomattributehere which I've named "travelcheck" and placed on the Game Object as a boolean, would the go code remain the same? Or would it look like this?

else {
  if (exit.to.roomattributehere=True) {
    player.parent = exit.to
  }
  else {
    NightTravelWT Function (exit)
  }
}

BTW thank you so much for your patience on this Pix.

Anonynn.


So game has a Boolean called "travelcheck", which is originally false, and gets set to true somewhere when the player moves to chaper two. Now you need to check that attribute, rather than one on the room.

else {
  if (game.travelcheck) {
    player.parent = exit.to
  }
  else {
    NightTravelWT Function (exit)
  }
}

I'm still getting this error...

Error running script: Error compiling expression 'exit.to': Unknown object or variable 'exit'

and this one...

Error running script: No parameters passed to NightTravelWT function - expected 1 parameters

Any ideas :O ? I thought the parameter was just exit am I supposed to have...

Function: NightTravelWT
Parameters: exit.to

?


No, it should just be "exit" in the parameters list of the function. Is it possible this is an error somewhere else? Go into full code view and search for "exit.to" and see if anything else turns up.


There was one in the Modified Go...

      else {
        if (game.travelcheck) {
          player.parent = exit.to
        }
        else {
          NightTravelWT (exit)
        }
      }

Several in the NightTravelWT Function itself.

 MoveObject (player, exit.to)

Several in the DayTravelWT Function which is inside of the NightTravelWT Function...

MoveObject (player, exit.to)

And that seems to be it.


Do both NightTravelWT and DayTravelWT have "exit" as a parameter?


Nope, only the NightTravelWT Function has that parameter. The DayTravelWT Function should too though, right?


southwest
Error running script: No parameters passed to NightTravelWT function - expected 1 parameters

^ is the only error popping up now. But it's preventing the player from moving.


in some function call (use) of it, you didn't give it an argument/input to be used by its parameter variable in the function's scripting:

for example:

// NO error:

<game name="xxx">
  <attr name="start" type="script">
    my_msg_function ("hi")
  </attr>
</game>

<function name="my_msg_function" parameters="string_parameter">
  msg (string_parameter)
</function>

--------

// ERROR:

<game name="xxx">
  <attr name="start" type="script">
    my_msg_function () // <--------- no input/value/argument is put inside of the parenthesis
  </attr>
</game>

<function name="my_msg_function" parameters="string_parameter">
  msg (string_parameter)
</function>

Both NightTravelWT and DayTravelWT need to have"exit" as a parameter. You also need to make sure that wherever they are called, they get sent the exit too.


There's one place where I don't have the exit.to scripting and that's because the player gets turned around in the darkness and ends up right back in the same room they started. Would that be exit.from?


No, there is no exit.from. If you set it up so the exit leads back to the same room, then it is still exit.to.

ETA: exit.parent is what we have instead of exit.from, by the way.


Ah okay! I'll give that a try!


southwest
Error running script: No parameters passed to NightTravelWT function - expected 1 parameters

^ Still getting this error. I double checked the function script too --- and each script all have exits.


Yeah, I have scoured the Function and still can't find the cause. I'll paste both...

Night Travel Function

if (game.ndcycle<=2) {
  DayTravelWT
}
else {
  msg ("<br/>It's a little late to travel. {once:Doing so could result in losing health, getting lost, stumbling upon enemies, falling into traps, or a combination of the two (this is especially dangerous during rain, or a storm).} Do you still want to try? {once:If so, you might want to switch on a light first if you have one!} Do anything to cancel.)<br/>")
  menulist = Split("Yes, Travel Anyway;No, Stay Put", ";")
  ShowMenu ("", menulist, true) {
    if (result = "Yes, Travel Anyway") {
      ClearScreen
      if (IsSwitchedOn(old_lantern)) {
        msg ("<br/>You ultimately decide that foregoing sleep and traveling at night{if game.rain=True: through the rain}{if game.storm=True: through the thunderous storm} to gain some extra miles in your journey is worth the risk of potentially stumbling into any unseen dangers and pitfalls. You aren't sure what the fates have in store for you, but given your decision, you resolve to be extra careful tonight. You begin to ready yourself; you gather up and secure all your belongings, study the route you want to take and then you finally (and cautiously) move forward to begin your very dangerous night hike! <br/><br/>Luckily, you have your old lantern light switched on, which helps to illuminate the way ahead like the beacon of a lighthouse{if game.rain=True:, it even cuts through the falling rain}{if game.storm=True:, it even cuts through the blinding rain much to your relief}. With the darkness effectively beaten back for a majority of the trip, you confidently move on toward your chosen direction without worry and without incident. A short time later, morning breaks...<br/><br/><font color=\"dedede\">You've arrived at your destination, although you've lost -2 health from the fatigue of traveling and not sleeping.</font color><br/>")
        player.health = player.health - 2
        if (player.defense>=5) {
          msg ("<font color=\"dedede\">Although, because of how tough you are you really only lost -1 health.</font color>")
          player.health = player.health + 1
        }
        game.ndcycle = game.ndcycle + 1
        MoveObject (player, exit.to)
      }
      else if (IsSwitchedOn(sexy_candle)) {
        msg ("<br/>You ultimately decide that foregoing sleep and traveling at night{if game.rain=True: through the rain}{if game.storm=True: through the thunderous storm} to gain some extra miles in your journey is worth the risk of potentially stumbling into any unseen dangers and pitfalls. You aren't sure what the fates have in store for you, but given your decision, you resolve to be extra careful tonight. You begin to ready yourself; you gather up and secure all your belongings, study the route you want to take and then you finally (and cautiously) move forward to begin your very dangerous night hike! <br/><br/>Luckily, you have Aaleahya to help light your way ahead{if game.rain=True: even through the rain fall}{if game.storm=True: even through the thunderous storm}. But, interestingly enough, it's her company that you find most soothing in the all encompassing, deepening dark. With the night effectively beaten back for most of the trip thanks to her brilliant luminescence, you confidently move on toward your chosen direction without worry and without incident. A short time later, morning breaks...<br/><br/><font color=\"dedede\">You've arrived at your destination, although you've lost -2 health from the fatigue of traveling and not sleeping.</font color><br/>")
        player.health = player.health - 2
        if (player.defense>=5) {
          msg ("<font color=\"dedede\">Although, because of how tough you are you really only lost -1 health.</font color>")
          player.health = player.health + 1
        }
        game.ndcycle = game.ndcycle + 1
        MoveObject (player, exit.to)
      }
      else {
        if (RandomChance(25)) {
          msg ("<br/>You ultimately decide that foregoing sleep and traveling at night{if game.rain=True: through the rain}{if game.storm=True: through the thunderous storm} to gain some extra miles in your journey is worth the risk of potentially stumbling into any unseen dangers and pitfalls. You aren't sure what the fates have in store for you, but given your decision, you resolve to be extra careful tonight. You begin to ready yourself; you gather up and secure all your belongings, study the route you want to take and then you finally (and cautiously) move forward to begin your very dangerous night hike! <br/>")
          if (RandomChance(25)) {
            if (game.rain=True) {
              msg ("Given you don't have a light to guide your way though, the intense prevailing darkness coupled with the light rain fall proves to be very challenging to hike through. You lose count the number of times you slip and fall, catch yourself on jagged thicket, get scratched across the face and stub various body-parts while trying to catch yourself. All and all, the trip was incredibly painful. Half-way through the night, you begin to wonder if you made a mistake trying to push on like this but with some good ole-fashioned perseverance, you continue on for another couple of hours. Finally, (after what seems like an eternity), morning finally breaks...<br/><br/><font color=\"dedede\">Due to your eventful night-time hike and the rain fall from above, as well as the injuries you've sustained and the fatigue of traveling adding up, you've lost -4 health!</font color><br/>")
              player.health = player.health - 4
              if (player.base_defense>=5) {
                msg ("<font color=\"dedede\">Although, because of how tough you are you really only lost -3 health.</font color>")
                player.health = player.health + 1
              }
              if (RandomChance(25)) {
                msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you suddenly realize that you may have gotten a bit turned around at some point or another because this place seems completely different area what you were intending to follow. Looking around, nothing about any of this seems familiar in the least, which means you're lost!<br/><br/><font color=\"dedede\">You're lost...</font color><br/><br/>**For the time being however you have been moved to your intended destination**<br/>")
                game.ndcycle = game.ndcycle + 1
                MoveObject (player, exit.to)
              }
              else if (RandomChance(25)) {
                msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you suddenly realize that you may have gotten turned around at some point or another. Matter of fact, all of this seems vaguely familiar, almost like you've been here before. Wait a second. You HAVE been here before! That means you travelled ALL night to wind up right back where you started before disembarking. What a waste of time and supplies!<br/><br/><font color=\"dedede\">You're back where you started!</font color><br/>")
                game.ndcycle = game.ndcycle + 1
                MoveObject (player, exit.parent)
              }
              else {
                game.ndcycle = game.ndcycle + 1
                MoveObject (player, exit.to)
              }
            }
            else if (game.storm=True) {
              msg ("Given you don't have a light to guide your way though, the exceptionally severe and dominanting darkness allied with the oppressive downpour and it's thunderous rumbles proves to be extremely dangerous to hike through. You constantly misjudge your surroundings and blunder hard to the ground, you slice open and ensnare various parts of your body on bushes and thicket, you recieve countless slashes across your face, and you stub various body-parts while trying to catch yourself from falling into mudholes, across slippery rocks and slimey trees. All and all, the trip was completely excruciating. Not even half-way through the night, you begin to wonder if you made a mistake trying to push on like this, especially with how dangerous it is but with some good ole-fashioned perseverance, you somehow manage to continue on for another couple of hours. Finally, (after what seems like a neverending night of misery and pain), morning finally breaks...<br/><br/><font color=\"dedede\">Due to your exceptionally dangerous night-time hike and the brutal storm in addition to it, as well as all the injuries you've sustained and the fatigue from traveling adding up, you've lost -6 health!</font color><br/>")
              player.health = player.health - 6
              if (player.base_defense>=5) {
                msg ("<font color=\"dedede\">Although, because of how tough you are you really only lost -5 health.</font color>")
                player.health = player.health + 1
              }
              if (RandomChance(25)) {
                msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you suddenly realize that you may have gotten a bit turned around at some point or another because this place seems completely different area what you were intending to follow. Looking around, nothing about any of this seems familiar in the least, which means you're lost!<br/><br/><font color=\"dedede\">You're lost...</font color><br/><br/>**For the time being however you have been moved to your intended destination**<br/>")
                game.ndcycle = game.ndcycle + 1
                MoveObject (player, exit.to)
              }
              else if (RandomChance(25)) {
                msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you suddenly realize that you may have gotten turned around at some point or another. Matter of fact, all of this seems vaguely familiar, almost like you've been here before. Wait a second. You HAVE been here before! That means you travelled ALL night to wind up right back where you started before disembarking. What a waste of time and supplies!<br/><br/><font color=\"dedede\">You're back where you started!</font color><br/>")
                game.ndcycle = game.ndcycle + 1
                MoveObject (player, exit.parent)
              }
              else {
                game.ndcycle = game.ndcycle + 1
                MoveObject (player, exit.to)
              }
            }
            else {
              msg ("<br/>Given you don't have a light to guide your way through the inky night and it's enveloping darkness, the trip proves to be quite challenging (and very chilling) to navigate! You fall a few times here and there but it's nothing too terrible. You also get stabbed by a few jagged bushes and you run into a couple of tree trunks by accident but despite these set-backs half-way through the night, you're still going strong. You manage to continue on for another couple of hours at this pace until finally, (after what seems like an eternity), morning finally breaks...<br/><br/><font color=\"dedede\">Due to your strenuous night hike, as well as some of the injuries you've sustained and the fatigue of traveling adding up, you've lot -2 health</font color><br/>")
              player.health = player.health - 2
              if (player.base_defense>=5) {
                msg ("<font color=\"dedede\">Although, because of how tough you are you really only lost -1 health.</font color>")
                player.health = player.health + 1
              }
              if (RandomChance(25)) {
                msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you suddenly realize that you may have gotten a bit turned around at some point or another because this place seems completely different area what you were intending to follow. Looking around, nothing about any of this seems familiar in the least, which means you're lost!<br/><br/><font color=\"dedede\">You're lost...</font color><br/><br/>**For the time being however you have been moved to your intended destination**<br/>")
                game.ndcycle = game.ndcycle + 1
                MoveObject (player, exit.to)
              }
              else if (RandomChance(25)) {
                msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you suddenly realize that you may have gotten turned around at some point or another. Matter of fact, all of this seems vaguely familiar, almost like you've been here before. Wait a second. You HAVE been here before! That means you travelled ALL night to wind up right back where you started before disembarking. What a waste of time and supplies!<br/><br/><font color=\"dedede\">You're back where you started!</font color><br/>")
                game.ndcycle = game.ndcycle + 1
                MoveObject (player, exit.parent)
              }
              else {
                game.ndcycle = game.ndcycle + 1
                MoveObject (player, exit.to)
              }
            }
          }
          else if (RandomChance(25)) {
            if (game.rain=True) {
              msg ("Given you don't have a light to guide your way though, the intense prevailing darkness coupled with the light rain fall proves to be very challenging to hike through. You lose count the number of times you slip and fall, catch yourself on jagged thicket, get scratched across the face and stub various body-parts while trying to catch yourself. All and all, the trip was incredibly painful. Half-way through the night, you begin to wonder if you made a mistake trying to push on like this but with some good ole-fashioned perseverance, you continue on for another couple of hours. Finally, (after what seems like an eternity), morning finally breaks...<br/><br/><font color=\"dedede\">Due to your eventful night-time hike and the rain fall from above, as well as the injuries you've sustained and the fatigue of traveling adding up, you've lost -5 health!</font color><br/>")
              player.health = player.health - 5
              if (player.base_defense>=5) {
                msg ("<font color=\"dedede\">Although, because of how tough you are you really only lost -4 health.</font color>")
                player.health = player.health + 1
              }
              if (RandomChance(25)) {
                msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you suddenly realize that you may have gotten a bit turned around at some point or another because this place seems completely different area what you were intending to follow. Looking around, nothing about any of this seems familiar in the least, which means you're lost!<br/><br/><font color=\"dedede\">You're lost...</font color><br/><br/>**For the time being however you have been moved to your intended destination**<br/>")
                game.ndcycle = game.ndcycle + 1
                MoveObject (player, exit.to)
              }
              else if (RandomChance(25)) {
                msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you suddenly realize that you may have gotten turned around at some point or another. Matter of fact, all of this seems vaguely familiar, almost like you've been here before. Wait a second. You HAVE been here before! That means you travelled ALL night to wind up right back where you started before disembarking. What a waste of time and supplies!<br/><br/><font color=\"dedede\">You're back where you started!</font color><br/>")
                game.ndcycle = game.ndcycle + 1
                MoveObject (player, exit.parent)
              }
              else {
                game.ndcycle = game.ndcycle + 1
                MoveObject (player, exit.to)
              }
            }
            else if (game.storm=True) {
              msg ("Given you don't have a light to guide your way though, the exceptionally severe and dominanting darkness allied with the oppressive downpour and it's thunderous rumbles proves to be extremely dangerous to hike through. You constantly misjudge your surroundings and blunder hard to the ground, you slice open and ensnare various parts of your body on bushes and thicket, you recieve countless slashes across your face, and you stub various body-parts while trying to catch yourself from falling into mudholes, across slippery rocks and slimey trees. All and all, the trip was completely excruciating. Not even half-way through the night, you begin to wonder if you made a mistake trying to push on like this, especially with how dangerous it is but with some good ole-fashioned perseverance, you somehow manage to continue on for another couple of hours. Finally, (after what seems like a neverending night of misery and pain), morning finally breaks...<br/><br/><font color=\"dedede\">Due to your exceptionally dangerous night-time hike and the brutal storm in addition to it, as well as all the injuries you've sustained and the fatigue from traveling adding up, you've lost -7 health!</font color><br/>")
              player.health = player.health - 7
              if (player.base_defense>=5) {
                msg ("<font color=\"dedede\">Although, because of how tough you are you really only lost -6 health.</font color>")
                player.health = player.health + 1
              }
              if (RandomChance(25)) {
                msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you suddenly realize that you may have gotten a bit turned around at some point or another because this place seems completely different area what you were intending to follow. Looking around, nothing about any of this seems familiar in the least, which means you're lost!<br/><br/><font color=\"dedede\">You're lost...</font color><br/><br/>**For the time being however you have been moved to your intended destination**<br/>")
                game.ndcycle = game.ndcycle + 1
                MoveObject (player, exit.to)
              }
              else if (RandomChance(25)) {
                msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you suddenly realize that you may have gotten turned around at some point or another. Matter of fact, all of this seems vaguely familiar, almost like you've been here before. Wait a second. You HAVE been here before! That means you travelled ALL night to wind up right back where you started before disembarking. What a waste of time and supplies!<br/><br/><font color=\"dedede\">You're back where you started!</font color><br/>")
                game.ndcycle = game.ndcycle + 1
                MoveObject (player, exit.parent)
              }
              else {
                game.ndcycle = game.ndcycle + 1
                MoveObject (player, exit.to)
              }
            }
            else {
              msg ("<br/>Given you don't have a light to guide your way through the inky night and it's enveloping darkness, the trip proves to be quite challenging (and very chilling) to navigate! You fall a few times here and there but it's nothing too terrible. You also get stabbed by a few jagged bushes and you run into a couple of tree trunks by accident but despite these set-backs half-way through the night, you're still going strong. You manage to continue on for another couple of hours at this pace until finally, (after what seems like an eternity), morning finally breaks...<br/><br/><font color=\"dedede\">Due to your strenuous night hike, as well as some of the injuries you've sustained and the fatigue of traveling adding up, you've lot -3 health</font color><br/>")
              player.health = player.health - 3
              if (player.base_defense>=5) {
                msg ("<font color=\"dedede\">Although, because of how tough you are you really only lost -2 health.</font color>")
                player.health = player.health + 1
              }
              if (RandomChance(25)) {
                msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you suddenly realize that you may have gotten a bit turned around at some point or another because this place seems completely different area what you were intending to follow. Looking around, nothing about any of this seems familiar in the least, which means you're lost!<br/><br/><font color=\"dedede\">You're lost...</font color><br/><br/>**For the time being however you have been moved to your intended destination**<br/>")
                game.ndcycle = game.ndcycle + 1
                MoveObject (player, exit.to)
              }
              else if (RandomChance(25)) {
                msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you suddenly realize that you may have gotten turned around at some point or another. Matter of fact, all of this seems vaguely familiar, almost like you've been here before. Wait a second. You HAVE been here before! That means you travelled ALL night to wind up right back where you started before disembarking. What a waste of time and supplies!<br/><br/><font color=\"dedede\">You're back where you started!</font color><br/>")
                game.ndcycle = game.ndcycle + 1
                MoveObject (player, exit.parent)
              }
              else {
                game.ndcycle = game.ndcycle + 1
                MoveObject (player, exit.to)
              }
            }
          }
          else if (RandomChance(25)) {
            if (game.rain=True) {
              msg ("Given you don't have a light to guide your way though, the intense prevailing darkness coupled with the light rain fall proves to be very challenging to hike through. You lose count the number of times you slip and fall, catch yourself on jagged thicket, get scratched across the face and stub various body-parts while trying to catch yourself. All and all, the trip was incredibly painful. Half-way through the night, you begin to wonder if you made a mistake trying to push on like this but with some good ole-fashioned perseverance, you continue on for another couple of hours. Finally, (after what seems like an eternity), morning finally breaks...<br/><br/><font color=\"dedede\">Due to your eventful night-time hike and the rain fall from above, as well as the injuries you've sustained and the fatigue of traveling adding up, you've lost -6 health!</font color><br/>")
              player.health = player.health - 6
              if (player.base_defense>=5) {
                msg ("<font color=\"dedede\">Although, because of how tough you are you really only lost -5 health.</font color>")
                player.health = player.health + 1
              }
              if (RandomChance(25)) {
                msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you suddenly realize that you may have gotten a bit turned around at some point or another because this place seems completely different area what you were intending to follow. Looking around, nothing about any of this seems familiar in the least, which means you're lost!<br/><br/><font color=\"dedede\">You're lost...</font color><br/><br/>**For the time being however you have been moved to your intended destination**<br/>")
                game.ndcycle = game.ndcycle + 1
                MoveObject (player, exit.to)
              }
              else if (RandomChance(25)) {
                msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you suddenly realize that you may have gotten turned around at some point or another. Matter of fact, all of this seems vaguely familiar, almost like you've been here before. Wait a second. You HAVE been here before! That means you travelled ALL night to wind up right back where you started before disembarking. What a waste of time and supplies!<br/><br/><font color=\"dedede\">You're back where you started!</font color><br/>")
                game.ndcycle = game.ndcycle + 1
                MoveObject (player, exit.parent)
              }
              else {
                game.ndcycle = game.ndcycle + 1
                MoveObject (player, exit.to)
              }
            }
            else if (game.storm=True) {
              msg ("Given you don't have a light to guide your way though, the exceptionally severe and dominanting darkness allied with the oppressive downpour and it's thunderous rumbles proves to be extremely dangerous to hike through. You constantly misjudge your surroundings and blunder hard to the ground, you slice open and ensnare various parts of your body on bushes and thicket, you recieve countless slashes across your face, and you stub various body-parts while trying to catch yourself from falling into mudholes, across slippery rocks and slimey trees. All and all, the trip was completely excruciating. Not even half-way through the night, you begin to wonder if you made a mistake trying to push on like this, especially with how dangerous it is but with some good ole-fashioned perseverance, you somehow manage to continue on for another couple of hours. Finally, (after what seems like a neverending night of misery and pain), morning finally breaks...<br/><br/><font color=\"dedede\">Due to your exceptionally dangerous night-time hike and the brutal storm in addition to it, as well as all the injuries you've sustained and the fatigue from traveling adding up, you've lost -8 health!</font color><br/>")
              player.health = player.health - 8
              if (player.base_defense>=5) {
                msg ("<font color=\"dedede\">Although, because of how tough you are you really only lost -7 health.</font color>")
                player.health = player.health + 1
              }
              if (RandomChance(25)) {
                msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you suddenly realize that you may have gotten a bit turned around at some point or another because this place seems completely different area what you were intending to follow. Looking around, nothing about any of this seems familiar in the least, which means you're lost!<br/><br/><font color=\"dedede\">You're lost...</font color><br/><br/>**For the time being however you have been moved to your intended destination**<br/>")
                game.ndcycle = game.ndcycle + 1
                MoveObject (player, exit.to)
              }
              else if (RandomChance(25)) {
                msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you suddenly realize that you may have gotten turned around at some point or another. Matter of fact, all of this seems vaguely familiar, almost like you've been here before. Wait a second. You HAVE been here before! That means you travelled ALL night to wind up right back where you started before disembarking. What a waste of time and supplies!<br/><br/><font color=\"dedede\">You're back where you started!</font color><br/>")
                game.ndcycle = game.ndcycle + 1
                MoveObject (player, exit.parent)
              }
              else {
                game.ndcycle = game.ndcycle + 1
                MoveObject (player, exit.to)
              }
            }
            else {
              msg ("<br/>Given you don't have a light to guide your way through the inky night and it's enveloping darkness, the trip proves to be quite challenging (and very chilling) to navigate! You fall a few times here and there but it's nothing too terrible. You also get stabbed by a few jagged bushes and you run into a couple of tree trunks by accident but despite these set-backs half-way through the night, you're still going strong. You manage to continue on for another couple of hours at this pace until finally, (after what seems like an eternity), morning finally breaks...<br/><br/><font color=\"dedede\">Due to your strenuous night hike, as well as some of the injuries you've sustained and the fatigue of traveling adding up, you've lot -4 health</font color><br/>")
              player.health = player.health - 4
              if (player.base_defense>=5) {
                msg ("<font color=\"dedede\">Although, because of how tough you are you really only lost -3 health.</font color>")
                player.health = player.health + 1
              }
              if (RandomChance(25)) {
                msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you suddenly realize that you may have gotten a bit turned around at some point or another because this place seems completely different area what you were intending to follow. Looking around, nothing about any of this seems familiar in the least, which means you're lost!<br/><br/><font color=\"dedede\">You're lost...</font color><br/><br/>**For the time being however you have been moved to your intended destination**<br/>")
                game.ndcycle = game.ndcycle + 1
                MoveObject (player, exit.to)
              }
              else if (RandomChance(25)) {
                msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you suddenly realize that you may have gotten turned around at some point or another. Matter of fact, all of this seems vaguely familiar, almost like you've been here before. Wait a second. You HAVE been here before! That means you travelled ALL night to wind up right back where you started before disembarking. What a waste of time and supplies!<br/><br/><font color=\"dedede\">You're back where you started!</font color><br/>")
                game.ndcycle = game.ndcycle + 1
                MoveObject (player, exit.parent)
              }
              else {
                game.ndcycle = game.ndcycle + 1
                MoveObject (player, exit.to)
              }
            }
          }
          else {
            if (game.rain=True) {
              msg ("Given you don't have a light to guide your way though, the intense prevailing darkness coupled with the light rain fall proves to be very challenging to hike through. You lose count the number of times you slip and fall, catch yourself on jagged thicket, get scratched across the face and stub various body-parts while trying to catch yourself. All and all, the trip was incredibly painful. Half-way through the night, you begin to wonder if you made a mistake trying to push on like this but with some good ole-fashioned perseverance, you continue on for another couple of hours. Finally, (after what seems like an eternity), morning finally breaks...<br/><br/><font color=\"dedede\">Due to your eventful night-time hike and the rain fall from above, as well as the injuries you've sustained and the fatigue of traveling adding up, you've lost -7 health!</font color><br/>")
              player.health = player.health - 7
              if (player.base_defense>=5) {
                msg ("<font color=\"dedede\">Although, because of how tough you are you really only lost -6 health.</font color>")
                player.health = player.health + 1
              }
              if (RandomChance(25)) {
                msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you suddenly realize that you may have gotten a bit turned around at some point or another because this place seems completely different area what you were intending to follow. Looking around, nothing about any of this seems familiar in the least, which means you're lost!<br/><br/><font color=\"dedede\">You're lost...</font color><br/><br/>**For the time being however you have been moved to your intended destination**<br/>")
                game.ndcycle = game.ndcycle + 1
                MoveObject (player, exit.to)
              }
              else if (RandomChance(25)) {
                msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you suddenly realize that you may have gotten turned around at some point or another. Matter of fact, all of this seems vaguely familiar, almost like you've been here before. Wait a second. You HAVE been here before! That means you travelled ALL night to wind up right back where you started before disembarking. What a waste of time and supplies!<br/><br/><font color=\"dedede\">You're back where you started!</font color><br/>")
                game.ndcycle = game.ndcycle + 1
                MoveObject (player, exit.parent)
              }
              else {
                game.ndcycle = game.ndcycle + 1
                MoveObject (player, exit.to)
              }
            }
            else if (game.storm=True) {
              msg ("Given you don't have a light to guide your way though, the exceptionally severe and dominanting darkness allied with the oppressive downpour and it's thunderous rumbles proves to be extremely dangerous to hike through. You constantly misjudge your surroundings and blunder hard to the ground, you slice open and ensnare various parts of your body on bushes and thicket, you recieve countless slashes across your face, and you stub various body-parts while trying to catch yourself from falling into mudholes, across slippery rocks and slimey trees. All and all, the trip was completely excruciating. Not even half-way through the night, you begin to wonder if you made a mistake trying to push on like this, especially with how dangerous it is but with some good ole-fashioned perseverance, you somehow manage to continue on for another couple of hours. Finally, (after what seems like a neverending night of misery and pain), morning finally breaks...<br/><br/><font color=\"dedede\">Due to your exceptionally dangerous night-time hike and the brutal storm in addition to it, as well as all the injuries you've sustained and the fatigue from traveling adding up, you've lost -9 health!</font color><br/>")
              player.health = player.health - 9
              if (player.base_defense>=5) {
                msg ("<font color=\"dedede\">Although, because of how tough you are you really only lost -8 health.</font color>")
                player.health = player.health + 1
              }
              if (RandomChance(25)) {
                msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you suddenly realize that you may have gotten a bit turned around at some point or another because this place seems completely different area what you were intending to follow. Looking around, nothing about any of this seems familiar in the least, which means you're lost!<br/><br/><font color=\"dedede\">You're lost...</font color><br/><br/>**For the time being however you have been moved to your intended destination**<br/>")
                game.ndcycle = game.ndcycle + 1
                MoveObject (player, exit.to)
              }
              else if (RandomChance(25)) {
                msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you suddenly realize that you may have gotten turned around at some point or another. Matter of fact, all of this seems vaguely familiar, almost like you've been here before. Wait a second. You HAVE been here before! That means you travelled ALL night to wind up right back where you started before disembarking. What a waste of time and supplies!<br/><br/><font color=\"dedede\">You're back where you started!</font color><br/>")
                game.ndcycle = game.ndcycle + 1
                MoveObject (player, exit.parent)
              }
              else {
                game.ndcycle = game.ndcycle + 1
                MoveObject (player, exit.to)
              }
            }
            else {
              msg ("<br/>Given you don't have a light to guide your way through the inky night and it's enveloping darkness, the trip proves to be quite challenging (and very chilling) to navigate! You fall a few times here and there but it's nothing too terrible. You also get stabbed by a few jagged bushes and you run into a couple of tree trunks by accident but despite these set-backs half-way through the night, you're still going strong. You manage to continue on for another couple of hours at this pace until finally, (after what seems like an eternity), morning finally breaks...<br/><br/><font color=\"dedede\">Due to your strenuous night hike, as well as some of the injuries you've sustained and the fatigue of traveling adding up, you've lot -5 health</font color><br/>")
              player.health = player.health - 5
              if (player.base_defense>=5) {
                msg ("<font color=\"dedede\">Although, because of how tough you are you really only lost -4 health.</font color>")
                player.health = player.health + 1
              }
              if (RandomChance(25)) {
                msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you suddenly realize that you may have gotten a bit turned around at some point or another because this place seems completely different area what you were intending to follow. Looking around, nothing about any of this seems familiar in the least, which means you're lost!<br/><br/><font color=\"dedede\">You're lost...</font color><br/><br/>**For the time being however you have been moved to your intended destination**<br/>")
                game.ndcycle = game.ndcycle + 1
                MoveObject (player, exit.to)
              }
              else if (RandomChance(25)) {
                msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you suddenly realize that you may have gotten turned around at some point or another. Matter of fact, all of this seems vaguely familiar, almost like you've been here before. Wait a second. You HAVE been here before! That means you travelled ALL night to wind up right back where you started before disembarking. What a waste of time and supplies!<br/><br/><font color=\"dedede\">You're back where you started!</font color><br/>")
                game.ndcycle = game.ndcycle + 1
                MoveObject (player, exit.parent)
              }
              else {
                game.ndcycle = game.ndcycle + 1
                MoveObject (player, exit.to)
              }
            }
          }
          msg ("<br/>Clothing Damage Placeholder. <br/>")
        }
        else if (RandomChance(25)) {
          msg ("<br/>You ultimately decide that foregoing sleep and traveling at night{if game.rain=True: through the rain}{if game.storm=True: through the thunderous storm} to gain some extra miles in your journey is worth the risk of potentially stumbling into any unseen dangers and pitfalls. You aren't sure what the fates have in store for you, but given your decision, you resolve to be extra careful tonight. You begin to ready yourself; you gather up and secure all your belongings, study the route you want to take and then you finally (and cautiously) move forward to begin your very dangerous night hike! <br/>")
          msg ("<br/>Trap/Pitfall Scenario Placeholder. <br/>")
          game.ndcycle = game.ndcycle + 1
          MoveObject (player, exit.to)
        }
        else if (RandomChance(25)) {
          msg ("<br/>You ultimately decide that foregoing sleep and traveling at night{if game.rain=True: through the rain}{if game.storm=True: through the thunderous storm} to gain some extra miles in your journey is worth the risk of potentially stumbling into any unseen dangers and pitfalls. You aren't sure what the fates have in store for you, but given your decision, you resolve to be extra careful tonight. You begin to ready yourself; you gather up and secure all your belongings, study the route you want to take and then you finally (and cautiously) move forward to begin your very dangerous night hike! <br/>")
          if (RandomChance(25)) {
            msg ("<br/>Most of it is very uneventful though (as you would expect), at least for the first half of the night. But as the fates would have it, later on, much to your surprise, you accidentally stumble upon something quite strange---enough so to instantly stop you in your tracks, every inch of you freezing completely still. Up ahead, among the enroaching  thicket and the dense bushes, you can see a prominent dark figure lying on the ground, although it's difficult to make out in such low lighting{if game.rain=True:, especially so under the veil of rain}[if game.storm=True:, especially so under the veil of rain}. You aren't exactly sure what you're looking at, but it could be a long, mostly flat rock, or a sleeping animal like a small bear, or possibly even another traveller who could be sleeping, hurt or...worse. If it is someone though, you don't see any signs of a fire, or shelter either, which is a bit peculiar. On the other hand, all of this could be a trap too.<br/>")
          wait {
            ClearScreen
            msg ("After considering the possibility, you cautiously approach the darkened formation or figure, all the meanwhile, studying your surroundings carefully for any signs of deception. To your relief nothing happens. As you reach the prominent figure, you finally discover that it appears to be a dead {random:human:elven:dwarven:dragon-descended:halfling:orc-descended:gnome:dark elven:goblin:succubus:incubus:alaraune:demon:cow-taur:dryad:goo:naga:centaur:neko:wold-taur:dragon:orc:doll:bee-taur} {random:male:female} {random:lying face down in a small puddle:lying face down in the sand:lying partially turned on their side:lying on the flat of their back:lying sprawled out:lying slumped over}. Based on what you can immediately surmise{random: they must of died because of the various, deep-set wounds in their back:they must of died because of the slice across their throat:they must of died because of the pool of blood surrounding them. Likely bloodloss:they definitely died from decapitation:they must of died because of the deep-set slice into their {random:right:left} side:they must have died because of the large bite wound, possibly from a large snake:they must of died from the knife or sword sized wound in their lower abdomen---probably in their sleep:they must have died...Hm. Actually, you can't seem to find any visible sign or cause of death. Poisoning, perhaps? You have no idea:they must have died...elsewhere? Because their body looks to be in rough condition, perhaps from a fall. Maybe the body was left here afterward}. You glance around for a moment in both curiosity and alarm. Whoever, or whatever killed your new friend could be lurking about the area still, despite the fact that the body looks to have been here for quite a long time and pretty much stripped of anything useful. <br/><br/>Suddenly, you think you spot something {random:clutched in the body's {random:left:right} hand:lying on the ground nearby:lying on the ground several feet away:lying across the clearing:stuffed underneath the body:lying on top of the body:in a pile of junk nearby, likely belonging to the body:left behind on the ground:partially buried in the dirt}. Intrigued, you finish inspecting the body, and then head over towards whatever it is you think you saw. Maybe something left behind on accident?<br/>")
            RSearch
            CloneObjectAndMove (torn_cloth, exit.to)
            CloneObjectAndMove (torn_cloth, exit.to)
            CloneObjectAndMove (torn_cloth, exit.to)
            if (RandomChance(50)) {
              DSearch
            }
            if (RandomChance(25)) {
              DSearch
            }
            msg ("<br/>Later, after taking anything that you can use from the deceased body (since they won't be needing it anymore) including, two pieces of pieces of torn cloth, you do your best to bury it underneath some loose top soil and small rocks and then finally, after several hours, continue on your way hoping for the best. As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you realize that against all odds you somehow managed to stay on course without getting turned around or lost. It actually turned out to be an uneventuful night as well, aside from the poor unfortunate soul you ran across and whom you had to bury. But luckily, you didn't really get hurt doing so and you didn't fall into any pitfalls or traps afterward either. All and all, it wasn't a bad bit of hiking. You're just a bit tired from the entire ordeal, digging a grave and not having slept a wink all night. Time to press on nonetheless!<br/><br/><font color=\"dedede\">You've lost -5 health from hiking all night and not sleeping. But you also used a lot of energy burying that body too, which has left you rather sore.</font color><br/>")
            player.health = player.health - 5
            if (player.base_defense>=5) {
              msg ("<font color=\"dedede\">Although, because of how tough you are you really only lost -4 health.</font color>")
              player.health = player.health + 1
            }
            game.ndcycle = game.ndcycle + 1
            MoveObject (player, exit.to)
          }
        }
        else if (RandomChance(25)) {
          msg ("<br/>Small Clearing Loot Scenario Placeholder.<br/>")
          game.ndcycle = game.ndcycle + 1
          MoveObject (player, exit.to)
        }
        else if (RandomChance(25)) {
          msg ("<br/>Crate/Box Loot Scenario Placeholder.<br/>")
          game.ndcycle = game.ndcycle + 1
          MoveObject (player, exit.to)
        }
        else {
          msg ("<br/>Happen Chance Loot Scenario Placeholder. <br/>")
          game.ndcycle = game.ndcycle + 1
          MoveObject (player, exit.to)
        }
      }
      else if (RandomChance(25)) {
        msg ("<br/>You ultimately decide that foregoing sleep and traveling at night{if game.rain=True: through the rain}{if game.storm=True: through the thunderous storm} to gain some extra miles in your journey is worth the risk of potentially stumbling into any unseen dangers and pitfalls. You aren't sure what the fates have in store for you, but given your decision, you resolve to be extra careful tonight. You begin to ready yourself; you gather up and secure all your belongings, study the route you want to take and then you finally (and cautiously) move forward to begin your very dangerous night hike! <br/>")
        msg ("<br/>Enemy Scenario. Placeholder. <br/>")
        game.ndcycle = game.ndcycle + 1
        MoveObject (player, exit.to)
      }
      else {
        msg ("<br/>You ultimately decide that foregoing sleep and traveling at night{if game.rain=True: through the rain}{if game.storm=True: through the thunderous storm} to gain some extra miles in your journey is worth the risk of potentially stumbling into any unseen dangers and pitfalls. You aren't sure what the fates have in store for you, but given your decision, you resolve to be extra careful tonight. You begin to ready yourself; you gather up and secure all your belongings, study the route you want to take and then you finally (and cautiously) move forward to begin your very dangerous night hike! <br/>")
        msg ("<br/>As the morning{if game.clear=True: illuminates the area}{if game.cloud=True: illuminates the area}{if game.rain=True: scatter-shines through the rain clouds}{if game.storm=True: brings the slightest illumination to the area} all around you, you realize that against all odds you somehow managed to stay on course without getting turned around or lost. It was actually a mostly uneventuful night as well. You didn't really get hurt, you didn't fall into any pitfalls or traps, you didn't find anything significant and you didn't run into anyone or anything. All and all, it was a pretty easy trip. You're just a bit tired from the entire ordeal and no sleeping a wink all night. Time to press on nonetheless!<br/><br/><font color=\"dedede\">You've lost -4 health from hiking all night and not sleeping!</font color><br/>")
        player.health = player.health - 4
        game.ndcycle = game.ndcycle + 1
        MoveObject (player, exit.to)
      }
    }
  }
  else if (result = "No, Stay Put") {
    msg ("<br/>You decide against traveling for the time being as it's extremely dangerous, especially without a light{if game.rain=True:...not to mention the rainfall would make the trip even more treacherous}{if game.storm=True:...not to mention the rainfall would make the trip even more treacherous}. You can always \"Rest\" as well, and get a fresh start in the morning.<br/>")
    MoveObject (player, exit.parent)
  }
}
}



Day Travel Function

if (RandomChance(25)) {
  msg ("<br/>Revitalization Scenario Placeholder<br/>")
  if (RandomChance(25)) {
    msg ("<br/>Helpful Healer Scenario Placeholder.<br/>")
    game.ndcycle = game.ndcycle + 1
    MoveObject (player, exit.to)
  }
  else if (RandomChance(25)) {
    msg ("<br/>Nap Scenario Placeholder<br/>")
    game.ndcycle = game.ndcycle + 1
    MoveObject (player, exit.to)
  }
  else if (RandomChance(25)) {
    msg ("<br/>Inspiring View/Scenery Placeholder. <br/>")
    game.ndcycle = game.ndcycle + 1
    MoveObject (player, exit.to)
  }
  else {
    msg ("<br/>Meet and Greet Placeholder.<br/>")
    game.ndcycle = game.ndcycle + 1
    MoveObject (player, exit.to)
  }
}
else if (RandomChance(25)) {
  msg ("<br/>Enemy Scenario Placeholder.<br/>")
  game.ndcycle = game.ndcycle + 1
  MoveObject (player, exit.to)
}
else if (RandomChance(25)) {
  msg ("<br/>Loot Scenario Placeholder.<br/>")
  if (RandomChance(25)) {
    msg ("<br/>Overburdened Traveler Scenario Placeholder.<br/>")
    game.ndcycle = game.ndcycle + 1
    MoveObject (player, exit.to)
  }
  else if (RandomChance(25)) {
    msg ("<br/>Crate/Chest Scenario Placeholder<br/>")
    game.ndcycle = game.ndcycle + 1
    MoveObject (player, exit.to)
  }
  else if (RandomChance(25)) {
    msg ("<br/>Clearing Placeholder. <br/>")
    game.ndcycle = game.ndcycle + 1
    MoveObject (player, exit.to)
  }
  else {
    msg ("<br/>Magical Rune Placeholder.<br/>")
    game.ndcycle = game.ndcycle + 1
    MoveObject (player, exit.to)
  }
}
else if (RandomChance(25)) {
  msg ("<br/>Performance/Skill Scenario Placeholder.<br/>")
  game.ndcycle = game.ndcycle + 1
  MoveObject (player, exit.to)
}
else {
  msg ("<br/>You travel onward for several hours{if game.clear=True: with the stiffling sun to guide your way}{if game.cloud=True: with the sun-soaked clouds}{if game.rain=True: and the drizzle of rain} providing some much needed relief during your hike}{if game.storm=True: through a heavy downpour, thunderous roars forcing the very ground to tremble in fear, and lightning strikes blinding your way}...<br/>")
game.ndcycle = game.ndcycle + 1
MoveObject (player, exit.to)
}

See anything that I don't?


Can you send me the game?


The problem is you still have the old scripts on the exits, and they do not have a parameter, so you get the error.

Back up your game, then open it in Notepad++. Search for "NightTravelWT". The first is okay, it is in the modified GO command. The second is like this:

      <exit alias="south" to="WT West Byway">
        <inherit name="southdirection" />
        <runscript />
        <script type="script">
          NightTravelWT
        </script>
      </exit>

You want to delete this bit:

        <runscript />
        <script type="script">
          NightTravelWT
        </script>

There is quite a few of them, I am afraid... You will need to do it for day travel too.


I did the corrections for the NightTravelWT Function but I'm getting one for DayTravelWT
Error running script: No parameters passed to DayTravelWT function - expected 1 parameters

The only problem is I searched for "DayTravelWT" but these are the only two results that popped up. What should I delete for it?

  <function name="NightTravelWT" parameters="exit"><![CDATA[
    if (game.ndcycle<=2) {
      DayTravelWT
    }
    else {
 <function name="DayTravelWT" parameters="exit"><![CDATA[

I have the sneaking suspicion you'll want me to split them from one another lol...


Just change the first block to this:

  <function name="NightTravelWT" parameters="exit"><![CDATA[
    if (game.ndcycle<=2) {
      DayTravelWT (exit)
    }
    else {

So the moving bit has been solved and the player is able to move between scripts without any problem, but I'm still getting this error from the night move which doesn't move the player the first time. The exit has to be clicked twice.

Error running script: Error compiling expression 'exit.to': Unknown object or variable 'exit'

This seems to be the very last issue.


I scoured the code---can't seem to figure out why it's happening, unless it's an error with the Function?


I think it is the ShowMenu in NightTravelWT. The script inside a ShowMenu has no access to local variables outside of it, so while there is exit in NightTravelWT, it does not exist inside the ShowMenu script. The solution is to save it as an attribute.

      menulist = Split("Yes, Travel Anyway;No, Stay Put", ";")
      ShowMenu ("", menulist, true) {
        if (result = "Yes, Travel Anyway") {

Becomes:

      menulist = Split("Yes, Travel Anyway;No, Stay Put", ";")
      game.savedexit = exit
      ShowMenu ("", menulist, true) {
        exit = game.savedexit
        if (result = "Yes, Travel Anyway") {

Hurrah! That seemed to work perfectly! Thank you so much, Pix. I really appreciate this. I don't notice any other problems.


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

Support

Forums