Method: Sc2::Player::Debug#debug_create_unit

Defined in:
lib/sc2ai/player/debug.rb

#debug_create_unit(unit_type_id:, owner:, pos:, quantity: 1) ⇒ void

This method returns an undefined value.

Spawns a quantity of units under an owner at position given

Parameters:

  • unit_type_id (Integer)

    Api::UnitTypeId::*

  • owner (Integer)

    typically you are 1 and 2 is enemy (see @common.player_id)

  • pos (Api::Point2D)

    position in 2d

  • quantity (Integer) (defaults to: 1)

    default 1



215
216
217
218
219
220
221
222
223
224
# File 'lib/sc2ai/player/debug.rb', line 215

def debug_create_unit(unit_type_id:, owner:, pos:, quantity: 1)
  queue_debug_command Api::DebugCommand.new(
    create_unit: Api::DebugCreateUnit.new(
      unit_type: unit_type_id,
      owner:,
      pos:,
      quantity:
    )
  )
end