Skip to content

Hardcoded Set — exe(346, …) Gateway Functions

← EXE Functions · EXE code catalog

exe(346, …) (ExecHardcodedSet, EXE code 346) is a second-level dispatcher: its first argument is a sub-function number. It is the most-used family in shipped logic (e.g. exe(346,24,ZONEID,$1$) adds a hex perk). Each sub-function below gets a friendly name; they all compile to exe(346, sub, …). See the exe 346 catalog row and the exe(346) section of the EXE reference.

Numeric IDs may be replaced by $N$ S&S-ID references or flag instructions (e.g. ZONEID, REGIMEID, TEMP1) exactly as in raw EXE.


RecruitCharacter

RecruitCharacter(careerId: int, capacity: int, ageSlot: int)  ·  exe 346,1

Rolls and recruits a new character into your service. Add 1000 to careerId to bias male, 2000 to bias female.

Parameters

  • careerId (int) — Final Career ID
  • capacity (int) — Capacity level
  • ageSlot (int) — Age slot

Example: exe(346,1,13,3,40)


DeclareWar

DeclareWar(regimeSlot: int, targetSlot: int)  ·  exe 346,2

Declares war between two regimes.

Parameters

  • regimeSlot (int) — Regime slot
  • targetSlot (int) — Target regime slot

Example: exe(346,2,2,3)


ChangeWorkerHappiness

ChangeWorkerHappiness(regimeId: int, points: int)  ·  exe 346,3

Adds points to Worker Happiness in every zone the regime owns (clamped 0–100).

Parameters

  • regimeId (int) — Regime ID (owner of zones)
  • points (int) — Points (+/-)

Example: exe(346,3,4,30)


ChangePopHappiness

ChangePopHappiness(regimeId: int, points: int)  ·  exe 346,4

Adds points to Population Happiness in every zone the regime owns (clamped 0–100).

Parameters

  • regimeId (int) — Regime ID
  • points (int) — Points (+/-)

Example: exe(346,4,4,30)


ChangeUnitMorale

ChangeUnitMorale(regimeId: int, points: int, peopleFilter: int)  ·  exe 346,5

Modifies morale of the regime's (militia/historical) units, optionally limited to one People.

Parameters

  • regimeId (int) — Regime ID
  • points (int) — Points (+/-)
  • peopleFilter (int) — People filter (HisVar 11; 0=all)

Example: exe(346,5,4,20,0)


ChangeUnitXp

ChangeUnitXp(regimeId: int, points: int)  ·  exe 346,6

Modifies XP of the regime's units.

Parameters

  • regimeId (int) — Regime ID
  • points (int) — Points (+/-)

Example: exe(346,6,4,10)


KillTroopsInZone

KillTroopsInZone(zoneId: int, regimeId: int, count: int)  ·  exe 346,7

Removes troops in a zone, sparing the most powerful last (power-sorted).

Parameters

  • zoneId (int) — Zone ID
  • regimeId (int) — Regime ID
  • count (int) — Individuals to remove

Example: exe(346,7,1,4,30)


AddRebelUnitSpread

AddRebelUnitSpread(zoneId: int, rebelRegimeId: int, mode: int)  ·  exe 346,8

Spawns rebel unit(s) spread across the zone's hexes.

Parameters

  • zoneId (int) — Zone ID
  • rebelRegimeId (int) — Rebel regime ID
  • mode (int) — Mode (1 or 6)

Example: exe(346,8,1,4,1)


ChangeUnitMoralePercent

ChangeUnitMoralePercent(regimeId: int, invPercent: int, peopleFilter: int)  ·  exe 346,9

Modifies unit morale percentually for the regime's units.

Parameters

  • regimeId (int) — Regime ID
  • invPercent (int) — Inverse percentage
  • peopleFilter (int) — People filter (0=all)

Example: exe(346,9,4,20,0)


AddUnitToRegime

AddUnitToRegime(regimeId: int, cultureId: int, unitCodeId: int)  ·  exe 346,10

Adds a unit to the regime (by culture + unitcode; distinct from the top-level AddUnit which places a predefined unit at an XY hex).

Parameters

  • regimeId (int) — Regime ID
  • cultureId (int) — Culture ID
  • unitCodeId (int) — Unitcode ID

Example: exe(346,10,4,1,3)


AddItemToCity

AddItemToCity(zoneId: int, itemTypeId: int, qty: int)  ·  exe 346,11

Adds/removes an item in the zone's city location.

Parameters

  • zoneId (int) — Zone ID
  • itemTypeId (int) — Item Type ID
  • qty (int) — Quantity (+/-)

Example: exe(346,11,1,7,100)


ChangeTraderCredits

ChangeTraderCredits(traderZoneId: int, percentChange: int, qtyChange: int)  ·  exe 346,12

Adjusts a trader's credits by percentage and/or flat amount.

Parameters

  • traderZoneId (int) — Trader-zone ID
  • percentChange (int) — Percentage change (+/-)
  • qtyChange (int) — Flat quantity change (+/-)

Example: exe(346,12,1,0,50)


SwitchUnitToRebel

SwitchUnitToRebel(unitSlot: int, regimeId: int, allowBattle: bool)  ·  exe 346,13

Converts an existing unit to rebels.

Parameters

  • unitSlot (int) — Unit slot
  • regimeId (int) — Regime ID
  • allowBattle (bool) — Allow start battle (0/1)

Example: exe(346,13,1,4,1)


StartAllBattles

StartAllBattles(regimeId: int, withRegimeId: int)  ·  exe 346,14

Starts all battles between the two regimes.

Parameters

  • regimeId (int) — Regime ID
  • withRegimeId (int) — With regime ID

Example: exe(346,14,4,3)


AddRebelUnitAtLoc

AddRebelUnitAtLoc(zoneId: int, rebelRegimeId: int, unitCodeId: int)  ·  exe 346,15

Spawns a rebel unit at a location.

Parameters

  • zoneId (int) — Zone/loc reference
  • rebelRegimeId (int) — Rebel regime ID
  • unitCodeId (int) — Unitcode ID

Example: exe(346,15,1,4,3)


SetAssetInfo

SetAssetInfo(assetId: int, infoType: int, value: int)  ·  exe 346,16

Sets a piece of asset info.

Parameters

  • assetId (int) — Asset ID
  • infoType (int) — Info type (1=mining ease)
  • value (int) — New value

Example: exe(346,16,1,1,5)


AssetIncreaseLevel

AssetIncreaseLevel(zoneId: int, assetFamilyId: int)  ·  exe 346,17

Increases an asset family's level in the zone.

Parameters

  • zoneId (int) — Zone ID
  • assetFamilyId (int) — Asset Family ID

Example: exe(346,17,1,1)


AddAsset

AddAsset(zoneId: int, assetTypeId: int)  ·  exe 346,18

Adds an asset to the zone.

Parameters

  • zoneId (int) — Zone ID
  • assetTypeId (int) — Asset Type ID

Example: exe(346,18,1,1)


GiveTech

GiveTech(regimeId: int, techTypeId: int)  ·  exe 346,19

Sets a tech level for the regime.

Parameters

  • regimeId (int) — Regime ID
  • techTypeId (int) — Tech Type ID

Example: exe(346,19,4,116)


GiveCharFeat

GiveCharFeat(charId: int, charFeatId: int)  ·  exe 346,20

Grants a character feat.

Parameters

  • charId (int) — Character ID
  • charFeatId (int) — Character Feat ID

Example: exe(346,20,1,827)


RemoveSpies

RemoveSpies(spyingRegimeId: int, zoneOwnerRegimeId: int, count: int)  ·  exe 346,21

Removes spies of a regime from another regime's zones.

Parameters

  • spyingRegimeId (int) — Spying regime ID
  • zoneOwnerRegimeId (int) — Zone-owner regime ID
  • count (int) — Number to lose

Example: exe(346,21,4,3,1)


MakePeace

MakePeace(regimeSlot: int, otherSlot: int)  ·  exe 346,22

Makes peace between two regimes.

Parameters

  • regimeSlot (int) — Regime slot
  • otherSlot (int) — Other regime slot

Example: exe(346,22,2,3)


GivePp

GivePp(regimeId: int, pp: int)  ·  exe 346,23

Adds Political Points (RegimeObj.ResPts) to the regime.

Parameters

  • regimeId (int) — Regime ID
  • pp (int) — PP points (+/-)

Example: exe(346,23,4,50)


AddHexPerk

AddHexPerk(zoneId: int, perkId: int)  ·  exe 346,24

Places a hex perk on a random eligible hex of the zone (also names/sprites the hex).

Parameters

  • zoneId (int) — Zone ID
  • perkId (int) — Perk ID (use $N$ for your perk)

Example: exe(346,24,1,1)


AddUnitFeat

AddUnitFeat(hisUnitId: int, unitFeatId: int, qty: int)  ·  exe 346,25

Adds/modifies a unit feat on a historical unit.

Parameters

  • hisUnitId (int) — Historical-unit ID
  • unitFeatId (int) — Unit Feat ID
  • qty (int) — Quantity (+/-)

Example: exe(346,25,1,38,1)


ChangeUnitXpByHis

ChangeUnitXpByHis(hisUnitId: int, points: int)  ·  exe 346,26

Modifies a single unit's XP by its historical ID.

Parameters

  • hisUnitId (int) — Historical-unit ID
  • points (int) — Points (+/-)

Example: exe(346,26,1,10)


GiveArtifactStratagem

GiveArtifactStratagem(regimeId: int, rarityTier: int, qty: int)  ·  exe 346,27

Grants random artifact stratagem card(s).

Parameters

  • regimeId (int) — Regime ID
  • rarityTier (int) — Rarity tier (0=any,1..4)
  • qty (int) — Quantity

Example: exe(346,27,4,0,1)


GiveTechDiscovery

GiveTechDiscovery(regimeId: int, techTypeId: int)  ·  exe 346,28

Makes a tech discoverable for the regime.

Parameters

  • regimeId (int) — Regime ID
  • techTypeId (int) — Tech Type ID

Example: exe(346,28,4,116)


ChangeLeaderLoyaltyByJob

ChangeLeaderLoyaltyByJob(regimeId: int, jobType: int, invPercent: int)  ·  exe 346,29

Modifies leader loyalty (char col 20) for all leaders of a job in the regime.

Parameters

  • regimeId (int) — Regime ID
  • jobType (int) — JobType (<=0=any)
  • invPercent (int) — Inverse percentage (+/-)

Example: exe(346,29,4,10,20)


GiveLeaderXpByJob

GiveLeaderXpByJob(regimeId: int, jobType: int, points: int)  ·  exe 346,30

Grants leader XP (char col 17) by job.

Parameters

  • regimeId (int) — Regime ID
  • jobType (int) — JobType (<=0=any)
  • points (int) — Points

Example: exe(346,30,4,10,10)


DestroyAssets

DestroyAssets(zoneId: int, assetFamilyId: int, levels: int)  ·  exe 346,31

Destroys asset levels in a zone.

Parameters

  • zoneId (int) — Zone ID
  • assetFamilyId (int) — Asset Family
  • levels (int) — Levels to destroy

Example: exe(346,31,1,1,1)


KillTroopsInCity

KillTroopsInCity(zoneId: int, regimeId: int, count: int)  ·  exe 346,32

Removes troops in the zone's city (variant of KillTroopsInZone).

Parameters

  • zoneId (int) — Zone ID
  • regimeId (int) — Regime ID
  • count (int) — Individuals

Example: exe(346,32,1,4,30)


GiveStratagem

GiveStratagem(regimeId: int, stratagemId: int)  ·  exe 346,33

Gives a stratagem card to the regime.

Parameters

  • regimeId (int) — Regime ID
  • stratagemId (int) — Stratagem / Card ID

Example: exe(346,33,4,1)


ForcePeaceRelation

ForcePeaceRelation(regimeSlot: int, otherSlot: int)  ·  exe 346,35

Forces the peace relation (sets RegimeRel=1 both ways, clears dip).

Parameters

  • regimeSlot (int) — Regime slot
  • otherSlot (int) — Other regime slot

Example: exe(346,35,2,3)


ChangeLeaderLoyalty

ChangeLeaderLoyalty(charId: int, invPercent: int)  ·  exe 346,37

Modifies a single leader's loyalty (char col 20).

Parameters

  • charId (int) — Character ID
  • invPercent (int) — Inverse percentage (+/-)

Example: exe(346,37,1,20)


SetRegimeFeat

SetRegimeFeat(regimeId: int, regimeFeatId: int, remove: bool)  ·  exe 346,38

Adds or removes a regime feat.

Parameters

  • regimeId (int) — Regime ID
  • regimeFeatId (int) — Regime Feat ID
  • remove (bool) — 0=add, 1=remove

Example: exe(346,38,4,1,0)


RunCorporateLogic

RunCorporateLogic(arg: int)  ·  exe 346,39

Runs the hardcoded Corporate module logic.

Parameters

  • arg (int) — Parameter

Example: exe(346,39,1)


RunCultLogic

RunCultLogic(arg: int)  ·  exe 346,40

Runs the hardcoded Cult module logic.

Parameters

  • arg (int) — Parameter

Example: exe(346,40,1)


RemoveLeader

RemoveLeader(charId: int)  ·  exe 346,41

Removes a leader and all trace of them.

Parameters

  • charId (int) — Character ID

Example: exe(346,41,1)


ZoneEnforcement

ZoneEnforcement(enemyVarId: int, zoneId: int, percentMod: int)  ·  exe 346,42

Runs a zone enforcement action (a unit 'fights' the enemy variable, e.g. protestors/strikers). Enemy IDs: 1=protest,2=theft,3=harassment,4=riot,5=plunder,6=agitators,7=rallies,51=minor strike,52=major strike.

Parameters

  • enemyVarId (int) — Enemy Variable ID
  • zoneId (int) — Zone ID
  • percentMod (int) — % modifier (100=normal)

Example: exe(346,42,7,1,100)


AddRebelUnitXy

AddRebelUnitXy(xy: xy, regimeId: int, unitCode: int, cultureId: int)  ·  exe 346,44

Spawns a rebel unit at an XY hex. cultureId is passed as the DataString slot.

Parameters

  • xy (xy) — XY-encoded hex
  • regimeId (int) — Regime ID
  • unitCode (int) — Unit code
  • cultureId (int) — Culture ID (DataString)

Example: exe(346,44,12008,4,8,1)


RelieveLeader

RelieveLeader(charId: int)  ·  exe 346,45

Relieves a leader from their post (resets advisor + clears job).

Parameters

  • charId (int) — Character ID

Example: exe(346,45,1)


ResetUnitPosture

ResetUnitPosture(hisUnitId: int)  ·  exe 346,46

Clears posture / resets HisVars 21–41 for a unit (and its subordinates if an HQ).

Parameters

  • hisUnitId (int) — Historical-unit ID

Example: exe(346,46,1)


DeclareJoinWar

DeclareJoinWar(regimeSlot: int, targetSlot: int)  ·  exe 346,47

Declares war with the 'join' flag set (minor joining a major).

Parameters

  • regimeSlot (int) — Regime slot
  • targetSlot (int) — Target regime slot

Example: exe(346,47,2,3)


AssetLoseLevel

AssetLoseLevel(zoneId: int, assetId: int, levels: int)  ·  exe 346,48

Reduces an asset's level by ID.

Parameters

  • zoneId (int) — Zone ID
  • assetId (int) — Asset ID
  • levels (int) — Levels

Example: exe(346,48,1,1,1)


ZoneToFreeFolk

ZoneToFreeFolk(zoneId: int)  ·  exe 346,49

Converts zone population/key into Free Folk and updates hex settlements.

Parameters

  • zoneId (int) — Zone ID

Example: exe(346,49,1)


ModifySkillLevel

ModifySkillLevel(charId: int, skillTypeId: int, points: int)  ·  exe 346,50

Modifies a character's skill level.

Parameters

  • charId (int) — Character ID
  • skillTypeId (int) — Skill Type ID
  • points (int) — Points (+/-, cap 99)

Example: exe(346,50,1,2,10)


StartTradeHubAuction

StartTradeHubAuction(arg1: int, arg2: int)  ·  exe 346,51

Starts a Market/Trade-Hub auction.

Parameters

  • arg1 (int) — Parameter 1
  • arg2 (int) — Parameter 2

Example: exe(346,51,1,1)


FoundTradeHub

FoundTradeHub(arg1: int, arg2: int)  ·  exe 346,52

Founds a Market/Trade Hub.

Parameters

  • arg1 (int) — Parameter 1
  • arg2 (int) — Parameter 2

Example: exe(346,52,1,1)


AddItemToZoneHq

AddItemToZoneHq(zoneId: int, itemTypeId: int, qty: int)  ·  exe 346,53

Adds an item to the zone's HQ unit (cf. AddItemToCity which targets the city loc).

Parameters

  • zoneId (int) — Zone ID
  • itemTypeId (int) — Item Type ID
  • qty (int) — Quantity (+/-)

Example: exe(346,53,1,7,100)


SplitTradeHub

SplitTradeHub(arg1: int, arg2: int)  ·  exe 346,54

Splits a Market/Trade Hub.

Parameters

  • arg1 (int) — Parameter 1
  • arg2 (int) — Parameter 2

Example: exe(346,54,1,1)


ResourceRumours

ResourceRumours(mode: int, a: int, b: int)  ·  exe 346,55

Triggers resource rumours (only acts when mode=1).

Parameters

  • mode (int) — Mode (must be 1)
  • a (int) — Param a
  • b (int) — Param b

Example: exe(346,55,1,1,1)


PlayPoliticsCard

PlayPoliticsCard(arg1: int, arg2: int)  ·  exe 346,57

Plays a Republica / politics card (requires politics enabled).

Parameters

  • arg1 (int) — Parameter 1
  • arg2 (int) — Parameter 2

Example: exe(346,57,1,1)


ChangeUnitHqMorale

ChangeUnitHqMorale(hisUnitId: int, points: int)  ·  exe 346,58

Modifies the HQ morale of a unit.

Parameters

  • hisUnitId (int) — Historical-unit ID
  • points (int) — Points (+/-)

Example: exe(346,58,1,10)


CompuUnplug

CompuUnplug()  ·  exe 346,59

Fires the Compu unplug event for the current regime.

Example: exe(346,59)


ChangeLoyaltyByFeat

ChangeLoyaltyByFeat(featId: int)  ·  exe 346,60

Modifies loyalty of all your characters who have the given feat.

Parameters

  • featId (int) — Character Feat ID

Example: exe(346,60,1)


OpenRelieveCommanderGui

OpenRelieveCommanderGui(choice: int)  ·  exe 346,61

Opens the 'relieve commander' UDS GUI.

Parameters

  • choice (int) — Choice

Example: exe(346,61,1)


RemoveTroopsFromCommand

RemoveTroopsFromCommand(hisUnitId: int, regimeId: int, count: int)  ·  exe 346,62

Removes troops from a unit and its HQ subordinates (power-sorted).

Parameters

  • hisUnitId (int) — Historical-unit ID (HQ)
  • regimeId (int) — Regime ID
  • count (int) — Individuals

Example: exe(346,62,1,4,10)


MassModifyRelations

MassModifyRelations(regimeId: int, relationPercent: int, aiHatredAdd: int)  ·  exe 346,63

Mass-modifies relations vs all regimes that have recon on the regime.

Parameters

  • regimeId (int) — Regime ID
  • relationPercent (int) — Relation x %
  • aiHatredAdd (int) — aiHatred add (AI only)

Example: exe(346,63,4,90,5)


ChangeZoneOrderStat

ChangeZoneOrderStat(zoneId: int, delta: int)  ·  exe 346,64

Modifies a zone-order stat (ZoneOrders col 2).

Parameters

  • zoneId (int) — Zone ID
  • delta (int) — Delta (+/-)

Example: exe(346,64,1,1)


AssignGovernor

AssignGovernor(leaderCharId: int, zoneId: int, oldGovPenalty: int)  ·  exe 346,65

Assigns a leader as governor of a zone, relieving the previous governor.

Parameters

  • leaderCharId (int) — Leader Character ID
  • zoneId (int) — Zone ID
  • oldGovPenalty (int) — Old-governor loyalty penalty %

Example: exe(346,65,1,1,0)


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