'this': Unknown object or variable 'this'

Not sure why this error is happening since I've been using "this" for quite a while now. On this particular object however it seems to be causing a problem. The If-Scripts of it work. Is there a problem I'm overlooking @_@?

Here's the code for one particular verb.

inky_lab_water.Object
Attributes
seenflag boolean
searchtrue boolean
alreadydone boolean

Drink Verb

ClearScreen
if (this.seenflag=True) {
  msg ("")
}
else {
  if (RandomChance(50)) {
    msg ("")
    wait {
      ClearScreen
      msg ("")
      if (RandomChance(15)) {
        msg ("")
        player.health = player.health + 8
        if (RandomChance(5)) {
          msg ("")
          player.healthy = True
          player.sick = False
          player.poison = False
        }
      }
      else if (RandomChance(15)) {
        msg ("")
        player.health = player.health + 7
        if (RandomChance(5)) {
          msg ("")
          player.healthy = True
          player.sick = False
          player.poison = False
        }
      }
      else if (RandomChance(15)) {
        msg ("")
        player.health = player.health + 6
        if (RandomChance(5)) {
          msg ("")
          player.healthy = True
          player.sick = False
          player.poison = False
        }
      }
      else if (RandomChance(15)) {
        msg ("")
        player.health = player.health + 5
        if (RandomChance(5)) {
          msg ("")
          player.healthy = True
          player.sick = False
          player.poison = False
        }
      }
      else if (RandomChance(15)) {
        msg ("")
        player.health = player.health + 4
        if (RandomChance(5)) {
          msg ("")
          player.healthy = True
          player.sick = False
          player.poison = False
        }
      }
      else if (RandomChance(15)) {
        msg ("")
        player.health = player.health + 3
        if (RandomChance(5)) {
          msg ("")
          player.healthy = True
          player.sick = False
          player.poison = False
        }
      }
      else {
        msg ("")
        player.health = player.health + 2
        if (RandomChance(5)) {
          msg ("")
          player.healthy = True
          player.sick = False
          player.poison = False
        }
      }
    }
    this.seenflag = True
  }
  else {
    msg ("")
  }
}
if (this.seenflag=True) {
  if (RandomChance(50)) {
    firsttime {
      msg ("")
      this.searchtrue = True
    }
  }
}

I still can't figure out why this "this" error is happening. Halp! LOL

Anonynn.


Does wait create a closure in Quest? I'm not sure, but I think it might. If so, code within a wait block wouldn't have access to variables from outside it, including this.


Ah, so I wonder if I embedded the "this" in a block of code that the game can't access. I don't THINK I did, but I'll definitely double check for that! I appreciate your time! :D

Anonynn.


Are you sure it's in this piece of code?


"this" is a powerful "pronoun"... unfortunally... It is also very vague...
It does not play very well where you want it to play...


K.V.

EDIT:

I tested it*, and, surprisingly, this works within a wait script. (I didn't think it would either, mrangel.)


If I copy the water to a game of its own, it doesn't throw an error.

CLICK HERE FOR THE EXAMPLE GAME'S CODE

<!--Saved by Quest 5.7.6404.15496-->
<asl version="550">
  <include ref="English.aslx" />
  <include ref="Core.aslx" />
  <game name="inky water">
    <gameid>1d119012-81c0-424a-b70d-bbd671972799</gameid>
    <version>1.0</version>
    <firstpublished>2017</firstpublished>
  </game>
  <object name="room">
    <inherit name="editor_room" />
    <object name="player">
      <inherit name="editor_object" />
      <inherit name="editor_player" />
      <health type="int">0</health>
    </object>
    <object name="Water">
      <inherit name="editor_object" />
      <visible type="boolean">false</visible>
      <object name="dirty_water">
        <inherit name="editor_object" />
        <usedefaultprefix type="boolean">false</usedefaultprefix>
        <alt type="stringlist">
          <value>dirty water</value>
          <value>dirty aqua</value>
          <value>d water</value>
        </alt>
        <stacklimit type="int">3</stacklimit>
        <stackverbs type="stringlist">
          <value>Look at</value>
          <value>Drop</value>
        </stackverbs>
        <stacklimitreached>You can carry no more. </stacklimitreached>
        <price type="int">0</price>
        <lastsfor type="int">0</lastsfor>
        <cannothold type="boolean">false</cannothold>
        <alias>Dirty Water</alias>
        <drop type="boolean">false</drop>
        <volume type="int">0</volume>
        <inventoryverbs type="stringlist">
          <value>Look at</value>
        </inventoryverbs>
        <take type="boolean">false</take>
        <takemsg>You cannot take it{once:, however, if you have a container, try the "Fill" verb on it}. </takemsg>
        <watersource />
        <displayverbs type="stringlist">
          <value>Look at</value>
        </displayverbs>
        <listalias><![CDATA[<font color= "0093ff">Dirty Water</font color> ]]></listalias>
        <liquidsource />
        <saveloadatts type="stringlist" />
        <stackparent type="object">dirty_water</stackparent>
        <look type="script"><![CDATA[
          msg ("<br/>This water looks like it came from a pond. It isn't very clear and you can see bits of something floating around inside. Yuck...Still this could be used as something to drink if you're desperate enough but it probably won't be safe...and it may yield some strange results.<br/><br/><u>The volume of this object is</u>: 0")
        ]]></look>
        <ondrop type="script">
        </ondrop>
        <drink type="script"><![CDATA[
          if (RandomChance(50)) {
            msg ("<br/>The warm, dirty water glides downs your throat making you gag a little; it's not very refreshing you but it did manage to quench some of your thirst. <br/>")
            if (RandomChance(5)) {
              player.health = player.health + 5
              msg ("<br/>Somehow it refreshes you as well, so much in fact that you feel better!<br/><br/>You gain + 5 health!<br/>")
            }
          }
          else {
            player.health = player.health - 5
            msg ("<br/>After drinking the dirty water, you suddenly feel sick to your stomach. Moments later, your stomach turns which causes you to vomit! Ugh!! You feel worse now...<br/>")
            if (RandomChance(10)) {
              if (not player.feet = "goblin") {
                msg ("<br/>After drinking the dirty water, you suddenly notice an odd sensation sweeping across your feet like they are reshaping a little. From there you can feel your toes lengthen and gain another joint that they didn't previously have. It gives your feet the appearance of being long and gangly, which looks absolutely disgusting. Moments later, after your feet have completely warped before your very eyes. You also notice that your {player.skin} skin fades from its normal color around your ankles, and becomes a deep green across the entirety of your feet! They look like a goblin’s now!<br/>")
                SetTo ("feet", "goblin")
              }
              else {
                msg ("<br/>After drinking the dirty water, you feel a strange sensation spreading throughout your body, and focusing specifically on your feet...but...ultimately, nothing happens. How weird, or lucky...<br/>")
              }
            }
            else if (RandomChance(10)) {
              if (not player.feet = "centaur") {
                msg ("<br/>{if player.gender=female:After drinking the dirty water, you suddenly notice an odd sensation sweeping across your feet like they are reshaping a little. From there, it feels like...Oh no! Your toes! They look as though they are growing smaller and smaller by the second! What's happening? You watch in horror as the skin of your feet begins hardening; first becoming less pliable, then turning calloused, then extremely rough, and then rounding out like some kind of bone! At the same time, your toes have become microscopic in size within seconds --- and then the bone that your skin is becoming slowly overtakes them little by little. Ah! Y-your growing....hooves!? You lose most of the feeling in your feet at this point, and your balance is terribly off, but it feels like you could pass over any terrain without getting hurt too badly, not to mention the fact that you could deliver a hell of a kick! You notice that they are also smaller and daintier than a normal horses meaning your feet must have become like a centauress'. You aren't sure how to feel about this, but wearing shoes is going to SUCK.}{if player.gender=male:After drinking the dirty water, you suddenly notice an odd sensation sweeping across your feet like they are reshaping a little. From there, it feels like...Oh no! Your toes! They look as though they are growing smaller and smaller by the second! What's happening? You watch in horror as the skin of your feet begins hardening; first becoming less pliable, then turning calloused, then extremely rough, and then rounding out like some kind of bone! At the same time, your toes have become microscopic in size within seconds --- and then the bone that your skin is becoming slowly overtakes them little by little. Ah! Y-your growing....hooves!? You lose most of the feeling in your feet at this point, and your balance is terribly off, but it feels like you could pass over any terrain without getting hurt too badly, not to mention the fact that you could deliver a hell of a kick! You notice that they are also larger and clumsier than a normal horses meaning your feet must have become like a centaur's. You aren't sure how to feel about this, but wearing shoes is going to SUCK.}} <br/>")
              SetTo ("feet", "centaur")
            }
            else {
              msg ("<br/>After drinking the dirty water, you feel a strange sensation spreading throughout your body, and focusing specifically on your feet...but...ultimately, nothing happens. How weird, or lucky...<br/>")
            }
          }
        }
        ]]></drink>
      </object>
    </object>
    <object name="inky_lab_water">
      <inherit name="editor_object" />
      <usedefaultprefix type="boolean">false</usedefaultprefix>
      <alt type="stringlist">
        <value>inky water</value>
        <value>dark water</value>
        <value>black water</value>
        <value>fresh water</value>
        <value>clean water</value>
        <value>cold water</value>
      </alt>
      <stacklimit type="int">3</stacklimit>
      <stackverbs type="stringlist">
        <value>Look at</value>
        <value>Drop</value>
      </stackverbs>
      <stacklimitreached>You can carry no more. </stacklimitreached>
      <price type="int">0</price>
      <lastsfor type="int">0</lastsfor>
      <cannothold type="boolean">false</cannothold>
      <alias>Inky Laboratory Water</alias>
      <drop type="boolean">false</drop>
      <volume type="int">0</volume>
      <inventoryverbs type="stringlist">
        <value>Look at</value>
      </inventoryverbs>
      <take type="boolean">false</take>
      <takemsg>You cannot take it{once:, however, if you have a container, try the "Fill" verb on it}. </takemsg>
      <watersource />
      <displayverbs type="stringlist">
        <value>Look at</value>
        <value>Drink</value>
        <value>Swim</value>
        <value>Fill Containers</value>
      </displayverbs>
      <listalias><![CDATA[<font color= "0093ff">Dirty Water</font color> ]]></listalias>
      <liquidsource />
      <saveloadatts type="stringlist" />
      <seenflag type="boolean">false</seenflag>
      <searchtrue type="boolean">false</searchtrue>
      <alreadydone type="boolean">false</alreadydone>
      <stackparent type="object">dirty_water</stackparent>
      <look type="script"><![CDATA[
        game.text_processor_this = this
        msg ("<br/>You can see a dark pool of{if this.seenflag=True: fresh cave-}{if this.seenflag=False: inky }water before you{if this.seenflag=False:; whether the water is dark because there is very little light shining upon it or the actual color is black is anyone's guess right now. You definitely need a better look to find out though. Alternatively however, you could just stay away from it entirely since it could be filled with dangerous creatures or it might not even be water at all..}.<br/><br/><u>The volume of this object is</u>: 0")
      ]]></look>
      <ondrop type="script">
      </ondrop>
      <drink type="script"><![CDATA[
        ClearScreen
        if (this.seenflag=True) {
          msg ("<br/>You approach one of the many edges of the dark cold water. Afterward, you reach down again and scoop a handful of it into your palms, the excess pouring down between your fingers. Afterward, you bring it to your mouth and proceed to gingerly sip it. The cool liquid brings instant relief to your dry mouth and coats the back of your throat before winding downward into your stomach bringing with it a wonderful sensation. Yum! You do this a couple of times until feeling completely satisfied and a little full as well.")
        }
        else {
          if (RandomChance(50)) {
            msg ("<br/>You approach an edge of the murky black water before you and inspect it closely from side to side, especially since you're very unsure about it's contents and possibly it's consistency as well. After several moments, you conclude that it <i>seems</i> harmless enough and you haven't spotted anything living inside, nor have you heard splashes from anything that could be living inside---so....perhaps it's okay to touch? You move into a kneeling position, extend your pointer finger and then poke the calm, cold surface. Ripples spread outward but quickly dissipate. As you retract your finger, you can see that it looks completely fine and looks wet. Naturally. Hm. So it's okay to touch. It actually feels like normal water. That wasn't as bad as you were anticipating. You try to touch it again and retract your finger without incident. Okay. So definitely safe to touch. You hesitantly dip your entire hand inside and cup it to retrieve some water out of it.<br/><br/>Upon careful inspection (by the light of the blue torches) you can see nothing out of the ordinary about this water. It's cold, it doesn't have much of a scent except for minerals and it's very clear. Matter of fact, you can't find a single blemish within. Of course, this warrants more testing. You simple turn your hand and dump it to the ground. Afterward, you carefully tread back to the edge and grab up some more. Under the light of the torches again, you inspect the captured liquid but once more it's clean looking, cold and blemish free. How interesting, this water appears completely normal. You can't find a single thing wrong with it. Of course, there's only one way to find out for sure. You bring it up to your lips and smell it---then you taste it. Hm. Tastes okay. You sip a little more and again, it feels very natural, cold and quite refreshing on top of that.<br/><br/>You wait a few minutes...Your stomach feels fine. So everything checks out. It looks, smells and tastes exactly like water---cold water at that, which is a rarity. You don't see anything living inside either which means you might not have to worry about getting sick from drinking too much of it. You shrug and conclude that this makes sense. Rold likely wouldn't surround his laboratory with something dangerous and it seems perfect for relaxing as well---and it works for magic that requires water too. <br/><br/>The only thing wrong with this place are the distant dark edges, that which lies beyond the light, you can't help but feel a little creeped out by that unknown. Despite this though, you have found a fresh source of water to drink from, which is very useful!")
            if (RandomChance(15)) {
              msg ("<br/><font color=\"dedede\">You've gained +8 health and you feel much better!</font color> ")
              player.health = player.health + 8
              if (RandomChance(5)) {
                msg ("<br/><font color=\"dedede\">It's so refreshing in fact that all of your bodily ailments (like poison and sickness) have been cured and flushed from your system as well! Wow! Water is so good for you!</font color>")
                player.healthy = True
                player.sick = False
                player.poison = False
              }
            }
            else if (RandomChance(15)) {
              msg ("<br/><font color=\"dedede\">You've gained +7 health and you feel much better!</font color> ")
              player.health = player.health + 7
              if (RandomChance(5)) {
                msg ("<br/><font color=\"dedede\">It's so refreshing in fact that all of your bodily ailments (like poison and sickness) have been cured and flushed from your system as well! Wow! Water is so good for you!</font color>")
                player.healthy = True
                player.sick = False
                player.poison = False
              }
            }
            else if (RandomChance(15)) {
              msg ("<br/><font color=\"dedede\">You've gained +6 health and you feel much better!</font color> ")
              player.health = player.health + 6
              if (RandomChance(5)) {
                msg ("<br/><font color=\"dedede\">It's so refreshing in fact that all of your bodily ailments (like poison and sickness) have been cured and flushed from your system as well! Wow! Water is so good for you!</font color>")
                player.healthy = True
                player.sick = False
                player.poison = False
              }
            }
            else if (RandomChance(15)) {
              msg ("<br/><font color=\"dedede\">You've gained +5 health and you feel much better!</font color> ")
              player.health = player.health + 5
              if (RandomChance(5)) {
                msg ("<br/><font color=\"dedede\">It's so refreshing in fact that all of your bodily ailments (like poison and sickness) have been cured and flushed from your system as well! Wow! Water is so good for you!</font color>")
                player.healthy = True
                player.sick = False
                player.poison = False
              }
            }
            else if (RandomChance(15)) {
              msg ("<br/><font color=\"dedede\">You've gained +4 health and you feel much better!</font color> ")
              player.health = player.health + 4
              if (RandomChance(5)) {
                msg ("<br/><font color=\"dedede\">It's so refreshing in fact that all of your bodily ailments (like poison and sickness) have been cured and flushed from your system as well! Wow! Water is so good for you!</font color>")
                player.healthy = True
                player.sick = False
                player.poison = False
              }
            }
            else if (RandomChance(15)) {
              msg ("<br/><font color=\"dedede\">You've gained +3 health and you feel much better!</font color> ")
              player.health = player.health + 3
              if (RandomChance(5)) {
                msg ("<br/><font color=\"dedede\">It's so refreshing in fact that all of your bodily ailments (like poison and sickness) have been cured and flushed from your system as well! Wow! Water is so good for you!</font color>")
                player.healthy = True
                player.sick = False
                player.poison = False
              }
            }
            else {
              msg ("<br/><font color=\"dedede\">You've gained +2 health and you feel much better!</font color> ")
              player.health = player.health + 2
              if (RandomChance(5)) {
                msg ("<br/><font color=\"dedede\">It's so refreshing in fact that all of your bodily ailments (like poison and sickness) have been cured and flushed from your system as well! Wow! Water is so good for you!</font color>")
                player.healthy = True
                player.sick = False
                player.poison = False
              }
            }
            this.seenflag = True
          }
          else {
            msg ("<br/>You slowly approach the edge of the stone platform and then peer downward at the murky black water to inspect it, especially since you're very unsure about it's contents and possibly it's consistency as well. After several moments however, you conclude that it seems harmless enough and you haven't spotted anything living inside, nor have you heard splashes from anything that could be living inside---so....perhaps it's okay to touch? You move into a kneeling position, extend your pointer finger but hesitate at the last possible moment. Hrm. Then again, if something <i>is</i> lurking around in there it's probably just waiting for some {if player.gender=female:dumb bimbo}{if player.gender=male:buffoon} to stick their stupid finger inside. You slowly retract your limb. Having scared yourself, you back away from the pool for the time being. Perhaps you just need time to regather your nerve before trying again. ")
          }
        }
        if (this.seenflag=True) {
          if (RandomChance(65)) {
            firsttime {
              msg ("<br/>As you stand near the edge of the water again ready to capture some in your hands, you suddenly spot something shimmering deep down inside via the bright light of the torch. At first you think you're seeing some kind of glare off the surface, but as you tilt your head to the side with curosity and then move down into a kneeling position, you confirm that light is reflecting off something floating within. The question is, do you want to dive in and go get it? You'll have to <i>swim</i> for it. ")
              this.searchtrue = True
            }
          }
        }
      ]]></drink>
      <swim type="script"><![CDATA[
        if (this.seenflag=True) {
          if (this.searchtrue=True) {
            if (this.alreadydone=False) {
              msg ("<br/>You've seen the glimmer down in the bottom of the pools, now you just have to decide if you want to go after it or not. Is it worth the risk? What if it isn't what you think it is? What if it's worse? You also have to consider whether or not this is a trap of some kind, however unlikely.")
              menulist = Split("Yes;No", ";")
              ShowMenu ("", menulist, true) {
                if (result = "Yes") {
                  msg ("<br/>You decide that whatever is lurking down there <i>must</i> be uncovered. Your natural curiosity is just far too strong to simply ignore a beautiful shiny like that. So after glancing from side to side to make sure no one was watching, you strip out of your excess clothes, if any, and then proceed to drop any supplies your carrying so they don't get wet. After leaving everything you own by one of the blue burning torches, you stand at the edge of the stone platform, peer down inside at the strange shimmer, line yourself up with it and then proceed to dive on in, <b><i>BLOOSH!</i></b> After disappearing beneath the surface and being engulfed by the abyss waiting below, large ripples cascade through the pool until reaching far beyond the light of the torches and venturing into the unknown. <br/><br/>As you reach the bottom, you clasp the shiny bauble in hand and then race back toward the surface, your body moving furiously towards the faint blue glow. <b>SPLASH!</b> You break the surface of the calm pool and scurry back onto the stone platform waiting nearby. Once you roll onto it, you glance over at whatever it is you grabbed...")
                  if (RandomChance(65)) {
                    RSearch
                    DSearch
                    CLootSearch
                    this.alreadydone = True
                    player.lust = 0
                    msg ("<br/>Afterward, you proceed to warm up by the nearest torch and then get dressed again ready to move on with the next part of your journey.")
                  }
                  else {
                    msg ("<br/>You decide that whatever is lurking down there <i>must</i> be uncovered. Your natural curiosity is just far too strong to simply ignore a beautiful shiny like that. So after glancing from side to side to make sure no one was watching, you strip out of your excess clothes, if any, and then proceed to drop any supplies your carrying so they don't get wet. After leaving everything you own by one of the blue burning torches, you stand at the edge of the stone platform, peer down inside at the strange shimmer, line yourself up with it and then proceed to dive on in, <b><i>BLOOSH!</i></b> After disappearing beneath the surface and being engulfed by the abyss waiting below, large ripples cascade through the pool until reaching far beyond the light of the torches and venturing into the unknown. <br/><br/>As you reach the bottom, you clasp the shiny bauble in hand and then race back toward the surface, your body moving furiously towards the faint blue glow. <b>SPLASH!</b> You break the surface of the calm pool and scurry back onto the stone platform waiting nearby. Once you roll onto it, you glance over at whatever it is you grabbed...but unfortunately, it's just a worthless {random:rock:hairpin:pin:clip:hairclip:piece of shiny stone:rusted metal}. Bah! All that work for nothing. Maybe you just have rotten luck right now or something. ")
                    this.alreadydone = True
                  }
                }
                else if (result = "No") {
                  msg ("<br/>You figure the risk far outweights your natural curiosity---at least in your current frame of mind. Perhaps you should just leave whatever it is alone for now and then come back later to see if it's still there or something. You certainly don't want to drown going after something that might turn out to be completely useless. With that decided, you back away from the edge and rethink what you want to do next. ")
                }
              }
            }
            else {
              msg ("<br/>You've already retrieved the loot at the bottom of the pool. There isn't much there anymore. ")
            }
          }
          else {
            msg ("<br/>Well, the water seems safe enough --- but you have no real reason to just dive in all whimsy-like, do you? Sure, it might feel refreshing, but it feels really cold and you'd wind up completely soaked, you'd have to wait to dry off as well---and you simply don't have time for all that. Perhaps for the time being you should just control your urges to jump in and come back again later. Now if you had a <i>reason</i> to go, sure, but right now that isn't the case. <br/><br/>Then again with all those reasons aside, you could just go and enjoy yourself, who cares? It might even turn out to be quite refreshing. <br/><br/>So what do you feel like doing? Go for a swim, postpone for now?")
            menulist = Split("Dive In;Nah", ";")
            ShowMenu ("", menulist, true) {
              if (result = "Dive In") {
                if (HasAttribute(player, "nakedtop") and HasAttribute(player, "nakedbottom")) {
                  msg ("<br/>Er...what about your clothes? Should you strip out of them first and skinny dip? Or just forego? Or do anything else to Cancel. ")
                  menulist = Split("Yes;No", ";")
                  ShowMenu ("", menulist, true) {
                    if (result = "Yes") {
                      switch (GetHighestAtt()) {
                        case ("sexy") {
                          msg ("<br/>You certainly don't want to soak your clothes or any of your supplies, plus skinny dipping sounds kind of fun and exciting{if player.lust>=5:, especially with how horny you're feeling right now. Maybe a cold dip is just what the doctor ordered}. On top of this reasoning the water is extremely cold so it'll be nice to get dressed back up again afterward in warm clothing. Now then, after stripping down to your birthday suit, {if player.gender=female:your {if player.gavebirth=True:dark}{if player.gavebirth=False:light pink} nipples hard as stone}{if player.gender=male:your {player.penissize} {random:dick:cock:shaft:man-hood:large cannon:beast} sticking straight out in front of you ready to impale}, you toss your clothes on top of any other supplies you're carrying with you and then without a second thought, you energetically {random:cannon-ball:swan dive:flip:back-flip:belly-flop} into the very, very cold water, <i><b>BLOOSH!</i></b>!<br/><br/>Immediately following your {random:crazy:outrageous:outlandish} splash, giant ripples cascade outward to the forgotten edges of the pool, inherently disturbing everything inside. Seconds later, you rise up from the depths shivering, every single part of your body delightfully tingling.{if player.feet=naga: Wow! That feels really great against the scales of your long serpentine body which is smoothly gliding back and forth beneath the surface}{if player.legs=goo:. Ah...how relaxing. Despite the freezing sensation, it really does make you feel like a million gold. To reconnect with your natural habitat again simply fills you with joy. The water feels great mixing with your gooey body. You almost feel at one with it}. {if player.gender=male:It's too bad your {random:dick:cock:shaft:man-hood:large cannon:beast} has practically retreated back up into your body}{if player.gender=female:After several minutes of this, the upper half of your body isn't fairing so well. Initially it felt good but the delightful tingle against your nipples has turned into a mild stinging which is getting progressively worse}. Brr! Your teeth begin to chatter. ")
                          wait {
                            ClearScreen
                            msg ("<br/>After wading around for another five to ten minutes, the cold starts to become unbearable.{once: That certainly came about faster than you first anticipated.} That's alright though, you were kind of getting bored of it anyway. You head back to the edge and climb onto the stone platform. Luckily, your dry clothes are waiting for you and they've been warmed by the nearby torches. Within that same glow you begin to warm up as well and gradually stop dripping and shivering. About ten minutes later, you dress yourself. Clear-headed, you ready yourself to continue on. <br/><br/><font color=\"dedede\">Your cold dip has left you completely clearheaded. You've also lost all your lust!</font color> ")
                            player.lust = 0
                          }
                        }
                        case ("sympathy") {
                          msg ("<br/>Um...on second thought, you aren't really in the mood to skinny dip. You're simply too shy to do something like that right now. You back away from the edge for the time being and rethink your plans. ")
                        }
                        case ("sarcasm") {
                          msg ("<br/>You certainly don't want to soak your damn clothes or any of your supplies, plus skinny dipping sounds kind of fun and exciting{if player.lust>=5:, especially with how fucking horny you're feeling right now. Maybe a cold dip is just what the doctor ordered, otherwise you're likely to mount the first thing that comes along}. On top of this reasoning the water is extremely cold so it'll be nice to get dressed back up again afterward in warm clothing. Now then, after stripping down to your birthday suit, {if player.gender=female:your {if player.gavebirth=True:dark}{if player.gavebirth=False:light pink} nipples hard as stone}{if player.gender=male:your {player.penissize} {random:dick:cock:shaft:man-hood:large cannon:beast} sticking straight out in front of you ready to impale}, you carelessly toss your clothes on top of any other supplies you're carrying with you and then without a second thought, you {random:cannon-ball:swan dive:flip:back-flip:belly-flop} into the very, very cold water, <i><b>BLOOSH!</i></b>!<br/><br/>Immediately following your {random:crazy:outrageous:outlandish} splash, giant ripples cascade outward to the forgotten edges of the pool, inherently disturbing everything inside. Seconds later, you rise up from the depths shivering, every single part of your body delightfully tingling. Holy shit, that's cold! {if player.feet=naga: But wow! It certainly does feel great against the scales of your long serpentine body which is smoothly gliding back and forth beneath the surface}{if player.legs=goo:. But at the same time it's incredibly relaxing. It really does make you feel like a million gold. To reconnect with your natural habitat again simply fills you with joy. The water feels great mixing with your gooey body. You almost feel at one with it}. {if player.gender=male:It's too bad your {random:dick:cock:shaft:man-hood:large cannon:beast} has practically retreated back up into your body}{if player.gender=female:After several minutes of this, the upper half of your body isn't fairing so well. Initially it felt good but the delightful tingle against your nipples has turned into a mild stinging which is getting progressively worse}. Brr---shit! Your teeth begin to chatter uncontrollably. ")
                          wait {
                            ClearScreen
                            msg ("<br/>After wading around for another five to ten minutes, the cold starts to become even more unbearable.{once: That certainly came about faster than you first anticipated.} That's alright though, you were kind of getting bored of it anyway. You head back to the edge and climb onto the stone platform. Luckily, your dry clothes are waiting for you and they've been warmed by the nearby torches. Within that same glow you begin to warm up as well and gradually stop dripping and shivering. About ten minutes later, you dress yourself. Clear-headed, you ready yourself to continue on. <br/><br/><font color=\"dedede\">Your cold dip has left you completely clearheaded. You've also lost all your lust!</font color> ")
                            player.lust = 0
                          }
                        }
                        case ("serious") {
                          msg ("<br/>Hm. On second thought, you have much better things you could be doing with your time right now. You aren't going to waste it on skinny dipping or anything foolish like that. You back away from the edge for the time being and reconsider your plans from here. ")
                        }
                      }
                    }
                    else if (result = "No") {
                      msg ("<br/>Clothes, no clothes? Who cares? You toss down your things and without a second thought you brashly dive into the very, very cold water, <i><b>BLOOSH!</b></i>. Immediately following your wickedly large splash, giant ripples cascade outward to the forgotten edges of the pool. Seconds later, you rise up from the depths shivering{if player.feet=naga: despite how good it feels against the scales of your long serpentine body which is smoothly gliding back and forth beneath the surface}{if player.legs=goo:. Despite this, it feels really nice to reconnect with your natural habitat again. The water feels great mixing with your gooey body. You almost feel at one with it}. After wading around for a good ten or fifteen minutes, you finally get bored and then head back to the edge so as to climb out back onto the stone platform of sorts. Naturally, you and your clothing are completely drenched from top to bottom. <br/><br/>You try to warm up by the heat of the nearest blue torch before you and hope it'll get you dry but after several minutes of standing there and still dripping profusely, you idly realize it'll take much longer then you{once: first} anticipated. You also can't stop shivering! Hopefully, you don't wind up sick because of this...About thirty minutes later, you find that you're certainly more dry than you were before; now it's more like lightly drenched. But the cold feeling hasn't eased much to your dissatisfaction. Maybe it'll pass in time. <br/><br/><font color=\"dedede\">You're completely soaked from head to toe and feel extremely cold!</font color>")
                      if (RandomChance(35)) {
                        player.cold = True
                      }
                    }
                  }
                }
              }
              else if (result = "Nah") {
                msg ("<br/>For the time being, you decide to back off from the edge of the dark pool. You do have better things to be doing right now for one...and two you really don't feel like getting soaked and being freezing afterward. Maybe if you have time you'll reconsider this particular decision but for now this is probably for the best.  ")
              }
            }
          }
        }
        else {
          msg ("<br/>Uh...there's no way in hell you're leaping into water that looks that creepy. Who knows what's lurking inside? The last thing you want is to become chow or some chew-toy to some monster waiting for an easy meal...{once:Perhaps you need to try something else.}")
        }
      ]]></swim>
      <fillcontainers type="script"><![CDATA[
        msg ("<br/>Would you like to fill up your empty container(s) with this {if this.seenflag=False:inky black, possibly dangerous water?}{if this.seenflag=True:clear refreshing cave-water}? {once:<i>Yes</i> or <i>No</i>, or do anything else to Cancel.}")
        menulist = Split("Yes;No", ";")
        ShowMenu ("", menulist, true) {
          if (result = "Yes") {
            waterskin_clone = PlayersClone(waterskin)
            if (not waterskin_clone = null) {
              if (waterskin_clone.full = True) {
                msg ("<br/>Your waterskin is full at the moment. You'll need to dump it out or drink the contents first before you can fill it up anymore.  ")
              }
              else {
                msg ("<br/>You fill up your waterskin with {if this.seenflag=True:the clear, clean water}{if this.seenflag=False:the inky black...wait a second! This water isn't dark at all. It was definitely the light playing with your eyes. Matter of fact, it looks extremely clear and smells exactly like minerial water. Wow! You kind of guess this makes sense given that Rold likely wouldn't surround his laboratory with something dangerous. It makes you wonder if he swims in there too}.")
                waterskin_clone.fresh_water = True
                waterskin_clone.full = True
                this.seenflag = True
              }
            }
            else {
              msg ("<br/>You'll need to find some type of container first, otherwise you have no way of carrying the liquid for any extended period of time. ")
            }
          }
          else {
            msg ("<br/>You decide against it for the time being. ")
          }
        }
      ]]></fillcontainers>
    </object>
  </object>
</asl>

How do I get to the inky lab water during play?


I may have resolved the drinking "this" (the one I posted code for) because it's not happening anymore. But yeah, "this" works within "If-scripts and numerous blocks of code because I have a million of them within it. All I use are clones of objects so I have to use "this" or the game wouldn't recognize the objects.

Aside from all that, the second and final "this" error happening within the same object but on a different verb has been narrowed down to one specific instance. So I'm going to rearrange it a little and see if that fixes the problem. I'll let you guys know what I find ^_^

Anonynn.


K.V.

I'm going to rearrange it a little and see if that fixes the problem.

Good luck!

I'll let you guys know what I find

Groovy. (Inquiring minds want to know.)


So I basically couldn't figure out what was causing the "this" problems, so instead of cloning that particular object, I used the original name instead and all the scripts work perfectly now. The mysteries of life. What's strange is I do have objects in similar fashions that use "this" because I used clones, but I guess the role of the object matters. Maybe the other this' work because they are in the player's inventory. I dunno. Bug perhaps.

Anonynn.


K.V.

Was it fillcontainers?

Just in case you run into this problem again, from what I could discern, you need this at the beginning of each separate script:

game.text_processor_this = this

(I discerned that while playing with this.)


fillcontainers had this in text processor commands. That's what made me look at it.


Just in case it happens to you again in a different script, you could check for the existence of that line in the code.


Yup. I had added that script. That is for the text processor however of cloned objects. I don't think it works for actual Scripts.

Anonynn.


K.V.

> I don't think it works for actual Scripts.

I just use game.this = this, then, I use game.this in place of this in the scripts that don't like this.

I didn't know about game.text_processor_this = this until I saw it in your code, but using game.this really takes care of everything, as long as you're willing to type "game.this" every time you'd like to just type "this".


As long as it works, it's all good.

(I'm just tinkering with things that tonight, just to see how many ways there are to accomplish the same goal using Quest. Hehehe.)


Does wait create a closure in Quest? I'm not sure, but I think it might. If so, code within a wait block wouldn't have access to variables from outside it, including this.

See here:
http://docs.textadventures.co.uk/quest/blocks_and_scripts.html


K.V.

The text processor must check for the existence of (or value of) game.text_processor_this each time it's called (or something):

game.text_processor_this = this
if (this.alias = null) {
  this.alias = this.name
}
msg ("(normal msg)  You use {this.article} ({this.article} being {this.prefix} {this.alias}).<br/>")
msg ("(text processor msg): You use {this.article}. (FYI: \"{this.article}\", in this case, is {this.prefix} {this.alias}).<br/>")
wait {
  msg ("(wait script - normal msg) You use {this.artictle} ({this.article} being {this.prefix} {this.alias}) inside of the <code>wait</code> script.<br/>")
  msg ("(wait script - text processor msg): You use {this.article}. (FYI: \"this\", in this case, is {this.prefix} {this.alias}.)<br/>")
  ShowMenu ("Click something here, too:", Split("ShowMenu choice one;ShowMenu choice two", ";"), true) {
    msg ("(ShowMenu msg) 'this' is: {this.name}.<br/>")
    Ask ("Will this recognize this?") {
  msg ("(Ask msg) 'this' is: {this.alias}.")
}
  }
}
show menu ("Click something here, too:", Split("show menu choice one;show menu choice two", ";"), true) {
  msg ("(show menu msg) 'this' is: {this.name}.<br/>")
}
ask ("Will this recognize this?") {
  msg ("(ask msg) 'this' is: {this.alias}.")
}

> use thingy
(normal msg) You use it (it being thingy).

(text processor msg): You use it. (FYI: "it", in this case, is thingy).

Click something here, too:
(ask msg) 'this' is: thingy.
- show menu choice one
(show menu msg) 'this' is: thingy.

(wait script - normal msg) You use (it being thingy) inside of the wait script.

(wait script - text processor msg): You use it. (FYI: "this", in this case, is thingy.)

(ShowMenu msg) 'this' is: thingy.

(Ask msg) 'this' is: thingy.


The way the text processor does it means "this" will work in ShowMenu, which it normally does not, but it will not work inside a function call such as "{=CapFirst(this.alias)} is here.", as in that context this will refer to the function. I do not think it actually checks it has been set, and indeed if you fail to set it at one point it will use the last value you did set, which has the potential for some confusing bugs!


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

Support

Forums