Quest help: Naming an object. ( Solved! )

Hey yall once more. What I want to do is name a dog and then have the dog's alias change to whatever the character decides to name them. I have the naming set up pretty good. It works perfectly. I just want to know how to/ if I can have it to where it changes the menu item.

Here's the code I have so far. I do mainly use the Quest desktop version though.

    <object name="dog">
  <inherit name="editor_object" />
  <inherit name="female" />
  <attr name="new name" type="string"></attr>
  <look type="script">
    firsttime {
      msg ("Who's this again?")
      get input {
        dog.new name = result
        msg ("Oh right this is {dog.new name}. ")
      }
    }
    otherwise {
      msg ("It's your doggo, {dog.new name}. ")
    }
  </look>
</object>

I have an attribute called dog.new name which will print the dog name as you can see. But in the text menu it's still just dog. I tried to put the alias as {dog.new name} but of course that only printed {dog.new name}. So is this possible or am I just barking up the wrong tree ;) .


K.V.

Hello.

Instead of dog.new name, use dog.alias.

The alias will print every time thereafter, instead of 'dog'.


If you want to 'keep them separate' for any reason, you could add this line to your firsttime script:

dog.alias = dog.new name

That way, if the 'alias' attribute was changed in any other script for any other reason, the 'new name' attribute would still be holding whatever name the player assigned to the dog object.


I'm an idiot. Thank you so much. I think i need to lie down for a bit I can't believe the answer was so obvious.


K.V.

Ha!

You're cool!

It seemed more like over-thinking than a lack of thought to me, anyway...

...if that's any consolation to you.

Plus, we all go a little mad sometimes (especially while coding). Right?


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

Support

Forums