SC2Mapster.com Wiki

AISetUserInt

void AISetUserInt(int player, int index, int data);

Stores integer data in a player-specific array for later retrieval.

Parameters

int player

The player this data will be associated with.

int index

The index of the array to store the data in. Valid values are 1-256. Supposedly Blizzard is using indexes 1-10 already.

int data

The value to be stored.

Examples

Example: Expansions
int player = 1;

// Load the user data
int numExpansions = AIGetUserInt(player, 109);

if ((AIGetTime() > 720) && (numExpansions < 1)) {
  //Actual expansion code here.
  // ...

  // Increment number of expansions we have by 1
  AISetUserInt(player, 109, numExpansions + 1);
}

// Index 109 was arbitrarily chosen as the index to store
// the number of expansions in for their particular AI.
// Any other index would work just as well.

You must login to post a comment. Don't have an account? Register to get one!

Facts

Date created
Mar 17, 2010
Last updated
Mar 25, 2010

Authors