OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: RedHavoc on 19 Dec 2004, 15:00:57
-
How can I get the AI to shoot flares? ???
-
From the online comref:
Fire Command
unit fire weaponName
Operand types:
unit: Object
weaponName: String
Type of returned value:
Nothing
Description:
Unit will fire from given weapon.
Example:
soldierOne fire "HandGrenade"
You therefore need to write
soldierone fire ["m203","flare"]Assuming its a Western geezer
I think :-\
-
unitName fire ["m203muzzle", "flare"] 8)
-
yeah that too :P
-
Same for east?
-
Nope, for east it's:
unitName fire ["grenadesmuzzle", "flare"]
-
You don't need to include "muzzle". Just type:
unitname fire "flare"
Oh, by the way, try adding different colours, it can look really cool, you can use it for different signals during battle, like flarered or flaregreen. There are more, but I can't remember them.
-
...flareyellow, and i'm not sure but there's a flareblue (goes with lighting)
you'll have to add them to the unit before they can shoot it though, its under addmagazine (obviously)
-
You don't need to include "muzzle". Just type:
unitname fire "flare"
I just tried that (with both east and west officers, night equipment). It didn't work at all.
-
unitname fire "flare"
does work. Preview the mission as the unit in question and make sure you can fire a flare. Check that you are spellling the name the same way everywhere and so on.
-
how do you get them to fire a grenade or flare at a certain object like a marker or game logic
-
I'm not sure it will try to hit a marker or game logic, but it will hit something like an empty object.
This DoTarget Obj; This Fire ["m203Muzzle";"Grenade"]
i hope it works like that, i don't have my comp. It's just an educated guess. ;)
-
unitname fire "flare"
does work. Preview the mission as the unit in question and make sure you can fire a flare. Check that you are spellling the name the same way everywhere and so on.
Erm... the questions was...
How can I get the AI to shoot flares? ???
...and not "How do I get the player to shoot flares?"
But anyway, whatever I try...
unitname fire "flare"...doesn't seem to do nothing at all here, no matter if I try that with an AI or the player unit, and no matter if it's in the mission or in the intro. I just checked it, over and over and again.
Both array versions for east and west work fine here though, just like they always did. Well, at least for AI units.
-
look at this script i wrote its got all the different soldiers fireing different flares just take the parts out you need
http://www.ofpec.com/editors/resource_view.php?id=733
-
Nice, RedHouse.
:)
I tend to camCreate flares if I find they're 'important' in a mission, like...
Flare = "Flare" camCreate [getPos unitName select 0, getPos unitName select 1, 130]...I just don't trust those crazy AIs... they might have already died... run away... etc. Be aware that, if you create them below 130m, those flares might become deadly... For example, try this...
Flare = "Flare" camCreate [getPos player select 0, getPos player select 1, 120]...and don't move.
:D
-
ok ill try it later