how to make a command work with custom keywords

im making a game based on a anime, so in a way it would be fan fictional... ahem sorry anway the game is about these doll-sized robots that can play football [soccer].

i want to make the commands like pass ball to [whoever] to where the [] i just said is keyword area... for another robot name, instead of making dozens of commands on the same command,

ok semi solved.....
im gonna use the tell to thing

Usually the command patterns are something like search #object# or shoot #object#. BTW if you are experimenting, I recommend making your own functions FIRST THING! Use if statements when you are ready to make a new command! I broke my games TWICE because I was messing around with the commands! Online version though. My second game unbroke itself somehow, might have been an update, who knows, in case you are wondering.

And if you are a beginner, I recommend verbs.

here's a quick brief simple example:

you'd type in during game play:

pass jeff

<object name="soccer_field">

<object name="ball">

  <attr name="parent" type="object">soccer_field</attr>


<object name="own_team_object">

  <object name="sasha">

    <attr name="parent" type="object">soccer_field</attr>


  <object name="jeff">

    <attr name="parent" type="object">soccer_field</attr>


  <own_team_objectlist type="objectlist">




<object name="opponent_team_object">

  <object name="hk">

    <attr name="parent" type="object">soccer_field</attr>


  <object name="john">

    <attr name="parent" type="object">soccer_field</attr>


  <opponent_team_objectlist type="objectlist">




<command name="pass_command">

  <pattern>pass #object_parameter#</pattern>

    old_parent = ball.parent
    if (GetRandomChance (50)) {
      ball.parent = object_parameter
      msg ("You pass the ball from " + old_parent.alias + " to " + object_parameter.alias)
    } else {
      opponent = PickOneObject (opponent_team_object.opponent_team_objectlist)
      ball.parent = opponent
      msg ("You went to pass the ball, but an opposing team member intercepted it. Now they have the ball")


no im not a beginner........
verbs are for the player not objects..... the robots are objects the player is the robot's controller [using commands

verbs are for the player not objects

Verbs are for objects.
If you want the player to enter "pass ball to [whoever]", then it's equally easy to make a "pass ball to" verb for the other players on your team. It doesn't matter if the player object is involved or not.

Or make a command whose pattern is "pass ball to #object#", which is probably better given that you only have to write the script once.

i think i got it on how it could work...
ill still have to make a dosen with the players name....
but it works.

im going to use the order/tell to thing

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