Author Topic: Placing An Ai Base  (Read 1646 times)

Offline Sirbomber

  • Hero Member
  • *****
  • Posts: 3238
Placing An Ai Base
« on: November 25, 2005, 10:19:14 PM »
How would I set up an ai base to always show up in a 4-player multiplayer game? And would I use 4 players max or 5 players max in DescBlock?
"As usual, colonist opinion is split between those who think the plague is a good idea, and those who are dying from it." - Outpost Evening Star

Outpost 2 Coding 101 Tutorials

Offline Eddy-B

  • Hero Member
  • *****
  • Posts: 1186
    • http://www.eddy-b.com
Placing An Ai Base
« Reply #1 on: November 26, 2005, 02:26:18 PM »
if you want 4 HUMAN players AND 1 AI player: use 5 players
Rule #1:  Eddy is always right
Rule #2: If you think he's wrong, see rule #1
--------------------

Outpost : Renegades - Eddy-B.com - Electronics Pit[/siz

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Placing An Ai Base
« Reply #2 on: November 26, 2005, 08:10:59 PM »
Yes, make sure the numPlayesr in the descblock includes all players in the game. Otherwise it won't initialize the player objects for those players and odd things happen. Usually all their units will show up on the minimap in white.

If you want to make sure the AI base is always placed, you might have to play around with the for loop to get it to terminate correctly. It's fairly easy to force placing a base after the loop for an AI player, but if you do that, you have to make sure their base won't be created in the loop. I'm not sure of the exact details, I can never remember exactly what the behavior of TethysGame::NoPlayers() is. Anyways, if you can't figure it out, I'm sure someone here either already knows or will look into it.