Module twdll_unit
Functions for interacting with campaign units.
Functions
| SetStrength (unit, value) | Sets the current unit strength (soldier count). |
| SetMaxStrength (unit, value) | Sets the maximum unit strength (soldier capacity). |
| SetMovementPoints (unit, value) | Sets the remaining movement points for the unit. |
| GetStrength (unit) | Gets the current unit strength (soldier count). |
| GetMaxStrength (unit) | Gets the maximum unit strength (soldier capacity). |
| GetMovementPoints (unit) | Gets the remaining movement points for the unit. |
| GetMemoryAddress (unit) | Returns the memory address of the real unit object as a hexadecimal string. |
Functions
- SetStrength (unit, value)
-
Sets the current unit strength (soldier count).
Parameters:
- unit userdata the unit object (first argument)
- value integer new current strength
- SetMaxStrength (unit, value)
-
Sets the maximum unit strength (soldier capacity).
Parameters:
- unit userdata the unit object (first argument)
- value integer new maximum strength
- SetMovementPoints (unit, value)
-
Sets the remaining movement points for the unit.
Parameters:
- unit userdata the unit object (first argument)
- value integer new movement points
- GetStrength (unit)
-
Gets the current unit strength (soldier count).
Parameters:
- unit userdata the unit object (first argument)
Returns:
-
integer
current strength
- GetMaxStrength (unit)
-
Gets the maximum unit strength (soldier capacity).
Parameters:
- unit userdata the unit object (first argument)
Returns:
-
integer
maximum strength
- GetMovementPoints (unit)
-
Gets the remaining movement points for the unit.
Parameters:
- unit userdata the unit object (first argument)
Returns:
-
integer
movement points
- GetMemoryAddress (unit)
-
Returns the memory address of the real unit object as a hexadecimal string.
Parameters:
- unit userdata the unit object (first argument)
Returns:
-
string
memory address (e.g. "0x12345678")