Home   Help Search Login Register  

Author Topic: Checking for Leader  (Read 1542 times)

0 Members and 1 Guest are viewing this topic.

sgt.scorpion

  • Guest
Checking for Leader
« on: 01 Nov 2002, 17:14:41 »
Hi I am making a CO-OP mission that doesn't included any waypoints for the players squad, is there a way to make sure the leader is selected from the person selection screen before the mission loads?

Sgt. Scorpion

CareyBear

  • Guest
Re:Checking for Leader
« Reply #1 on: 01 Nov 2002, 22:35:56 »
Not that I know of.

One solution: put

disabledAI=1;

in your description.ext file. This will, however, disable all AI 'playable' units, so it might not be ideal for your mission - it will guarantee you a player leader though.

If you really want a group of a certain size, do this:

Disable the AI with the description.ext
Create a backup group of the same size as your original group of playables less one.
Once the mission starts, count the units in the player's group, then use the 'join' command (unit join group) to fill the player's group out to the number you want. Deletevehicle any remaining backups.

There may be a much more elegant solution, but I don't know what it is...  ;)

sgt.scorpion

  • Guest
Re:Checking for Leader
« Reply #2 on: 02 Nov 2002, 05:24:57 »
Thanks CareyBear
if I use ?(player == leadergrp) and comes back false,when I delete that ai leader will the game assign a player as a leader?
or another ai? just a thought.

CareyBear

  • Guest
Re:Checking for Leader
« Reply #3 on: 02 Nov 2002, 05:57:13 »
Next highest rank will become leader.

But remember, you're MP scripting. player is different on each machine, and therefore all machines except leader will eval to false if you do that.

maybe make all evaluate, then if one is true, publish publicvariable. Check for publicvariable a few seconds later, if not present, delete group leader. Repeat... slow, awkward solution though. mebbe go with the disabledAI = 1; solution