Skip to content

Technology

Written by: Alian713, Kramb


1. xsResearchTechnology

Returning Type: bool

Prototype: bool xsResearchTechnology(int techId, bool force, bool techAvailable, int playerNumber)

Parameters:

  1. int techId: The technology ID to research.
  2. bool force: Force researching the tech even if it is not enabled. To force an unavailable tech, the argument techAvailable must be set to false
  3. bool techAvailable: This flag determines if it is required to check if a tech is available before researching it
  4. int playerNumber: The player to research the technology for

Returns a boolean based on whether the technology was researched or not.

2. xsGetTechName

Returning Type: string

Prototype: string xsGetTechName(int techId, int playerId, bool internalName)

Parameters:

  1. int techId: The tech to get the name for
  2. int playerId: The player to get the tech's name for
  3. (Optional) bool internalName: Returns the internal name of the tech if set. !#xs false by default.

Returns the current name of the given tech for the specified player.

3. xsGetTechState

Returning Type: int

Prototype: int xsGetTechState(int techId, int playerId)

Parameters:

  1. int techId: The tech to get the state for
  2. int playerId: The player to get the tech's state for

Returns one of the cTechState constants based on the tech's status