Debug Drawing

The debug_drawing interface allows the drawing of debug lines on the battlefield by script. A debug_drawing object may be retrieved from the battle object with battle:debug_drawing.

Note that debug lines must be enabled for these lines to display.

Loaded in Battle loaded in battle
Back to top

Functionality

debug_drawing:draw_white_circle_on_terrain(battle_vector position, number radius, number duration)

Draws a white circle on the terrain.

Parameters:

1

battle_vector

Centre position.

2

number

Radius of circle in m.

3

number

Duration for which to display the circle, in seconds.

Returns:

  1. nil

defined in ../../common/EmpireBattle/Source/BattleScript/BattleScriptDebugDrawing.cpp, line 93

debug_drawing:draw_white_line_on_terrain(battle_vector position, battle_vector position, number duration)

Draws a white line on the terrain.

Parameters:

1

battle_vector

Start position.

2

battle_vector

End position.

3

number

Duration for which to display the line, in seconds.

Returns:

  1. nil

defined in ../../common/EmpireBattle/Source/BattleScript/BattleScriptDebugDrawing.cpp, line 116

debug_drawing:draw_white_peg_on_terrain(battle_vector position, number duration)

Draws a vertical white line on the terrain.

Parameters:

1

battle_vector

Position.

2

number

Duration for which to display the peg, in seconds.

Returns:

  1. nil

defined in ../../common/EmpireBattle/Source/BattleScript/BattleScriptDebugDrawing.cpp, line 138

debug_drawing:draw_circle_on_terrain(
  
battle_vector position,
  number
radius,
  number
duration,
  battle_colour
colour
)

Draws a circle on the terrain of a supplied colour.

Parameters:

1

battle_vector

Centre position.

2

number

Radius of circle in m.

3

number

Duration for which to display the circle, in seconds.

4

battle_colour

Line colour.

Returns:

  1. nil

defined in ../../common/EmpireBattle/Source/BattleScript/BattleScriptDebugDrawing.cpp, line 157

debug_drawing:draw_line_on_terrain(
  
battle_vector position,
  battle_vector
position,
  number
duration,
  battle_colour
colour
)

Draws a line on the terrain of a supplied colour.

Parameters:

1

battle_vector

Start position.

2

battle_vector

End position.

3

number

Duration for which to display the line, in seconds.

4

battle_colour

Line colour.

Returns:

  1. nil

defined in ../../common/EmpireBattle/Source/BattleScript/BattleScriptDebugDrawing.cpp, line 182

debug_drawing:draw_peg_on_terrain(battle_vector position, number duration, battle_colour colour)

Draws a vertical line on the terrain of a supplied colour.

Parameters:

1

battle_vector

Position.

2

number

Duration for which to display the peg, in seconds.

3

battle_colour

Line colour.

Returns:

  1. nil

defined in ../../common/EmpireBattle/Source/BattleScript/BattleScriptDebugDrawing.cpp, line 204

debug_drawing:draw_2d_text(string text, number duration, number x, number y)

Draws some 2D debug text.

Parameters:

1

string

Text to display.

2

number

Duration for which to display the text, in seconds.

3

number

x position.

4

number

y position.

Returns:

  1. nil

defined in ../../common/EmpireBattle/Source/BattleScript/BattleScriptDebugDrawing.cpp, line 226

debug_drawing:draw_3d_text(string text, number duration, number x, number y, number z)

Draws some 3D debug text.

Parameters:

1

string

Text to display.

2

number

Duration for which to display the text, in seconds.

3

number

x position.

4

number

y position.

5

number

z position.

Returns:

  1. nil

defined in ../../common/EmpireBattle/Source/BattleScript/BattleScriptDebugDrawing.cpp, line 250


Colour

A colour object can be set up to represent a certain rgb colour. Once set up, a colour object can be passed to certain functions on the debug_drawing interface to draw debug lines of that colour.

Back to top

Creation

battle_colour:new(number red, number green, number blue)

Creates and returns a new battle_colour object.

Parameters:

1

number

Red colour value (0 - 255).

2

number

Green colour value (0 - 255).

3

number

Blue colour value (0 - 255).

Returns:

  1. battle_colour

defined in ../../common/EmpireBattle/Source/BattleScript/BattleScriptUtilities.cpp, line 477

Last updated 25/08/2021 12:07:51