OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: greg147 on 29 Jan 2005, 09:51:31
-
Hi all,
Is there a way to make when a group of enemys goes within, say, 100m of the players group, a trigger is activated and the players says something like 'contact right!', then the groups both go into combat mode?
Thanks in advance ;)
-
Maybe you should create your own sounds with a microfone and say "contact" or whatever you want. Then put that sound in your mission..
Create a waypoint and find that sound in voices section. There is a Behaviour section somewhere in there, put there "combat" mode.
When you play it, you can hear that "contact" sound and your squad will go down ;)
-
#loop
~1
? leader alpha distance leader bravo <= 100 : goto "Combat"
#loop
#Combat
leader group player say "soundfile"
{_X setBehaviour "Combat"} forEach units group player
exit
In trigger put in condition field:
leader alpha distance leader bravo <= 100
and in activation field:
leader group player say "soundfile";
{_X setBehaviour "Combat"} forEach units group player
Not sure of syntax, if you have problems look in comref.
-
For the direction, you'd need to get the direction the player was facing with getDir, then use the trig guide in the Editors Depot to help you figure out the angle between the player and the opfor group, then find the angle between the two and call the appropriate sound file accordingly.
Sui's mission "The Black Gap", currently on the beta testing board, has a Command Interfact that includes this feature. When one of the squads under your command makes contact with the enemy, they call out the range and direction. You could unpbo the mission and find out how he does it. Remember to ask permission if you want to borrow anything.
-
Thanks for the help guys, just what I was looking for :D