Create Objects
create_building
- 定義: 新しく建築物を作成する.
- 構文:int create_building( int who_receiver, int x, int y, string build_type);
- パラメータ:
1.who_receiver - 所属文明番号 1-8, 番号は所属する文明のカラーによる。
2.x – ゲーム上でのx座標
3.y – ゲーム上でのy座標
4.build_type – 作成される
ユニットの種類
- 戻り値:成功,真 - 建築されたID , 偽 - 0, 失敗 - -1 .
- 使用例:new_id = create_building(2, 155, 165, "Stable");
説明: create_building creates 文明2(青)がゲーム座標(155,165)においてStable(兵舎)を建築する。new_idには兵舎のID番号が与えられる。
create_building_upgrade
create_building_near
- 定義:Creates a new building for a player, and gives some slack for placement if the exact game world coordinates are already occupied.
- 構文:int create_building_near( int who_receiver, int x, int y, string build_type, int dist_radius);
- パラメータ:
1.who_receiver – a nation index 1-8, based on nation color
2.x – game world X position
3.y – game world Y position
4.build_type – a building type name
5.dist_radius – game world distance radius (in “tile units”)
- 戻り値:The new building’s ID if true or success, 0 if false, -1 if failed.
- 使用例:new_id = create_building_near(2, 155, 165, “Stable”, 10);
説明: create_building_near creates a Stable for nation 2 within 10 tiles of the game world coordinates 155, 165 and sets new_id equal to the new building’s ID number.
create_building_upgrade –
works the same as create_building (More), except it creates the current upgrade of the building.
create_unit
- 定義:Creates a new unit for a player. Clears the current group and starts a new one with this unit. Can create more than one unit.
- 構文:int create_unit( int who_receiver, int x, int y, string unit_type, int num_units);
- 変数:
1. who_receiver – a nation index 1-8, based on nation color
2.x – game world X position
3.y – game world Y position
4.unit_type – a unit type name
5.num_units – an integer value
- 戻り値:The unit ID of the first unit you create if true or success, 0 if false, -1 if failed.
- 使用例:new_id = create_unit(2, 155, 165, “Inti Clubmen”, 5);
説明: create_unit creates 5 Inti Clubmen for nation 2 at the game world coordinates 155, 165 and sets new_id equal to the first created unit’s ID number. Clears the current group and places them into a new group.
create_unit_in_group, create_unit_upgrade
create_unit_in_group –
works the same as create_unit (above), except that it creates the current upgrade of the unit and does not clear the current group. The created unit is added to the current group.
create_unit_upgrade –
works the same as create_unit (More), except that it creates the current upgrade of the unit
最終更新:2006年09月10日 16:12