Home   Help Search Login Register  

Author Topic: Detect if unit is AI or human  (Read 660 times)

0 Members and 1 Guest are viewing this topic.

Rocko Bonaparte

  • Guest
Detect if unit is AI or human
« on: 14 Dec 2004, 05:38:46 »
How could I determine if a unit is AI-controlled or human-controlled in a multiplayer setting?

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:Detect if unit is AI or human
« Reply #1 on: 14 Dec 2004, 06:15:52 »
get this one to the multiplayer board

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
Re:Detect if unit is AI or human
« Reply #2 on: 14 Dec 2004, 08:00:35 »
?myUnit !=player

Is true if unit is AI-controlled.

?myUnit ==player

Is true if unit is under human controll.
OFPEC | Intel Depot
RETARDED Ooops... Retired!

Rocko Bonaparte

  • Guest
Re:Detect if unit is AI or human
« Reply #3 on: 14 Dec 2004, 21:12:08 »
get this one to the multiplayer board
Hrm... I guess I'll cross-post is now:

http://www.ofpec.com/yabbse/index.php?board=7;action=display;threadid=20909;start=%200#lastPost

?myUnit !=player won't work in a multiplayer environment. This is a multiplayer server script, and hence there is more than one player.  This will only identify with the server's player, if there is one.  Anyhow, it's been moved over to Multiplayer.

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:Detect if unit is AI or human
« Reply #4 on: 14 Dec 2004, 22:02:55 »
um, someone correct me if im wrong but im pretty sure that the value player is different for every CP on the server.

that mean you can check to see if a player is on the west side and then play a sound:
Code: [Select]
? (side player == west) : playmusic "RTrack10"
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
Re:Detect if unit is AI or human
« Reply #5 on: 16 Dec 2004, 17:06:23 »
I've used "player" in MP-missions several times, to delete all units not under player control. Never encountered any problems with it. Player seems to be a unique term to every machine, not just the server.
OFPEC | Intel Depot
RETARDED Ooops... Retired!

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
Re:Detect if unit is AI or human
« Reply #6 on: 16 Dec 2004, 17:08:59 »
?myUnit !=player won't work in a multiplayer environment. This is a multiplayer server script, and hence there is more than one player.  This will only identify with the server's player, if there is one.

I put ?myUnit !=player in a trigger, not a script, btw
OFPEC | Intel Depot
RETARDED Ooops... Retired!