OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Mad Pup on 27 Jan 2010, 23:27:52
-
Hi all, Mad Pup here, and I have two questions. I'm making this mission, where you're being chased by cops with the sirens on. When you go near the cop cars (as the player) an option apears that says "Sirens on".
Now I was wondering, how do I make an AI police officer, walk up to the car, and turn the sirens on.
I did try: unitname action "Sirens on" and that didn't seem to work.
Also, how to make those police cars START with the sirens on.
Thanks!
Mad Pup
-
Try this (http://www.ofpec.com/ed_depot/index.php?action=details&id=43&game=ArmA).
Also, to make unit perform action at beginning of the mission type in the command in "init" field.
-
I think addaction (http://www.ofpec.com/COMREF/index.php?action=details&id=5&game=All) may be what you're looking for. Regarding the siren, you will have to check out the addon readme for information concerning the use of the addon. If nothing is available in the Readme, try to unpbo the addon and search its files for added actions.
-
Thanks savedbygrace! Reading the ReadMe for the addon worked lol. I Have another questions though, how do you make addactions only visible to one side? For example, a police officer walks up to a civilian, and there's a script to make the civilian put his hands behind his head. And I put civilian'sname addaction ["Hands on head", "handtohead.sqs"] into the civilian's init line. So the police officer can execute it, but so can the civilian himself... anyway to make only so that the police officer can execute it?
Mad Pup
-
In that case you use two triggers with no radius.
Trigger#1
Condition: ? (officer distance thief <= 1)
OnActivation: arrest = officer addaction ["Hands on HEad", "handtohead.sqs"]
Trigger#2
Condition: ? (officer distance thief >= 1)
OnActivation: officer removeaction arrest
Make sure the triggers repeat. Adding the action to the officer should prevent others from using it.
-
Okay, I tried that, and whenever the police officer gets near the theif it shows up.... but the civilian can still do it when he gets near the police officer too.
-
I don't know of any way to make an action appear to only one side in *singleplayer*. In multiplayer, addAction only gives an action to the player whose computer executed the command. So if you're making an MP mission, then modify savedbygrace's conditions for the first trigger to:
officer distance thief <= 1 && officer == player
and probably also give the second trigger
officer distance thief > 1 && officer == player
But if this is a singleplayer mission, perhaps we can find a workaround.
Am I correct in assuming that the thief would be the player? If not, then no need to keep him from seeing the action, because AIs will never execute added actions of their own accord.
If he is a player, then savedbygrace's solution will probably work, unless the player would somehow want to get himself arrested. :P But actually, all you would need to do to get the player arrested when the cop comes up to him is place a trigger as follows:
Condition:
officer distance thief <= 1
On Activation:
player switchmove "FXStandSur"
Even players cannot move when they've been forced to perform that action. ;)
-
Actually RKurtzDmitriyev it is a multiplayer mission. :) There is one criminal (trying to get away) and 5 police officers (trying to catch him).