OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: Golf33 on 31 Oct 2003, 06:45:27
-
Hurro folks, great site you have here!
My question is this. I have a multiplayer mission with a tank troop and mech inf section attacking Montignac. The two groups are separate but I would like the infantry to be able to designate targets for the tanks and vice versa.
I've been searching these forums and the code snippets but haven't found an answer (or haven't recognised it if I have seen it).
Is there any way to pass information on a target seen by one group to another group and have them engage it?
Thanks
33
-
Welcome to the forum!
Are the groups in question AI or human controlled?
-
One of the groups is human-controlled, the other AI-controlled.
-
*bump any ideas?
-
These things might be complexed, but it's do-able! :)
First of all... You have to find out what unit you're targeting. I've searched the comref, but I couldn't find any function thet do this. Maybe you can work out a walkaround??
This object must be publicvariabled so that the server can command the unit to target the object.
Something like this:
INIT.SQS
currTarget = objnull
SENDTARGET.SQS (to use with addAction....)
_caller = _this select 1
currTarget = getTarget _caller
publicVariable "currTarget"
GETTARGET.SQS (executed on the server)
#start
@(currTarget == currTarget)
{_x doTarget currTarget} forEach (units AIGROUP)
currTarget = objNull
goto "start"
OBSERVE that "getTarget" doesn't work!!! You'll have to do a walkaround to find out what object is targetted.
AIGROUP is the group of tanks...
PS. However... You could with ease order your tanks to go to your position if you can't find a way to get the targetted object!