Question Not Leading To Changes

I'm somehow getting the question wrong on this object. When I click Repair, it pops me the question but when I tick Yes it doesn't then run the rest of it. Instead there's no response until I try to do anything else and then if I type Hack or anything else, I get:

Error running script: Error compiling expression 'result': RootExpressionElement: Cannot convert type 'String' to expression result of 'Boolean'

Any idea what I'm doing wrong?

  <object name="biometric reader">
      <inherit name="editor_object" />
      <repair type="script">
        if (not GetBoolean(biometric reader, "repaired")) {
          Ask ("Are you ready to repair the door?") {
            get input {
              if (result) {
                SetObjectFlagOn (biometric reader, "repaired")
                msg ("You spend some time repairing the device.")
              }
              else {
                msg ("You walk away.")
              }
            }
          }
        }
        else if (GetBoolean(biometric reader, "repaired")) {
          msg ("It's already been repaired.")
        }
      </repair>
      <look type="script">
        if (not GetBoolean(biometric reader, "repaired")) {
          msg ("It's a pretty advanced biometric reader which has been badly damaged.  It looks like someone has hacked away at it, breaking the casing and damaging the internal workings.  It requires two electrical scrap and a special item to repair.")
        }
        else {
          msg ("Someone broke the biometric reader, and someone else repaired it.  Unless you have the right key card *and* appropriate biometric readings, you can't use the card reader -- unless you're a rapid hacker.")
        }
      </look>
      <displayverbs type="stringlist">
        <value>Look at</value>
        <value>Repair</value>
        <value>Hack</value>
        <value>Use</value>
      </displayverbs>
      <repaired type="boolean">false</repaired>
      <hack type="script">
        if (GetBoolean(biometric reader, "repaired")) {
          UnlockExit (Stairwell Door)
          msg ("The card reader buzzes and the door unlocks.")
        }
        else {
          msg ("It's broken so you can't operate it to unlock the door.")
        }
      </hack>
      <alias>broken biometric reader</alias>
      <feature_usegive />
    </object>

Try this for the repair script.

(You had a get input inside of an Ask.)

      <repair type="script">
        if (not GetBoolean(biometric reader, "repaired")) {
          Ask ("Are you ready to repair the door?") {
            if (result) {
              SetObjectFlagOn (biometric reader, "repaired")
              msg ("You spend some time repairing the device.")
            }
            else {
              msg ("You walk away.")
            }
          }
        }
        else if (GetBoolean(biometric reader, "repaired")) {
          msg ("It's already been repaired.")
        }
      </repair>

It worked! Thanks K.V.!


Log in to post a reply.

Support

Forums