Author Topic: A Quirk....  (Read 1521 times)

Offline zigzagjoe

  • Hero Member
  • *****
  • Posts: 626
A Quirk....
« on: June 18, 2005, 01:37:01 AM »
It seems TethysGame::NoPlayers() is only accurate in initproc. I tried looking at the output after a player quited, and got no change.this should probly in the sdk for reference.

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
A Quirk....
« Reply #1 on: June 18, 2005, 03:17:55 PM »
I looked into this briefly. The numPlayers field in the DescBlock is copied to a local variable in the TethysGame class. It is never modified from there. So whenever you call TethysGame.NoPlayers(), you just get the value that was set in your DescBlock export. The only way to change the value is to load up a new level and have it read a new DescBlock.

So yeah, this would be the number of valid Player objects, whether or not they are used or alive. (Player objects outside of this range are buggy to use, like how they show up as white on the minimap no matter what their color is set to).

 

Offline BlackBox

  • Administrator
  • Hero Member
  • *****
  • Posts: 3093
A Quirk....
« Reply #2 on: June 22, 2005, 07:23:39 AM »
Well it does give you the number of players in multiplayer that are in the game.

For example if you have a 6 player map (field in DescBlock set to 6), and 4 players join it in a multiplayer session, NoPlayers() is gonna read 4.

But that number won't change during the game. (It shouldn't, since it can be useful to create buildings for players that are technically "dead", like in a colony mission, and there are better ways to check if a player is alive).