How to get objects(characters) to say something when you speak to them

npeeler1

How do I get objects(characters) that I add to have a response when I speak to them?


XanMag

You might need to be a little more specific here. When you speak to them ("speak to character", "talk to character"), you want them to...respond in what fashion? Is their response relevant to other game events? Is it just a generic response to "speak to character"? There are a lot of variables at play here. There are lots of options to handle this, some simple, some quite complex. Which one is best for you... we don't know. So, if you are a little more specific (like give a specific scenario), we can give you a better answer to the question that you ask. Hopefully this makes sense. Ask away! =)


hegemonkhan

as XanMag said, there's a lot of different designs for dialogue/conversation systems, from very simple to very complex/advanced.

the simpliest would be using a verb and a single static response, for example (in code):

<object name="npc_1">
  <attr name="displayverbs" type="simplestringlist">talk</attr> // or (can't remember its syntax): attr name="displayverbs" type="extend">talk</attr>  // or it's this: attr name="listextend" type="simplestringlist">talk</attr> 
  <attr name="talk" type="script">
    msg ("Hi, nice to meet you, I'm npc_1")
  </attr>
</object>

<verb>
  <property>talk</property>
  <pattern>talk</pattern>
  <defaultexpression>You can't talk to that!</defaultexpression>
</verb>

Log in to post a reply.

Support

Forums