Skip to content

Modifying Units

← EXE Functions · code catalog

Friendly names for EXE category 8. Each maps to a top-level EXE code.


AddUnit

AddUnit(unitpredef: int, x: int, y: int, regime: int, text: string)  ·  exe 6

No in-game description provided; behaviour inferred from the function name.

Parameters

  • unitpredef (int) — UnitPreDef#
  • x (int) — X
  • y (int) — Y
  • regime (int) — Regime#
  • text (string) — Text / DataString payload

The trailing text argument is sent as the SET-logic DataString (the final inline slot).

Example: exe(6,200,12,8,4,'Example Text')


UnitRdnModify

UnitRdnModify(unit: int, absoluteModifierPts: int, people: int, sftypegroup: int)  ·  exe 95

Change stats of subformations in a specified unit.

Parameters

  • unit (int) — Unit #
  • absoluteModifierPts (int) — Absolute modifier pts +/-
  • people (int) — People (-1=all)
  • sftypegroup (int) — SFTypeGroup (-1=all)

Example: exe(95,1,10,2,1)


UnitMorModify

UnitMorModify(unit: int, absoluteModifierPts: int, people: int, sftypegroup: int)  ·  exe 96

Change stats of subformations in a specified unit.

Parameters

  • unit (int) — Unit #
  • absoluteModifierPts (int) — Absolute modifier pts +/-
  • people (int) — People (-1=all)
  • sftypegroup (int) — SFTypeGroup (-1=all)

Example: exe(96,1,10,2,1)


UnitXpModify

UnitXpModify(unit: int, absoluteModifierPts: int, people: int, sftypegroup: int)  ·  exe 97

Change stats of subformations in a specified unit.

Parameters

  • unit (int) — Unit #
  • absoluteModifierPts (int) — Absolute modifier pts +/-
  • people (int) — People (-1=all)
  • sftypegroup (int) — SFTypeGroup (-1=all)

Example: exe(97,1,10,2,1)


UnitApModify

UnitApModify(unit: int, absoluteModifierPts: int, movetypegroup: int, sftypegroup: int)  ·  exe 98

Change stats of subformations in a specified unit.

Parameters

  • unit (int) — Unit #
  • absoluteModifierPts (int) — Absolute modifier pts +/-
  • movetypegroup (int) — MoveTypeGroup (-1=all)
  • sftypegroup (int) — SFTypeGroup (-1=all)

Example: exe(98,1,10,1,1)


UnitGiveTroops

UnitGiveTroops(unit: int, predefUnit: int)  ·  exe 99

Add all troops in PreDef unit to this Unit.

Parameters

  • unit (int) — Unit #
  • predefUnit (int) — Predef Unit#

Example: exe(99,1,200)


UnitOffensiveBonus

UnitOffensiveBonus(unit: int, absoluteModifierPts: int, people: int, sftypegroup: bool)  ·  exe 100

Change stats of subformations in a specified unit. If you set modifier to 0 it resets the offmod to 0. Each point is a percentage point. If you specify a sftypegroup >=100 then you are actually specifiying a specific SFType Nr.

Parameters

  • unit (int) — Unit #
  • absoluteModifierPts (int) — Absolute modifier pts +/-
  • people (int) — People (-1=all)
  • sftypegroup (bool) — SFTypeGroup (-1=all) (>=100 = specific sftype -100) (9001=only for artRange>0)

Example: exe(100,1,10,2,1)


UnitDefensiveBonus

UnitDefensiveBonus(unit: int, absoluteModifierPts: int, people: int, sftypegroup: bool)  ·  exe 101

Change stats of subformations in a specified unit. If you set the modifier to 0 it resets the defmod to 0. Each point is a percentage point. If you specify a sftypegroup >=100 then you are actually specifiying a specific SFType Nr.

Parameters

  • unit (int) — Unit #
  • absoluteModifierPts (int) — Absolute modifier pts +/-
  • people (int) — People (-1=all)
  • sftypegroup (bool) — SFTypeGroup (-1=all) (>=100 = specific sftype -100)

Example: exe(101,1,10,2,1)


UnitSelectable

UnitSelectable(unit: int)  ·  exe 102

The specified unit will now be selectable in the 'select a unit' popup screen. Use this exec in a pre-event from an actioncard.

Parameters

  • unit (int) — Unit #

Example: exe(102,1)


MoveUnit

MoveUnit(unit: int, newX: int, newY: int)  ·  exe 132

Keep in mind combat can occur immediatly after the move. Rebel Battle Mode will be used.

Parameters

  • unit (int) — Unit #
  • newX (int) — New X
  • newY (int) — New Y

Example: exe(132,1,1,1)


ChangeUnitRegime

ChangeUnitRegime(unit: int, newRegime: int)  ·  exe 133

Keep in mind combat can occur immediatly after the move. Rebel Battle Mode will be used.

Parameters

  • unit (int) — Unit #
  • newRegime (int) — New Regime#

Example: exe(133,1,4)


ModifyUnitSupply

ModifyUnitSupply(regime: int, specificUnit: int, modifier: int, modifierAbsolute: int)  ·  exe 140

Increases or decreases supplies of the unit. cannot go over max supplystore.

Parameters

  • regime (int) — Regime (-1=none)
  • specificUnit (int) — Specific Unit (-1=none)
  • modifier (int) — Modifier % (100=keep same, 50=half, 200=double)
  • modifierAbsolute (int) — Modifier absolute (0=nill, -x , +x )

Example: exe(140,4,1,50,1)


RemoveUnits

RemoveUnits(regime: int)  ·  exe 141

No in-game description provided; behaviour inferred from the function name.

Parameters

  • regime (int) — Regime #

Example: exe(141,4)


ChangeCommander

ChangeCommander(unit: int, historicalUnit: int)  ·  exe 144

Replace the commander with that from a historical unit.

Parameters

  • unit (int) — Unit#
  • historicalUnit (int) — Historical Unit#

Example: exe(144,1,1)


SetHQ

SetHQ(unit: int, hq: int)  ·  exe 172

No in-game description provided; behaviour inferred from the function name.

Parameters

  • unit (int) — Unit
  • hq (int) — HQ

Example: exe(172,1,1)


Removeunit

Removeunit(unit: int)  ·  exe 176

Removes specific Unit

Parameters

  • unit (int) — Unit #

Example: exe(176,1)


ChangeUnitEntrenchment

ChangeUnitEntrenchment(unit: int, arg: int)  ·  exe 180

Will auto cut at 0 or maximum entrench for sftype in hex..

Parameters

  • unit (int) — Unit#
  • arg (int) — -/+ entrenchment pts

Example: exe(180,1,10)


SetUnitName

SetUnitName(unit: int, newName: string)  ·  exe 185

Will set name of all belonging to units historical unit if using historical units. Shortname is only applied if historical unit is present.

Parameters

  • unit (int) — Unit#
  • newName (string) — New Name

Example: exe(185,1,'Name')


UnitPeopleModify

UnitPeopleModify(unit: int, changePeople: int, tooPeople: int)  ·  exe 187

Change the people in the unit.

Parameters

  • unit (int) — Unit #
  • changePeople (int) — Change People# (-1=all)
  • tooPeople (int) — Too People#

Example: exe(187,1,2,2)


SwitchUnitModel

SwitchUnitModel(unit: int, toModelId: int, changeNameAsIfNewUnit0: bool)  ·  exe 211

This function will attempt to change the whole historical unit# of unit# to a new model and will implement the changes immediately. A new name will be also be given if specified so.

Parameters

  • unit (int) — Unit#
  • toModelId (int) — To Model ID#
  • changeNameAsIfNewUnit0 (bool) — Change name as if new unit 0=no ,1=yes

Example: exe(211,1,1,1)


SetUnitCapacityPoints

SetUnitCapacityPoints(unit: int, landcapPts: int, railcapPts: int)  ·  exe 216

Allows you to remove or add capacity points to a unit. Use in late turn so the unit Cap point gain has already been processed before use of this exec.

Parameters

  • unit (int) — Unit#
  • landcapPts (int) — LandCap Pts +/-
  • railcapPts (int) — RailCap Pts +/-

Example: exe(216,1,10,10)


UnitOnTop

UnitOnTop(unitNr: int)  ·  exe 243

Makes sure this unit nr is on top of the stack in its hex.

Parameters

  • unitNr (int) — Unit nr#

Example: exe(243,1)


SetUnitStandingOrders

SetUnitStandingOrders(unit: int, retreat: int, supply: int, replacement: int)  ·  exe 246

Give unit slot number and percentages. Allows you to set a number of standing order % to a unit. If you specify -1 then the setting is not changed. Only 0-100 values are thus accepted. Retreat100% = fight till last Retreat0%=immediate retreat.

Parameters

  • unit (int) — Unit#
  • retreat (int) — Retreat%
  • supply (int) — Supply%
  • replacement (int) — Replacement%

Example: exe(246,1,50,50,50)


ModifyUnitFuel

ModifyUnitFuel(regime: int, specificUnit: int, modifier: int, modifierAbsolute: int)  ·  exe 359

Increases or decreases Fuel of the unit. cannot go over max fuel reserves

Parameters

  • regime (int) — Regime (-1=none)
  • specificUnit (int) — Specific Unit (-1=none)
  • modifier (int) — Modifier % (100=keep same, 50=half, 200=double)
  • modifierAbsolute (int) — Modifier absolute (0=nill, -x , +x )

Example: exe(359,4,1,50,1)


This doc was generated from extracting data from Shadow Empire version 1.32a on 2026-06-05 06:56 UTC.