Jump to content
Sign in to follow this  
shibdib

Condition of presence, if unit is player

Recommended Posts

Any way to use condition of presence to check if a player is a player and not AI and as such not spawn certain units?

Trying to make a Co-op 2 mission SP compatible and this would help.

---------- Post added at 20:03 ---------- Previous post was at 19:46 ----------

Tried using

isPlayer p2;

On player 2's squad. And it doesn't show up!... but also doesn't show up when I spawn as player 2

Share this post


Link to post
Share on other sites

isPlayer is the correct command.

Might be that it's running too early, try

isPlayer p2 AND time > 0

Share this post


Link to post
Share on other sites
isPlayer is the correct command.

Might be that it's running too early, try

isPlayer p2 AND time > 0

Nope still the same issue

Tried that and editting time from 0 to 5... units still won't spawn if I control p2

Edited by shibdib

Share this post


Link to post
Share on other sites
Use deleteVehicle.

How so?

I'm guessing put this in init

if (!isPlayer p2) then {null = [] execvm "scripts\singleplayer_init.sqf"}

and then have singleplayer_init.sqf contain stuff like

deleteVehicle s21;

deleteVehicle s22;

etc...

Or am I completely off?

---------- Post added at 20:58 ---------- Previous post was at 20:41 ----------

Well that didn't work so guess I was wrong :P

Share this post


Link to post
Share on other sites

Basically yes. If you can't prevent them from being created, just delete them when not needed.

Share this post


Link to post
Share on other sites

[/color]Got it to work!

Created a trigger that has the condition

!isDedicated and !isMultiplayer

and the on act.

deleteVehicle p2; hint "Singleplayer Mode Activated";

and then set everything you don't want in single player to have condition

!alive p2 and time > 10

Edited by shibdib

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×