OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Siber Fox on 24 Apr 2003, 03:22:35

Title: Using Action menu
Post by: Siber Fox 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.
Title: Re:Using Action menu
Post by: macguba 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  :)
Title: Re:Using Action menu
Post by: Gumby 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???
Title: Re:Using Action menu
Post by: macguba 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. :)
Title: Re:Using Action menu
Post by: Gumby on 02 May 2003, 18:56:25
I think i will do that....