SC2Mapster.com
Maps
Assets
Teams
Authors
Forums
Wiki
Paste
Sign in
Register new account
SC2Mapster.com Wiki
SC2 API
/
Functions
/
AISetStock
r6
Source
Markup:
<<apifunction>> <<name>>AISetStock<</name>> <<description>> <<code>>native void AISetStock (int player, int count, string aliasType);<</code>> Add an element to the production queue The stock system is working in bulk. You add all the units you want to the production queue. Then as soon as you add the same unit than before it starts a new bulk. It doesn't go to the next one until all the previous units are built. All the units in a bulk are being produced in paralell. The first units added are being produced and if you have the ressources to start the next then it will also be created. <</description>> <<param int player>>Player number<</param>> <<param int count>>Number of elements<</param>> <<param string aliasType>>Element you want to add the production queue. It can be either a unit, a building or an upgrade. Can be one of * [[SC2 API / Constants / Unit Type | Unit Type ]] * [[SC2 API / Constants / Building Type | Building Type ]] * [[SC2 API / Constants / Research Type | Research Type ]] <</param>> <<example Protoss Build>> void ProtossOpenGnd0 (int player) { AIClearStock(player); // Define first units and buildings AISetStock( player, 1, c_PB_Nexus ); AISetStock( player, 10, c_PU_Probe ); AISetStock( player, 1, c_PB_Pylon ); AISetStock( player, 1, c_PB_Gateway ); // By redefining Pylons you tell the AI to complete all the previous // tasks before starting these new ones AISetStock( player, 3, c_PB_Pylon ); AISetStock( player, 18, c_PU_Probe ); AISetStock( player, 2, c_PU_Zealot ); // Another block is done by redefining Pylon AISetStock( player, 4, c_PB_Pylon ); AISetStock( player, 6, c_PU_Zealot ); } // The previous code means: // Build 1 Nexus, 10 Probe, 1 Pylon, 1 Gateway // When everything listed before is done then // Build 2 Pylon, 8 Probe, 2 Zealot // When everything listed before is done then // Build 1 Pylon, 4 Zealot // Units and buildings inside a block are created in parallel <</example>> <<seealso>>AIClearStock<</seealso>> <<seealso>>AINewTechStock<</seealso>> <<seealso>>AIEnableStock<</seealso>> <</apifunction>>
Markup Type:
The type of markup for this entry.
Click here for details
.
BBCode
Markdown
Plain Text
WikiCreole