Home   Help Search Login Register  

Author Topic: how to detect dropped players  (Read 1520 times)

0 Members and 1 Guest are viewing this topic.

duckwilliamson

  • Guest
how to detect dropped players
« on: 16 Nov 2003, 23:46:04 »
Does anyone know how to detect if a player was dropped in a game and then became controlled by ai?

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:how to detect dropped players
« Reply #1 on: 17 Nov 2003, 01:52:26 »
well as a pointer you cant delete a player, so if you had an array of all players and you kept it updated then simply run a delete vehicle command for every element of the array,  every 5 seconds or so. This way you would delete ai controlled player slots

(I take it that is why you want to know how to detect it)
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

duckwilliamson

  • Guest
Re:how to detect dropped players
« Reply #2 on: 17 Nov 2003, 06:41:45 »
well i'm actually trying to detect which one turns ai because i then want it to run a script which controls the ai characters so that they follow through the mission just as the human "would" ...

on my map there is a max of 6 players ... if any slots aren't filled then each ai player of the six runs a separate script that makes them move and do things as necessary ...

if a human drops, i'd like it so that the newly formed ai unit would join his buddies ...

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:how to detect dropped players
« Reply #3 on: 17 Nov 2003, 16:49:16 »
ok i would make 2 arrays

arrayA is an array of all units, eg all six of them

arrayB, which needs to be updated every time a player respawns, is an array of players

Subtract all alive elements in array B from array A and voila you should have an array of ai units

Then join these units to a different group

There's probably a damn sight easier way to do it, but at the moment that is all i have to offer

arrayA - arrayB = arrayC
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

Offline Doolittle

  • Contributing Member
  • **
  • _this select 0
Re:how to detect dropped players
« Reply #4 on: 17 Nov 2003, 19:15:16 »
This is what I've done:

For each player, give them a name, like w1, w2, etc. Then for each player's initialization field put playerList = playerList + ["w1"]. Match the string w/ the name you gave them.  I have found that you need to place an EAST AI somewhere in the ocean & make its initialization be playerList = [].  EAST is the first group to be "run"....you want to make sure the array is set to null first before you assign stuff to it.

THEN I have a script that is always running.  Something like this:

Code: [Select]
?not local serverLogicThatIMade : exit

_count = count playerList
#start
~5
_i = 0
#loop
_p = call (playerList select _i)
?not local _p : goto "continue"
?_p == player : goto "continue"
;do whatever you want them to do here

#continue
_i = _i + 1
?_i < _count : goto "loop"
goto "start"
Only the server should run this script!!  Now................what this means is...........if any player becomes local to the server then that means they are AI....so when they become local you give them commands to do.

Anyways.  This is how I do it...

Doolittle

duckwilliamson

  • Guest
Re:how to detect dropped players
« Reply #5 on: 18 Nov 2003, 02:03:44 »
well thanks a lot doolittle! that's exactly what i needed - jsut couldn't get my head around what to do ... forgot about all ai running only on server ...

thanks Terox for your attempts too ...