OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: toadlife on 05 May 2003, 09:08:28

Title: The time for "Action" has come! (Please do NOT post questions in this thread.)
Post by: toadlife on 05 May 2003, 09:08:28
Hi people!

We need some help from all of the editing gods in our great community.

The usage of the "action" command is one of the most asked scripting questions, yet a comprehensive list of syntax for every known action that can be performed with this command is nowhere to be found, as far as I know.

I would like everyone to post examples of the different actions which can be carried out using the "Action" command.

I intend on checking, formatting, and placing these examples in our on-line OFP command reference.

In the future, I may either modify the on-line command reference, so that OFPEC users can post examples for ANY command, but for now, I'd just like to post examples for all of the known actions.

The only one I know off hand is "eject" and thats already in there :P , so please post the ones you know, and I will add them to this thread, and eventually add them into our on-line command reference.


Name: Eject
Description: Ejects a unit from a vehicle
Syntax: object action["eject",vehicle]
Example:unit5 action ["eject",vehicle unit5]
Example2:unit5 action ["eject",helicopter1]
Notes: None



# Edited post title[/size]
Title: Re:The time for "Action" has come!
Post by: LCD on 05 May 2003, 15:01:09
dere is da take weapon (u already got it in ur mision :P)

name : take weapon
Description : makes unit take weapon from dead body
Syntax : object action ["take weapon",Body,0,0,weapon]
Example : LCD action ["take weapon",toadlife,0,0,primaryweapon toadlife]
Example : LCD action  ["take weapon",deadman,0,0,"m16"]
Notes: 1) u need 2 make da unit get close 2 da body, or it wil take da weapon from very far distance
2) as much as i know changing da nums in da syntax dont change nythin

sec 1 is drop weapon

name : Drop Weapon
Description : makes unit drop its weapon
Syntax : object action ["Drop Weapon",object,0,0,weapon]
Example : toadlife action ["Drop Weapon",toadlife,0,0,((weapons toadlife) select 0)]
Example2 : toadlife action ["Drop Weapon",toadlife,0,0,"m16"]
notes : as much as i know changing da nums in da syntax dont change nythin

3rd get out

name : get out
Description : tels unit 2 get out from vehicle
Syntax : object action ["get out",vehicle]
Example : LCD action ["get out", vehicle LCD]
Example2 : toadlife action ["get out",UAZ1]
notes : same as eject - but eject works beter

4th is get in (syntax not guarunteed ;D - i never used it but it shud b like dat)

name : get in
Description : tels unit 2 get in vehicle
Syntax : object action ["get in",vehicle]
Example : LCD action ["Get in",Hind1]
Example2 : toadlife action ["get in",Uaz1]
notes : dere r beter scriptin wayz 2 do da same thing

:cheers:

LCD OUT
Title: Re:The time for "Action" has come!
Post by: Black_Feather on 05 May 2003, 18:52:33
Here's a few, I can't be bothererd typing much at hte minute so please excuse my poor explanations, I'll do some more later when I can be arsed. Its a good idea though getting them together.

//heal at medic
unitname action ["heal",medicname]

//repair vehicle
unitname action ["Repair",repairvehiclename]

//rearm vehicle
unitname action ["Rearm",vehiclename]

//refuel vehicle
unitname action ["Refuel",refuelvehiclename]

//light fire
unitname action ["Fire inflame",firename]

//put out fire
unitname action ["Fire put down",firename]

//climb up ladder
unitname action ["Ladderup",object 33749]

//blow satchell charge
unitname action ["touchoff"]

//hide dead body
unitname action ["hidebody",deadbodyname]

PS. most of these are instant so use domve and & distance < 3 in a script or something.
Title: Re:The time for "Action" has come!
Post by: toadlife on 05 May 2003, 23:56:42
Great guys! This is just what I wanted. Don't worrry about putting all of the detals and examples (but thanks anyway LCD :cheers:)..I will handle the testing and writing of the official descriptions, for the command reference.
Title: Re:The time for "Action" has come!
Post by: XIAOLE on 06 May 2003, 13:52:41
Just want to thank you toadlife for your:
Example2:unit5 action ["eject",helicopter1]
Cause I got it all wrong from the" Unofficial Operation Flashpoint Command Reference Manual":
unitName action ["actionType"]
Silly me.
I am back "Flashing" again after a long break. I once made a whole campaign game with the mod from http://www.operation-flashpoint.dk but never published it since I feel more at home with you guys at the Editing Center. I later herd that Pentagon hacked my computer and got inspired for the invasion of Iraq though.
To put it short thanks to your Example2, the guys in my intro to my new mission masterpiece are now ejecting just fine …thanks again

XIAOLE.
And the Big Horse lifted it's Tail and fed the little Bird. JACK FLASH!
Title: Re:The time for "Action" has come!
Post by: rom on 06 May 2003, 16:01:29

Name: Engine off
Description: Stops the engine of a vehicle
Syntax: vehicle action["Engine off"]
Example:chopper1 action ["Engine off"]
Notes: None



Name: Engine on
Description: Starts the engine of a vehicle
Syntax: vehicle action["Engine on"]
Example:chopper1 action ["Engine on"]
Notes: If the AI controls the vehicle it will probably turn the engine on again depending on the situation



Name: Landing gear
Description: Toggles the landing gear of a plane or chopper
Syntax: vehicle action["Land gear"]
Example:plane1 action ["Land gear"]
Notes: If the gear is up then this command lowers the gear and vice versa. If the AI controls the vehicle then it will deny the lowering/rising of the gear depending on the situation.

Title: Re:The time for "Action" has come!
Post by: benreeper on 06 May 2003, 18:05:59
Also if you use

"GETOUT" without the space, as opposed to
"GET OUT" with the space,

units will be instantly dumped from the vehicle no matter where they are.  That means a heli or boat will not land first and and if in the air there will be no parachute given.

Ben
Title: Re:The time for "Action" has come!
Post by: jojojoni on 06 May 2003, 19:32:50
Name: Salute
Description: Makes units salute
Syntax: unitname action["SALUTE"]
Example: sol1 action ["SALUTE"]
Notes: Only works in SAFE or CARELESS modes.

Name: Sit down
Description: Makes units sit down
Syntax: unitname action["SITDOWN"]
Example: sol1 action ["SITDOWN"]
Notes: Only works in SAFE or CARELESS modes.

Title: Re:The time for "Action" has come!
Post by: Black_Feather on 07 May 2003, 00:22:11
a couple more

//hit with gun
unitname action ["strokegun"]

//hit with fist (need to remove weapon first)
unitname action ["strokefist"]

//put flaps down (can be used twice)
aircraftname action ["FLAPS DOWN"]

//put flaps up (can be used twice)
aircraftname action ["FLAPS up"]
Title: Re:The time for "Action" has come!
Post by: toadlife on 07 May 2003, 03:20:30
Sweeeeeeet! Didn't know there were so many that actually worked.  :o
Title: Re:The time for "Action" has come!
Post by: LCD on 07 May 2003, 03:56:45
i think aoutohover works also ;D but im not sure ;D

somin like

heliname action ["Aouto hover"]

just im not sure if i wite aouto like dat ::)

LCD OUT
Title: Re:The time for "Action" has come!
Post by: Pope_Zog on 07 May 2003, 13:46:10
Name: Take Flag
Description: Makes a unit take a specific flag.
Syntax: unitName action["TAKE FLAG", flagName]
Example: east3 action ["TAKE FLAG", FlagWest]
Notes: None

Pope Zog
Title: Re:The time for "Action" has come!
Post by: macguba on 07 May 2003, 16:36:14
Name:            Scud launch preparation
Description:    Makes scud missile move to vertical ready-to-launch position
Syntax:           unitname action ["scud launch"]
Example:        scud1 action ["scud launch"]
Note1:            Takes about 12 seconds
Note2:            Use the command scudstate to check the launch state of the scud


Name:            Scud start
Description:    Makes scud missile ignite and launch
Syntax:          unitname action ["scud start"]
Example:        scud1 action ["scud start"]
Note1:            You do not have to use the action Scud launch first
Note2:            Use the command scudstate to check the launch state of the scud

Title: Re:The time for "Action" has come!
Post by: Black_Feather on 07 May 2003, 18:42:18
to expand on what pope zog said you can use this to attach the flag to the unit

//take flag
unitname action ["take flag",flagname,flagname setFlagOwner unitname]

//return flag
unitname action ["return flag",flagname,flagname setFlagOwner objnull]

//make vehicle crew open hatches
vehiclename action ["Turnout"]

//make vehicle crew close hatches
vehiclename action ["TurnIn"]
Title: Re:The time for "Action" has come!
Post by: BraTTy on 08 May 2003, 05:23:27
Look in the commented configs.For example here is ManActions.hpp:

// basic actions list
ACTION(Stop)
ACTION(StopRelaxed)

ACTION(TurnL) // turning
ACTION(TurnR)

ACTION(TurnLRelaxed) // turning
ACTION(TurnRRelaxed)

ACTION(ReloadMagazine) // special actions
ACTION(ReloadMGun)
ACTION(ReloadAT)
ACTION(ReloadMortar)
ACTION(ThrowGrenade)

/*!
\internal 1.05 Date 7/17/2001 by Ondra.
- Changed: different logic used to control walking.
It was controlled by mode before, slow actions were added instead.
*/

// ADD BEGIN
ACTION(WalkF)
ACTION(WalkLF)
ACTION(WalkRF)
ACTION(WalkL)
ACTION(WalkR)
ACTION(WalkLB)
ACTION(WalkRB)
ACTION(WalkB)
// ADD END

ACTION(SlowF)
ACTION(SlowLF)
ACTION(SlowRF)
ACTION(SlowL)
ACTION(SlowR)
ACTION(SlowLB)
ACTION(SlowRB)
ACTION(SlowB)

ACTION(FastF)
ACTION(FastLF)
ACTION(FastRF)
ACTION(FastL)
ACTION(FastR)
ACTION(FastLB)
ACTION(FastRB)
ACTION(FastB)

ACTION(Down) // incremental change
ACTION(Up)

ACTION(Lying) // direct change
ACTION(Stand)
ACTION(Combat)
ACTION(Crouch)
//ACTION(OpticsOn)
//ACTION(OpticsOff)
ACTION(Civil)
ACTION(CivilLying)
ACTION(FireNotPossible) // attempt to fire when weapons are disabled


ACTION(Die)

ACTION(WeaponOn) // activate AT weapon
ACTION(WeaponOff) // deactivate AT weapon

ACTION(Default) // no action - used for initialization
ACTION(JumpOff) // no action - used after get out

// special actions - for scripting and effects

ACTION(StrokeFist)
ACTION(StrokeGun)

ACTION(SitDown)
ACTION(Salute)

ACTION(BinocOn)
ACTION(BinocOff)

ACTION(PutDown) // used during some actions
//ACTION(PutDownEnd) // used during some actions

ACTION(Medic)
ACTION(Treated)

ACTION(LadderOnDown)
ACTION(LadderOnUp)
ACTION(LadderOff)
ACTION(LadderOffTop)
ACTION(LadderOffBottom)

// get-in/out

ACTION(GetInCar)
ACTION(GetOutCar)
ACTION(GetInTank)
ACTION(GetOutTank)

/*!
\patch_internal 1.21 Date 8/22/2001 by Ondra.
- New: TakeFlag action for better TakeFlag synchronization.
*/

ACTION(TakeFlag) // used during some actions

ACTION(HandGunOn)






Also a manvehicleactions.hpp of interest

Title: Re:The time for "Action" has come!
Post by: Gumby on 15 May 2003, 12:38:58

These were copied from the Lustypooh refenrence guide...

Standard script is     :        _object action ["action", _target-of-action]

IMPORTANT :   in case of units entering a vehicle, remember to assign the unit to the position before entering.. This prevents him from ejecting the vehicle 2 seconds later.

STR_NO_ACTION No action available
STR_ACTION_GETIN_COMMANDER                          Get in %s as commander
STR_ACTION_GETIN_DRIVER                                   Get in %s as driver
STR_ACTION_GETIN_PILOT                                     Get in %s as pilot
STR_ACTION_GETIN_GUNNER                                 Get in %s as gunner
STR_ACTION_GETIN_CARGO                                   Get in %s ride in back
STR_ACTION_HEAL                                                  Heal at %s
STR_ACTION_REPAIR                                               Repair at %s
STR_ACTION_REFUEL                                               Refuel at %s
STR_ACTION_REARM                                                Rearm at %s
STR_ACTION_GETOUT                                              Get out
STR_ACTION_LIGHTON                                             Light on
STR_ACTION_LIGHTOFF                                            Light off
STR_ACTION_ENGINEON                                          Engine on
STR_ACTION_ENGINEOFF                                          Engine off
STR_ACTION_WEAPON                                              Weapon %s
STR_ACTION_MAGAZINE                                             Reload %s
STR_ACTION_TAKEWEAPON                                        Take %s
STR_ACTION_DROPTAKEWEAPON                               Take %s (drop %s)
STR_ACTION_TAKEMAGAZINE                                     Take %s
STR_ACTION_DROPTAKEMAGAZINE                            Take %s (drop %s)
STR_ACTION_TAKEFLAG                                             Take Flag
STR_ACTION_RETURNFLAG                                         Return Flag
STR_ACTION_TURNIN                                                  Turn in
STR_ACTION_TURNOUT                                               Turn out
STR_ACTION_WEAPONINHAND                                    %s in hand
STR_ACTION_WEAPONONBACK                                   %s on back
STR_ACTION_SITDOWN                                                Sit down
STR_ACTION_EJECT                                                      Eject
STR_ACTION_LAND                                                       Landing autopilot (planes only)
STR_ACTION_CANCEL_LAND                                        Landing autopilot off (planes only)
STR_ACTION_TO_DRIVER                                             To driver's seat
STR_ACTION_TO_PILOT                                               To pilot's seat
STR_ACTION_TO_GUNNER                                            To gunner's seat
STR_ACTION_TO_COMMANDER                                    To commander's seat
STR_ACTION_TO_CARGO                                             To back seat
STR_ACTION_HIDE_BODY                                             Hide body
STR_ACTION_TOUCH_OFF                                            Touch Off %d bomb(s)
STR_ACTION_START_TIMER                                          Set timer on (%.0f seconds)
STR_ACTION_SET_TIMER                                              Set timer +%.0f sec. (%.0f remaining)
STR_ACTION_DEACTIVATE                                            Deactivate bomb
STR_ACTION_TAKEOFF_GOGGLES                                Take off NV goggles
STR_ACTION_TAKEON_GOGGLES                                 Take on NV goggles
STR_ACTION_MANUAL_FIRE                                          Manual fire
STR_ACTION_MANUAL_FIRE_CANCEL                           Cancel manual fire
STR_ACTION_HOVER                                                     Auto-hover
STR_ACTION_HOVER_CANCEL                                      Cancel Auto-hover
STR_ACTION_STROKEFIST                                             Strike with fist
STR_ACTION_STROKEGUN                                             Strike with gun
Title: Re:The time for "Action" has come!
Post by: macguba on 15 May 2003, 13:07:11
Gentlemen, thank you for your lists of actions.   We know about them.   The problem is that we don't know how to use all of them.  

The question is, what is the syntax?  It's different for each action.

If you know the syntax for any action, and it's not already in this thread, then please post it here.   If in doubt, post it - better a double than nothing at all.
Title: Re:The time for "Action" has come!
Post by: toadlife on 15 May 2003, 21:34:03
I'm suprised it took as long as it did for someone to post that from the unofficial comfref.   ;)
Title: Re:The time for "Action" has come!
Post by: GCGoquingco on 22 May 2003, 04:39:16
guys, im really having a hard time taking the lights off in the MG... hope some could help me with this...
Title: Re:The time for "Action" has come!
Post by: JDSH on 28 May 2003, 04:32:13
I FOUND A WAY!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  ;D ;D

 Make a script called   anything.sqs

------------------------------------------------
#A
mg1 action ["Light Off",mg1]
goto "A"
---------------------------------------------------
Simple Huh
I just found this out ;D ;D ;D

    The reason for this is that the action ["Light Off"] command does work! BUT it only turns off for a very split
sec I found this out by using this tool DL from this sight on the bottom of the screen that allows you to type script in the game and execute it LIVE ITS CALLED
                                             (((console1.21.zip))))
                                    by
Console for OFP by Vektorboson <vektorboson@gmx.de>
for updates see http://home.arcor.de/vektorboson ;D ;D
Title: Re:The time for "Action" has come!
Post by: Black Operative on 31 May 2003, 12:55:05
I FOUND A WAY!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  ;D ;D

 Make a script called   anything.sqs

------------------------------------------------
#A
mg1 action ["Light Off",mg1]
goto "A"
---------------------------------------------------
Simple Huh
I just found this out ;D ;D ;D

    The reason for this is that the action ["Light Off"] command does work! BUT it only turns off for a very split
sec I found this out by using this tool DL from this sight on the bottom of the screen that allows you to type script in the game and execute it LIVE ITS CALLED
                                             (((console1.21.zip))))
                                    by
Console for OFP by Vektorboson <vektorboson@gmx.de>
for updates see http://home.arcor.de/vektorboson ;D ;D

This may also kill your performance because the script will be looped as often as your CPU can handle it- and that's a LOT of times per second.  :o add at least a "~0.1" (or whatever you mean exactly with "split second" ;) ) to slow it down.
Title: Re:The time for "Action" has come!
Post by: JDSH on 31 May 2003, 13:07:18
This may also kill your performance because the script will be looped as often as your CPU can handle it- and that's a LOT of times per second.  :o add at least a "~0.1" (or whatever you mean exactly with "split second" ;) ) to slow it down.

        I just tried ~0.1 now they look like stobe lights I even tried ~.01 and when I
drove my jeep they started stobing again
         It's a very very split sec I wonder if anyone knows why they do that anyway?
I'm trying to find out
Title: Re:The time for "Action" has come!
Post by: hurlothrumbo on 03 Jun 2003, 06:11:55
They do that because the AI likes having the lights on and turns them on again when the script turns them off, and the ai works at lightspeed (well, the speed of electricity)
Title: Re:The time for "Action" has come!
Post by: Knut Erik on 07 Jun 2003, 12:37:50
Try to set the behaviour on the MG to stealth
Mg setbehaviour "Stealth"

Anyway, this is goin' a bit off topic I think.
This thread is to find the exact syntax for the action command

Correct me if I'm wrong
Title: Re:The time for "Action" has come!
Post by: gadolinite on 25 Jun 2003, 20:53:55
what is the correct syntax for a unit to switch weapons and reload a magazine

whats the rest ???
<sniper> action[STR_ACTION_WEAPON,???] to switch from a pistol to the M21 or vice versa

About the reload and other non-listed actions I will use in the future...
I need to know a complete listing of the actions with their proper syntaxial listings so  :D I don't clog the forums with questions that will return uncertain answers, if you know what I mean.  
Title: Re:The time for "Action" has come!
Post by: toadlife on 25 Jun 2003, 21:05:32
NO one has figured out how to make a unit reload it's weapon with the action command. FOr selecting weapons, there is the "selectweapon" command.
Title: Re:The time for "Action" has come!
Post by: gadolinite on 26 Jun 2003, 01:05:02
 ::)seems as if we need to go to the programmers who made the official missions and ask their advice and how they did their stuff.  

 :toocool: It would be this site's time of it's like to have official programmers answering the forums.

About that weapon reload with the action menu, maybe we should  :gunman: strike the actions that no one has figured out from the unnoficial command reference and replace them with a detailed description and syntaxial examples with the stuff that we have figured out.  Therefore, the action list will be cleaner and will do a better job at keeping people from thinking that   :oeverything will work :hmm:.  The best solution does not lie in the unnofficial command reference,  ;) but all I am asking for is a minor improvement in the next version.

Title: Re:The time for "Action" has come!
Post by: gadolinite on 26 Jun 2003, 01:25:19
 >:(I also, (and probably the moderators) do not want anymore  :gunman: copyboys like  :tomato: gumby posting anymore plagerized material from the unofficial command reference and other sources.  I am not sure of the real motive, have to ask gumby that one.

 ;)Still it's good he made a bibliography like entry at the top of the page (not to fully put him down, but bibliographys and their sisters are designed for research that the researcher has put in his/her own words) which is good.  All I have a problem with is that the posting is not in his own words (which will most likely be better than the  :booty:nerds who put that guide together) and that he puts a garbage entry (an entry that serves no real purpose; what I mean is that the info is somewhere else and does not need to be recreated, which is not practial for a sticky topic) which a ton of can eat up space on the servers and cause any one of the seemingly infinate problems on a server because of matters like and similar to this.  

 :cheers:no offense to gumby, just a pointer to look out in the real world (including cyberspace) at what kind of trouble plagerisim can get you into.  So anyone out there, please set a good example.  This is all I am asking.

 8) :toocool:so just stay cool.
Title: Re:The time for "Action" has come!
Post by: BronzeEagle on 04 Jul 2003, 16:09:59
is there a way for a trigger to activate when an animation plays?  
Title: Re:The time for "Action" has come!
Post by: gadolinite on 05 Jul 2003, 02:11:19
I don't think so.  What you could do is make a timer with a script and a loop.  And when that loop is up, activate the trigger.  Play with the timing and you will get a near perfect emulated effect of this.   8)
Title: Re:The time for "Action" has come!
Post by: BronzeEagle on 05 Jul 2003, 02:56:08
i was just hoping that when the guy pulls out his gun he wouldn't be a captive anymore.  i was wondering if there were some way the ai would react that way to him pulling out his weapon and going from captive to not a captive but its just not possible with the current version of ofp it would seem.  
Title: Re:The time for "Action" has come!
Post by: aaronj5 on 09 Jul 2003, 01:23:20
How do I make people put their Hands on their Heads?
Title: Re:The time for "Action" has come!
Post by: Knut Erik on 13 Jul 2003, 18:16:20
Try
NameOfUnit SwitchMove "FxStandSurUniv"
Title: Re:The time for "Action" has come!
Post by: anti garble on 13 Jul 2003, 21:21:42
where is the action for the horn. or open gate , anyone know ?
Title: Re:The time for "Action" has come!
Post by: Calamity on 15 Aug 2003, 00:26:34
To expand on an Action command Gumby posted

Name: STROKEGUN
Description: Caused unit to swing riffle like he his striking a target
Syntax: unit2 ACTION ["STROKEGUN", unit1]
Example:KLINK ACTION ["STROKEGUN", VLAD]
Notes: Unit1, or VLAD in the example, will swing the gun. Although the addition of unit2, or KLINK, from the example, would lead you to believe that VLAD would try and hit him. I have found that it has no relivance.

This is a very nice action and I would think that it would have a complimentry action which would be played by KLINK, and would make him act as if he got hit twice by a riffle. But I can not find it. If anyone has any ideas...
I could use it in an outro I'm writeing.
Title: Re:The time for "Action" has come!
Post by: toadlife on 10 Sep 2003, 05:20:30
I FOUND ONE!


// deactivate a placed mine
foo action["deactivate mine",_unit,0,0,"Mine"]

// pick up a placed mine
foo action["take mine",_unit,0,0,"Mine"]


_unit = the unit which placed the mine

*The fired Eventhandler is needed to get the _mine itself (so you can have the soldier move to the mine first) and the person who placed the mine.
Title: Re:The time for "Action" has come!
Post by: LCD on 10 Sep 2003, 05:26:27
@ toady

:wave:

how did u find it - u got ny special way ? or just shotin in da dark ?

LCD OUT
Title: Re:The time for "Action" has come!
Post by: toadlife on 10 Sep 2003, 05:56:22
Someone in official forums asked if it could be done so I tried it - using the same syntax as the "take weapon" action - and it worked.\

At first I tried "deactivate" amd "take mine" but those didn't workso I just decided to try "take mine" and "deactivate mine" and it worked!

AFAIK you can't have soldiers pick up pre-placed mines (mines placed in the editor) because you need the person who laid the mine down.
Title: Re:The time for "Action" has come!
Post by: skid on 11 Sep 2003, 02:57:48
I carn't belive I'm asking this but here goes.
I have a soldier named "man", I have a car named "veh"

All I want to do it on a trigger get the man in the car.
In the activation field I enterd :-

man action["getin",veh]

without the quotes but nothing  happens.
I tried it on a move and in script but still nothing.

I even tried it on another pc with no luck.
I thought I had all this sorted a while back but a month or two away and I'm lost again.

Help Plz?
Title: Re:The time for "Action" has come!
Post by: toadlife on 11 Sep 2003, 03:12:14
It's

object action ["get in",vehicle]

not

object action ["getin",vehicle]
Title: Re:The time for "Action" has come!
Post by: skid on 11 Sep 2003, 03:19:05
Thanks but it won't work the best I can get is:-

object action ["getin xxxx",vehicle]

xxxx has to be cargo,driver,commander or gunner.
just  object action ["get in",vehicle] does nothing
object action ["exit",vehicle] works though.

All so I need to be able to move units around within a vehicle I see the cammand "TO_Driver","TO_Gunner" but again I carn't work out the syntax.
I tried object action ["TO Driver",vehicle] but nothing.



Title: Re:The time for "Action" has come!
Post by: toadlife on 11 Sep 2003, 03:36:45
Just use this instead of fumbling with action command. Action commands should be used sparingly anyway.

unit assignas[driver,cargo,commander,gunner] vehicle
[unit] ordergetin true
Title: Re:The time for "Action" has come!
Post by: Sui on 11 Sep 2003, 04:16:35
// deactivate a placed mine
foo action["deactivate mine",_unit,0,0,"Mine"]

// pick up a placed mine
foo action["take mine",_unit,0,0,"Mine"]


_unit = the unit which placed the mine

Just note that the syntax:

unit action ["DEACTIVATE MINE"]

Will work provided the unit is at the position of the mine.

Something else to note... engineers can deactivate and take any mines they like... probably because they're engineers ;)

Everyone else can only muck about with mines they've places themselves
Title: Re:The time for "Action" has come!
Post by: Komuna on 19 Sep 2003, 15:47:10
Unit action ["NVGoggles"]

It toggles the night vision on or off.
It only works, effectivly, with the player. AI can choose the NV mode by themselves.
Title: Re:The time for "Action" has come!
Post by: Commando on 24 Sep 2003, 00:09:03
Cool!  :D Now i know why there are engineers in the game...  ;D
You learn something new everyday in ofp...a buddy of mine showed that you can actually take suicide with a m16 with 15-30 rounds by trying shoot your feet and spinning around in a circle  :P
maybe a god thing if you have gone M.I.A over some small unhabited island in multiplayer..
Title: Re:The time for "Action" has come!
Post by: Nesquik on 19 Oct 2003, 12:44:18
I try to make a AI chopper hover


I try :
<chopperdriverName> action ["STR_ACTION_HOVER"],
<chopperName> action ["STR_ACTION_HOVER"],
<chopperName> action ["HOVER"],
<chopperdriverName> action ["HOVER"],

on a waypoint or in init field
And it don't work  :'(

help me
Title: Re:The time for "Action" has come!
Post by: Zombie on 20 Oct 2003, 21:09:00
I tried the action "heal" and my guys makes the moves like a medic working, not as if he is being healed.  What's the action for getting healed?
Title: Re:The time for "Action" has come!
Post by: McFly on 21 Oct 2003, 02:30:03
I parsed the Flashpoint.exe and got a list of the available actions in the engine...

Code: [Select]
USE MAGAZINE
DEACTIVATE MINE
TAKE MINE
HANDGUN OFF
HANDGUN ON
USER TYPE
DROP MAGAZINE
DROP WEAPON
SCUD START
SCUD LAUNCH
SALUTE
FLAPS UP
FLAPS DOWN
LAND GEAR
FIRE PUT DOWN
FIRE INFLAME
LADDEROFF
LADDERONUP
LADDERONDOWN
LADDERDOWN
LADDERUP
STROKEGUN
STROKEFIST
AUTOHOVER
NVGOGGLES
MANUALFIRE
DEACTIVATE
SETTIMER
TOUCHOFF
HIDEBODY
MOVETOCARGO
MOVETOCOMMANDER
MOVETOGUNNER
MOVETODRIVER
EJECT
CANCEL LAND
LAND
SITDOWN
WEAPONONBACK
WEAPONINHAND
TURNOUT
TURNIN
RETURN FLAG
TAKE FLAG
TAKE MAGAZINE
TAKE WEAPON
LOAD MAGAZINE
USE WEAPON
SWITCH WEAPON
ENGINE OFF
ENGINE ON
LIGHT OFF
LIGHT ON
GETIN CARGO
GETIN GUNNER
GETIN DRIVER
GETIN COMMANDER

I'll try to interpret the parameters later.  There might be other actions that I missed - they're near the bottom and in all caps.
Title: Re:The time for "Action" has come!
Post by: Doolittle on 23 Oct 2003, 03:33:07
NICE work McFly!

I wonder how you get the argument for "return flag"...

Doolittle
Title: Re:The time for "Action" has come!
Post by: Blanco on 30 Oct 2003, 21:06:29
Is there somebody here who knows how to use :

STR_ACTION_TAKEOFF_GOGGLES                                
Take off NV goggles
STR_ACTION_TAKEON_GOGGLES                                
Take on NV goggles

it's in the off. comref...
Title: Re:The time for "Action" has come!
Post by: McFly on 31 Oct 2003, 04:48:45
The "STR_ACTION" variables are string names - they don't actually do anything, they simply tell the engine what text to display in the action dialogue (which it looks up in \bin\stringtable.csv).  I don't know why the unofficial OFP reference refers to them that way as it's clearly confusing.

The action you want is thus:

unitname action ["nvgoggles"];

That will cause the unit to equip goggles if he has them, and also to take them off if he already has them equiped.  In other words, it acts like a toggle switch.
Title: Re:The time for "Action" has come!
Post by: Mr. S.A.S on 12 Jan 2004, 21:08:22
Just a little action I learned in a tutorial:

UnitName action["put","pipebomb"]
Makes a unit place a satchel charge (if he has one, obviously).

UnitName action"touchoff" (I think)
Makes the unit detonate any satchel charges he has placed.

It may not be much, but every little helps, right?
Title: Re:The time for "Action" has come!
Post by: Killswitch on 20 Jan 2004, 22:56:42
A new(?) finding on "SETTIMER" and a recap on the use of satchels as presented my Mr SAS just above:

To have a unit place a satchel that its carrying
Code: [Select]
dude fire ["put", "pipebomb"]To have that unit set the timer to 30 secs (or add another 30 secs to an already set time)
Code: [Select]
dude action ["settimer"]

// or, alternatively

dude action ["settimer",dude,0,0,"pipebomb"]
To repeat from earlier posts, to have him blow the satchel(s)
Code: [Select]
dude action ["touchoff"]
Note the use of fire instead of action to actually place the satchels. I couln't make it happen using action.
Title: Re:The time for "Action" has come!
Post by: General Barron on 28 Jan 2004, 08:53:38
OMG! Great work McFly! Now a nicely formatted "action reference" needs to be made, where all the actions revealed in this thread are filled in with appropriate descriptions/parameters/other info, and then with blanks for the actions that still aren't figured out yet. HTML would work well, methinks. Anyone wanna put this together? It would be greatly appreciated.

And as a tip to anyone trying to figure out actions:

the "action" command takes an array of 5 parameters. If you pass it 6 params, it will give you an error saying "6 given, 5 expected". So in the case of:

dude action ["settimer",dude,0,0,"pipebomb"]

The first param is the action, the next is the person doing the action, and then there are two placeholders, and then the last parameter is what to do the action on. If 5 params aren't needed, then only one can be given. Ex:

dude action ["touchoff"]

So I'm assuming that other actions that would have parameters (such as USE MAGAZINE) would look like the first example.

But if it takes 5 parameters, then shouldn't there be an action that needs all 5? I suspect there may be one action like the "USER TYPE" one, which would use all 5, and the rest use either 1 or two and the two placeholders.
Title: Re:The time for "Action" has come!
Post by: h- on 28 Jan 2004, 23:12:01
Didn't see this action here so thought I'd post it up...
Although you all must know this by now...  :-[

To make chopper auto-hover:
heloName action ["HOVER",heloName]

And to cancel it:
heloName action ["HOVER_CANCEL",heloName]
Title: Re:The time for "Action" has come!
Post by: Blanco on 08 Jun 2004, 16:17:15
he, found some new ones :  :)

Action code must be put in the on activation field of a WAYPOINT (like the switchmove/playmove commands) or in a script.NOT in an init!

Make sure the unit has a handgun.
unit action ["handgun on"]
unit action ["handgun off"]

unit action ["weapononback"]
unit action ["weaponinhand"]

;unit must be in safe behaviour
unit action ["sitdown"]

Gets on his knees and grab something...looks like take weapon, I think I need argument to make it work
unit action ["USE WEAPON"]

Damn those action are hard to find... :P

Title: Re:The time for "Action" has come!
Post by: macguba on 09 Jun 2004, 10:52:24
Attached is a zipped Excel spreadsheet which is a quick and dirty first draft collating all the information in this thread.


There are still a lot of gaps ......[/b][/size]




Title: Re:The time for "Action" has come!
Post by: Planck on 09 Jun 2004, 19:48:02
Unfortunately, we don't all have Excel.....hehehehe  ;D


Planck
Title: Re:The time for "Action" has come!
Post by: macguba on 09 Jun 2004, 19:53:51
Text version herewith, though the layout is not too clever.    :P
Title: Re:The time for "Action" has come!
Post by: Planck on 09 Jun 2004, 20:07:15
Ta muchly macguba.   ::)


Planck
Title: Re:The time for "Action" has come!
Post by: Matt Walter on 09 Aug 2004, 19:05:12
ok, I read this whole topic, copied the scripts, and then I tried to put them in a mission and it said it didn't work. Can someone explain this to me, step by step.
Title: Re:The time for "Action" has come!
Post by: macguba on 09 Aug 2004, 20:30:23
Don't ask questions here, this thread is for adding information.    ;)

All you need from this thread is one of the files that I attached a couple of posts ago:  they contain all the information in the thread.

For your question, start a new thread on this board.    Tell us in MUCH more detail what you are trying to do, what you did, what happened and how you know it didn't work.   If you got an error message quote it exactly.  
Title: Re:The time for "Action" has come!
Post by: Iva on 09 Aug 2004, 20:48:12
How do i use TakeMagazine Action?  >:(

I need ai to pick up magazine that other soldier droped whit this acion:

_Carrier action ["DROP MAGAZINE",pl,0,0,"Osa_Mag"]

 ??? ???
Title: Re:The time for "Action" has come!
Post by: macguba on 09 Aug 2004, 22:36:49
What did I say in my last post?  :hmm:

Quote
Don't ask questions here, this thread is for adding information.

 ::)


Please do not ask questions in this thread!
[/size][/b][/color]


Title: Re:The time for "Action" has come!
Post by: Matt Walter on 10 Aug 2004, 08:38:32
oops sorry guys.
Title: Re:The time for "Action" has come!
Post by: Tyger on 20 Aug 2004, 00:10:50
if u want 2 double check urself, or find some new ones, theres an 'action' list/tute over at www.opflashpoint.com  (http://www.opflashpoint.com) somwhere

Tyger
Title: Re:The time for "Action" has come!
Post by: Bart on 28 Aug 2004, 18:17:05
This thread has very good scripting commands about the STANDARD OFP actions but what about if you make them yourself?  ???

An example a scripter has made a hostage script, when you want to free the hostages you must press 'secure hostage' in the action menu

now I want to know how an AI can perform this action...
I've been working on this issue for about 3 months now and I couldnt find an answer  :'(  :-X , plz help me...  :-[
Title: Re:The time for "Action" has come!
Post by: macguba on 28 Aug 2004, 18:42:50
[size=50]Do not ask questions in this thread.[/b][/size]

I said it in big red letters about three posts ago.   :hmm:

This thread is only for adding information.    Please post your question in the Editing: General board.
Title: Re:The time for "Action" has come!
Post by: Bart on 28 Aug 2004, 18:59:16
I'm sorry but I cant seem to make a new topic on the general announcements board  ??? so i posted it here
Title: Re:The time for "Action" has come!
Post by: General Barron on 26 Oct 2004, 00:30:16
Forgive me for this, macguba, but I believe I'm adding information (conjecture), which may help someone figure this out, or post the answer if they already have figured it out.

This thread has very good scripting commands about the STANDARD OFP actions but what about if you make them yourself?  ???

An example a scripter has made a hostage script, when you want to free the hostages you must press 'secure hostage' in the action menu

now I want to know how an AI can perform this action...

I don't know if this is possible, but I sure hope it is...

From looking at the list of available actions from McFly's post, I would suspect that the correct action would be "USER TYPE". I experimented with this action a while back, but with no success. Well, I did find a way to crash to desktop with no error message, and believe it or not someone asked how to do just that a few weeks later on these forums....

To recap something I posted a while back, the action command seems to take a max of 5 parameters. If you give it 6, it will give you an error saying it expected 5. However, I believe that in many actions, some of the parameters are just placeholders for some reason. For example:
Code: [Select]
foo action["take mine",_unit,0,0,"Mine"]would work the same no matter what you put in place of the 0's.

I would suspect that you would need to pass the index of the action you want the unit to use, if you can use scripted actions. So perhaps it would look something like this:
Code: [Select]
unit action["USER TYPE", action index, object action is attatched to]There also might be any combination of "place holders" required, like in the above example with the "take mine" command. Just remember, the limit seems to be 5 params, and most actions seem to use either 1 parameter, 2 parameters, or all 5 (with placeholders). Anyway, hopefully someone will find my musings helpful in finding more actions.

---------------

However, the "user type" action might also refer to actions added in via an addon's config. Just another angle to look into...
Title: Re:The time for "Action" has come!
Post by: XIII on 02 Nov 2004, 14:18:17
I made this when i had nothing to do

SlowMotion

Play OFP a la Max Payne!

Use: Slowmotion
How: Use your action menu for: Slowmotion On and Slowmotion Off
Extra: Sounds
Script(s): Main.sqs, Slowmotionon.sqs, Slowmotionoff.sqs
Command(s): slowmotionon=p1 addaction ["Slowmotion On","Slowmotionon.sqs"], slowmotionoff=p1 addaction ["Slowmotion Off","Slowmotionoff.sqs"]

And i also used the Removeaction command.
I put the map if you guys want, it's for SP and this is just to test. Maybe i'll make a mission with it...

XIII
Title: Re:The time for "Action" has come!
Post by: macguba on 02 Nov 2004, 16:07:33
@XIII Well, it sounds like a handy little thing but it is nothing to do with this thread.      This is about the action command, not the action menu.   As it's a beta post it on the scripts beta testing board.    ;)


@General Barron, that is EXACTLY the kind of thing this thread is for.  :thumbsup:
Title: Re:The time for "Action" has come!
Post by: makkaramies on 22 Nov 2004, 21:53:36
WoW! this was helpfull. Thanks guys.
Title: Re:The time for "Action" has come!
Post by: Fire-Fox on 23 Nov 2004, 02:06:29
After trying around with it extensively, I think I have found out that the action "Flaps down" / "Flaps up" only works when the player is the driver of the corresponding aircraft. (I activated an Alpha trigger with a10 action ["flaps down"] while an AI pilot was in it and nothing happened. Then I shot the AI pilot  ;D, got in myself and triggered Alpha again, and oho! the flaps were down)


And now, after having conveyed these fundamental, revolutionary findings I think I can now go to bed and enjoy my well-earned rest.  ;)
Title: Re:The time for "Action" has come!
Post by: Planck on 16 Dec 2004, 22:00:37
 OK........I decided to have a wee poke about with macgubas list of all the actions mentioned in this thread so far.

There were quite a few that seemed incomplete......so

I decided to play with the GETIN and MOVETO type actions to see what I could come up with.

To begin with:

GET IN:    unit action ["get in",vehicle]

This is in the list, but sadly I couldn't get anyone to get in anything with it.

The same went for this variation I tried

GETIN:    unit action ["getin",vehicle]

Also:

GET OUT:    unit action ["get out",vehicle]

That doesn't work for me either.

But this works fine:

GETOUT:    unit action ["getout",vehicle]

Anyway....onto my newer findings:

Code: [Select]

GETIN CARGO
unitname action ["getin cargo",vehiclename]

Unit will get into vehicle cargo if there is space.
Will even get into vehicle if the vehicle is miles away or flying, but I think the vehicle must be relatively slow moving or stationary. Unit seems to get teleported to the vehicles position and then does the getin animation.

GETIN COMMANDER
unitname action ["getin commander",vehiclename]

Unit will get into vehicle as commander if the position is empty.
Will even get into vehicle if the vehicle is miles away, but I think the vehicle must be relatively slow moving or stationary.
Unit seems to get teleported to the vehicle position and then does the getin animation.

GETIN DRIVER
unitname action ["getin driver",vehiclename]

Unit will get into vehicle as driver if the position is empty.
Will even get into vehicle if the vehicle is miles away or flying, but I think the vehicle must be relatively slow moving or stationary.
Unit seems to get teleported to the vehicle position and then does the getin animation.

GETIN GUNNER
unitname action ["getin gunner",vehiclename]

Unit will get into vehicle as gunner if the position is empty. Will even get into vehicle if the vehicle is miles away or flying, but I think the vehicle must be relatively slow moving or stationary.
Unit seems to get teleported to the vehicle position and then does the getin animation.

Note:
GETIN PILOT which is also in the list seems to do nothing.


Ok....Last lot

Code: [Select]

MOVETOCARGO
unitname action ["movetocargo",vehiclename]

Will immediately move a crew unit to cargo. If you order a pilot to do this, he will, and if the aircraft is flying it will no longer have a pilot unless there was a unit/units in cargo already, in which case they will swap positions.
However choppers sometimes fly erratically and even fly backwards when you swap pilots like this.
Works with player as well as AI.

MOVETOCOMMANDER
unitname action ["movetocommander",vehiclename]

Immediately moves a crew or cargo unit to commander position.
Original commander ends up in cargo or new commanders previous position.
Works with player as well as AI.

MOVETODRIVER
unitname action ["movetodriver",vehiclename]

Immediately moves a crew or cargo unit to driver position. Original driver ends up in cargo or new drivers previous position.
However choppers sometimes fly erratically and even fly backwards when you swap pilots like this.
Works with player as well as AI.

MOVETOGUNNER
unitname action ["movetogunner",vehiclename]

Immediately moves a crew or cargo unit to gunner position.
Original gunner ends up in cargo or new drivers previous position.
Works with player as well as AI.


Well, thats all for today, hope its useful.


Planck
Title: Re:The time for "Action" has come!
Post by: General Barron on 05 Apr 2005, 03:08:01
I don't have a whole lot to add here, but I'm trying to figure out the "SWITCH WEAPON" action. So far, I've only been able to get any response from it using the two following methods:

_unit action ["SWITCH WEAPON"]
_unit action ["SWITCH WEAPON", _unit]

The only effect I've been able to make from the above is that if the unit has a pistol or AT launcher out, then he will put it away and switch to his rifle. Not quite the effect I'm hoping for, but at least I've gotten a response from it...

The second method can then have any number of parameters after it, with anything in them, to the same effect. Basically, if you have more than 1 parameter, the second one must be the unit. I'm hoping that one of the parameters beyond that will let you tell the unit what weapon or muzzle or magazine to use, but no luck so far...

-----------------------------

I've also gotten some effect from the "USE WEAPON" action, using this syntax:

_unit action ["USE WEAPON", _unit]
_unit action ["USE WEAPON"]

This will make the unit bend down like he is putting his weapon on the ground, then stand back up. HOWEVER, if the unit has an AT weapon selected, then this will make him shoot his RIFLE (!) while it is still on his back!

The above actions might also have something to do with a vehicle's current weapon, so I'll have to experiment with that as well....
Title: Re:The time for "Action" has come!
Post by: C4_tnt on 16 Apr 2005, 03:02:30
well, dont take this as a goddamn question, its a sugestion ok? pls someone put the action vor vits antonov open rear, and open the front hatch! thats all...
Title: Re:The time for "Action" has come!
Post by: Planck on 16 Apr 2005, 13:21:45

Was that info not supplied with the addon via a readme or something?

Besides all that I think this thread is for default game actions not for third party actions.

It would be a very large thread if it included third party actions.   ::) ::)



Planck
Title: Re:The time for "Action" has come!
Post by: C4_tnt on 16 Apr 2005, 15:00:59
No it didn't came in the readme, but sorry, if this threat is really for the games basic actions... I miss understood. But I know it would be a really big list of actions… but so what? People could use it as reference…. It would be cool… it could even be a fix post…

Just a suggestion….
Title: Re:The time for "Action" has come!
Post by: Planck on 16 Apr 2005, 15:04:05
Hmmmm......it is a sticky topic already.

Somehow I doubt a lot of people would scan a very large topic looking for the third party actions they want.


Planck
Title: Re:The time for "Action" has come!
Post by: General Barron on 16 Apr 2005, 19:32:11
@C4_tnt

Scripting-wise, what you are talking about isn't the same as the rest of the actions in this thread. This thread deals only with how to use the "action" command. I'm sure the addon you have uses the "animate" command to open/close the doors.

Well, if the plane has an action that lets you open the front or the rear, then that is sorta what we are talking about. In fact, I'm now guessing that user-defined actions like that are what the "USER TYPE" action refers to. But until someone figures that action out, you will have to use the "animate" command, or whatever other scripting commands the plane's action actually runs.

I'd suggest emailing the author if his readme was incomplete.
Title: Re:The time for "Action" has come!
Post by: C4_tnt on 17 Apr 2005, 02:19:34
sry you guys are right i confused action with animate sry i will delete my posts... sry, realy sry
Title: Re:The time for "Action" has come!
Post by: ROBINO on 23 Apr 2005, 12:03:06
Good stuff thnx guys  :D
Title: Re:The time for "Action" has come!
Post by: The-Architect on 08 Jun 2005, 18:56:06
C4_tnt, you'll have to un-pbo the addon and look for the animation bit in the config. That'll tell you how to open the doors.
Title: Re:The time for "Action" has come!
Post by: _AG on 02 Jul 2005, 17:49:08
Hi!
What is format for action "LOAD MAGAZINE"?
Thanks
Title: Re:The time for "Action" has come!
Post by: Planck on 02 Jul 2005, 17:54:11
Good question.  ;D

Unfortunately I don't think anyone knows.....yet.

Actually this thread isn't for asking questions about actions.
It is in fact for people to list any new actions they find and how to use them.

Or indeed any actions we know about and how to use them if we don't know already. ::)


Planck
Title: Re:The time for "Action" has come! (Please do NOT post questions in this threa
Post by: 456820 on 06 Jul 2005, 18:33:27
Quote
Unfortunately I don't think anyone knows.....yet.

i dont know the correct syntax but im sure someone could get it the action is

ACTION(ReloadMagazine) // special actions

given to use by BraTTy in post 14 of this topic it syas what i put above so we do know it just dont know the syntax yet a sham tough i need it
if someone whats to try a test and find it, i would i just dont have alot of time for playing ofp for some reason now.

anyway hope that helps someone

it may be
unit_name action ["ReloadMagazine"]
but thats not guarantted syntax
Title: Re:The time for "Action" has come! (Please do NOT post questions in this threa
Post by: Planck on 12 Aug 2005, 22:41:00
This sticky is now unstuck.

It has been replaced with a new sticky here (http://www.ofpec.com/yabbse/index.php?board=6;action=display;threadid=25146).

Most of the information in this topic has been condensed into an html document and submitted to the Editors Depot.

This document is available here (http://www.ofpec.com/editors/resource_view.php?id=862).


Planck