Home   Help Search Login Register  

Author Topic: Using Action menu  (Read 445 times)

0 Members and 1 Guest are viewing this topic.

Siber Fox

  • Guest
Using Action menu
« on: 24 Apr 2003, 03:22:35 »
How do I get the AI to use an action from the action menu activated by a trigger/waypoint?

EX: BAS's chinook just came out. I want them to do actions with the player not being the team leader.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Using Action menu
« Reply #1 on: 24 Apr 2003, 11:02:54 »
Only a human player can use the action menu.   When you click on the action menu, the game executes a command or script.   To make the AI do the same thing you need to put the command or line of script in the On Activation field of your trigger/waypoint.  

If you haven't already done so, I recommend you read snYpir's Friendly Introduction to Code Snippets, Abuu's Editing Guide and Johan Gustafsson's Scripting Guide.    And find both the Official (which appears in both online and downloadable versions) and Unofficial Command references.

All of these are in the Editors Depot - Tutorials  :)
Plenty of reviewed ArmA missions for you to play

Gumby

  • Guest
Re:Using Action menu
« Reply #2 on: 02 May 2003, 18:00:54 »
I also have a problem using the action command, but my problem is how to construct the command line

ex. I want a guy to drop his weapon using following line

[guy1] action ["dropweapon","M16","guy1"]
But then I get an error

Action: type array, expect object


Why???

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Using Action menu
« Reply #3 on: 02 May 2003, 18:45:05 »
In OFP square brackets like this [ ] normally specify an array.   An array is a group of things,  you can think of it as a kind of list.   Obviously an array may contain only one item, or several.

Some commands require arrays as arguments, others don't.  When you get this error message it means you have an array somewhere instead of an object.    In this case, remove the [] thusly

guy1 action ["dropweapon","M16","guy1"]

and see how you get on.

This is really a completely different question from the original one, so you could have started a new thread.    Not that it really matters. :)
Plenty of reviewed ArmA missions for you to play

Gumby

  • Guest
Re:Using Action menu
« Reply #4 on: 02 May 2003, 18:56:25 »
I think i will do that....