Jump to content
Sign in to follow this  
_SeveN_

Difference between AI and Player

Recommended Posts

Hi All!

Maybe this is the good place for my question.

If im the leader (P1) in MP and ive got another soldier (P2) in my group, how can i know that P2 is AI or another Player.

So:

i have two script: AI.sqs and Player.sqs

? _soldier == player : [_soldier] exec "player.sqs"

? _soldier != player : [_soldier] exec "ai.sqs"

than in my machine P1 will run "player.sqs" and P2 will run "ai.sqs"

but on P2s machine P1 will run "ai.sqs" and P2 will run "player.sqs"

I would like to do that if P2 local run "player.sqs" than at P1s local dont run "ai.sqs".

Becouse if i know well soldiers are local on every client.

My problem is that on every client has differen local player.

On my computer P1 is local player and P2 is an ai. And the same time on P2s computer P2 is local player and P1 is an AI.

P2 runs two script : one "player.sqs" on P2s computer and one "ai.sqs" on P1s computer.

I hope u can undnerstand it and sorry for my bad english.

Share this post


Link to post
Share on other sites
Quote[/b] ]My problem is that on every client has differen local player.

Then use that to your advantage:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">if (local Unit2) than {do stuff}

A unit in your group will always be local if it is AI but will NOT be local if it is another player!

Note: you cannot use this reliably to test units in other groups.

[EDIT] I correct myself, this only works for the leader. If you want P2 to find out if the leader or rest of group is AI, you must find a different method. I suggest just having the leader run the scripts. Does P2 have to run a script foreach unit?

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  

×