I have a mission with 12 units available to select in in the slotting screen.
How do I detect if a human player or AI is selected/slotted?
I have a script that runs on startup that shows each unit and types a message about them like this:
_cam camsettarget m72
_cam camsetrelpos [4,4,2]
_cam camcommit 3
@camcommitted _cam
titletext [ format["%1 as the M72 cat - wannabe Aussie...", name m72],"plain down"];
m72 switchmove "EffectWeaponPanic";
~5
_cam camsettarget dragon
_cam camsetrelpos [0,5,4]
_cam camcommit 3
@camcommitted _cam
titletext [ format["%1 as the Dragon operator - he couldn't operate a can opener...", name
dragon],"plain down"];
dragon switchmove "FXStandhip";
~5
_cam camsettarget dragass
_cam camsetrelpos [0,5,4]
_cam camcommit 3
@camcommitted _cam
titletext [ format["%1 as the Dragon ammo bearer - lug that missile you dipstick...", name
dragass],"plain down"];
dragass switchmove "FXdismay";
~5
_cam camsettarget r1
_cam camsetrelpos [0,5,4]
_cam camcommit 3
@camcommitted _cam
titletext [ format["%1 as the Arse End Arnold - haha!", name r1],"plain down"];
r1 switchmove "FXangel";
~5
but if a human or AI is not selected it still shows the text. How do I get it to not show the text if there is no human or AI slotted to that unit?
I have tried ?(alive dude1)
like this but it doesnt work:
?(alive dude1) : goto "player1"
?(!alive dude2) : goto "player2"
#player1
_cam camsettarget dude1
_cam camsetrelpos [0,5,4]
_cam camcommit 3
@camcommitted _cam
titletext [ format["%1 as the scab-lifter medic", name dude1],"plain"];
dude1 playmove "FXstanddip";
~5
?(alive law) : goto "player2"
?(!alive law) : goto "player3"
#player2
_cam camsettarget law
_cam camsetrelpos [4,4,2]
_cam camcommit 3
@camcommitted _cam
titletext [ format["%1 as the Javelin anti-armour guy - what a tosser...", name law],"plain
down"];
law playmove "lyingstillv1";
~5
#player3
_cam camsettarget dude3
_cam camsetrelpos [0,4,2]
_cam camcommit 3
@camcommitted _cam
titletext [ format["%1 as the Javelin ammo bearer", name dude3],"plain down"];
dude3 playmove "effectstandsalute";
~3
etc....
Should I be using
?not local dude1: goto "player1"
or
?dude1 == player : goto "player1"
or something else???