I just want to stand up.

resoundingKnow
08 Dec 2016, 16:41

I got it so that when the player sits on the couch, the flag 'sitting' is added to them (and they are moved to the couch). I know how to make my player stand up if the user types: "stand up couch", but it's unprofessional to leave it there. I know how to create a command called 'stand up' and I know how to get the command to check if the player has the 'sitting' flag. What I don't know is how to get a script to run (in this case, the stand up script) when the player types in 'stand up', without requiring an object being mentioned.

Please can someone help me with that?

Thank you.


OurJud
08 Dec 2016, 16:52

Just include it as an option in the command.

In the first field (under the box that say Command Pattern), any commands (separate with a semi-colon ; ) will trigger the standing up. Something like:

get up; get up off couch; stand up; stand up from couch

hegemonkhan
08 Dec 2016, 20:45

Commands have two types of input patterns/types:

just an 'activation word', for example:

during game play, you'd just type in:
char
-or-
c

<command name="example">
  <pattern>char;c</pattern>
  <script>
    ClearScreen
    msg ("Name: " + player.alias)
    msg ("Strength: " + player.strength)
    // etc character stats/attributes/etc displayment
    wait {
      ClearScreen
    }
  </script>
<command>

vs, using Variables/Arguments/Parameters:

you'd type in for examples:

char player
char HegemonKhan
char resoundingknow
char npc_1
char npc_2

for this example, we use the 'objectXXX' type of Parameter Variable, so the inputs have to be actual existing Objects:

<object name="player">
  <attr name="alias" type="string">player</attr>
  <attr name="strength" type="int">0</attr>
</object>

<object name="HegemonKhan">
  <attr name="alias" type="string">HK</attr>
  <attr name="strength" type="int">100</attr>
</object>

<object name="resoundingknow">
  <attr name="alias" type="string">RK</attr>
  <attr name="strength" type="int">75</attr>
</object>

<object name="npc_1">
  <attr name="alias" type="string">npc 1</attr>
  <attr name="strength" type="int">50</attr>
</object>

<object name="npc_2">
  <attr name="alias" type="string">npc 2</attr>
  <attr name="strength" type="int">25</attr>
</object>
<command name="example">
  <pattern>char #object_parameter_1#</pattern>
  <script>
    ClearScreen
    msg ("Name: " + object_parameter_1.alias)
    msg ("Strength: " + object_parameter_1.strength)
    // etc character stats/attributes/etc displament
    wait {
      ClearScreen
    }
  </script>
<command>

OurJud
08 Dec 2016, 20:51

Why can't he just use a simple list of commands like I explain in my first post?


hegemonkhan
08 Dec 2016, 20:53

he/she certainly can, depends on how lazy or not and/or handling the infinite inputs or not