Console

You can use the **console** in Hegemony III by pressing the `F2` key. Here you can enter various console commands ("cheats").

## Command Format

There is a simple format for console commands, allowing you to pipe and nest commands.
An example:
`getselected():giveresource("wood", 1000)`
The above console command is a mix of 2 commands piped together. `getselected()` will tell the following command `giveresource()` which game element to target. Likewise you can nest commands such as `getselected(getplayerfaction())`. Not exactly sure what other command you would want to add to this, but its possible. It will then select the player faction for a followup command, such as "givegold()" (although there are easier ways to do that).

## List of Commands

For a full list of standard script functions, which can all also be called in the console, please see **HERE**.

## Common Commands

A selection of the most commonly used console commands is given below.

Tip: In order to repeat previous commands, you can press the up arrow on your keyboard to cycle through previous commands.

### Generic Commands

`screenshot()`

* screenshot() will create a screenshot with hidden UI (F12 will take a screenshot with visible UI)

`showgui()`

* showgui(false) will hide the GUI (you can now use F12 to take a screenshot with hidden UI).
* to reactivate the GUI hit F2 twice

`fog()`

* `fog(false)` will turn fog of war off, `fog(true)` will turn it back on

`debugmode()`

* `debugmode(true)` will turn debug mode on, which can be very useful when developing mods. It allows the player to see extra technical information, gives extra debug information in the console when certain scripts fire, and even allows the player to issue commands to AI units and buildings. `debugmode(false)` will turn it back off

`setgamespeed(#)`

* will set the game speed to #, where # is a number
* example usage: `setgamespeed(2)` will double the game speed

`commands("@@@")`

* will list all commands with the matching text (@@@)
* will list a lot of commands if used without a text search string (and could crash the game)
* example usage: `commands("key")` tells you every script command with "key" in its name

`getselected()`

* will tell the console to select the current target as the target for a following/piped command

`setattribute("@@@", #, operator)`

* will give the selected brigade/city/etc. an applicable attribute (@@@) of specified strength (#)
* operator will define if the operation is additive (op=add), multiplicative (op=mult) or if it is a true//false indicator e.g. as in "can build something" (op=boolean)
* a list of all available attributes can be found  here
* mind that not every attribute is applicable to every game object and attributes may require a specific type of operations
* in order to "delete" an attribute, simply set it to # = 0
* example usage: `getplayerfaction():setattribute("factionmorale",25, add)` adds 25 faction morale to the player's faction
* example usage: `getplayerfaction():setattribute("slavetrading",1, bool)` allows the player to build slave markets in his cities

### Faction Commands

`getplayerfaction()`

* will select the player faction as the target for a following/piped command

`setplayerfaction(getselected():getfaction())`

* will tag-switch the player to the faction of the seleted city/fort/etc.

`addgold(#)`

* will give # gold to selected target
* example usage: `getplayerfaction():addgold(9999)` gives the player 9999 gold

`giveskillpoints(#)`

* gives the player # technology skill points
* example usage: `getplayerfaction():giveskillpoints(10)` gives the player 10 technology skill points

`setfactionrelation(target faction, state)`

* defines the diplomatic state between factions, state may be "truce", "neutral", "atwar" or "alliance" (i.e. supply truce)
* example usage: getselected():getfaction():setfactionrelation(getplayerfaction(), "neutral") sets the selected faction to "neutral" towards the player

`sethostility(target faction, #)`

* defines the hostilty between factions with # between -100 (friendly) and +100 (hostile)
* example usage: getselected():getfaction():sethostility(getplayerfaction(), -100) sets the faction to "loyal" towards the player

### Object Commands

`capture()`

* flips selected object to player faction
* example usage: `getselected():capture()` captures the selected fort/city/bridge/resource/brigade

`giveupgrade("upgrade name", x)`

* gives a city or a resource building an upgrade, where x is the level of the upgrade
* a list of available upgrades can be found  here
* example usage: `getselected():giveupgrade("library", 2)`

`setfaction()`

* example usage: `getselected():setfaction(getplayerfaction())` sets a city's native faction to the player faction

`giveresource("@@@", ###)`

* this command will give resources to the selected target
* where @@@ = wood, supplies, recruits and ### = any number
* example usage: `getselected():giveresource("wood", 100)` gives selected object 100 wood
* example usage: `getselected():giveresource("supplies", 100)` gives selected object 100 food
* example usage: `getselected():giveresource("recruits", 100)` adds 100 recruits to the selected city

### City Commands

`setpop(number)`

* example usage: `getselected():setpop(5)` sets the pop level of the selected city to VI (yes, always number +1)

`incpop()`

* example usage: `getselected():incpop()` increases the pop level of the seleted city by 1

### Brigade Commands

`givexp(###)`

* will give XP to the selected target
* example usage: `getselected():givexp(3)` gives selected brigade 3 xp

`giveupgrade("@@@")`

* will give upgrade to selected target
* @@@ = medic#, hunter#, marksman#, etc. (where # = 1 to 5, remember that rank 5 gives a general so the max upgrade officer a unit can maintain is rank 4)
* a list of available unit upgrades can be found  here
* example usage: `getselected():giveupgrade("medic4")` gives selected brigade medic upgrade level 4

`addunits(#)`

* will add # of units to brigade if # is positive; this can exceed the brigade maximum
* will substarct # of units to brigade if # is negative
* example usage: `getselected():addunits(10)` adds 10 units to a brigade

`brigadehere("@@@")`

* will create brigade where cursor is pointed
* @@@ = romanlegionbrigade, slavebrigade, etc
* example usage: `brigadehere("romanlegionbrigade")` creates a legion brigade where the cursor is
* example usage: `brigadehere("slavebrigade")` creates a slave brigade where the cursor is

`rout()`

* example usage: `getselected():rout()` causes the selected brigade to rout

`surrender()`

* example usage: `getselected():surrender()` causes the selected brigade to surrender

`setfaction()`

* example usage: `getselected():setfaction(getplayerfaction())` sets a brigade's native faction to the player faction

## References for Brigadehere Command

List of Brigade Names for Use in Brigadehere Command by mupe3

### List of Roman Brigades

Example
`brigadehere("latinSpearmen")` - creates a Roman(Latin) spearmen brigade where the cursor is

Spearmen (frontline brigades)

* latinSpearmen
* latinLightHoplite
* latinHeavyHoplite
* latinTriarii

Sword units with ranged (first or second line brigades)

* latinHastati
* latinPrincipes

"missile" units (second or third line brigades)

* latinLeves
* latinVelites

"cavalry" (scout, quick respond or flanking brigades)

* latinEquites

"Fleet" (boats galore)

* romanwarshipbrigade
* heavyWarship (Eagle King Unit)
* flagship (Eagle King Unit)
* smallTransport (Eagle King Unit)
* largeTransport (Eagle King Unit)
* scoutShip (Eagle King Unit)

"Misc" (misc units)

* commonScouts
* commonCavalryScouts
* workerBrigade (workers)
* slavebrigade (slaves)
* colonistBrigade (colonists)
* latinHostages (hostages)
* commonBaggageTrain

### List of Greek Brigades

Example
`brigadehere("greekSpearmen")` - creates a greek spearmen brigade where the cursor is

Spearmen (frontline brigades)

* greekSpearmen
* greekLightHoplite
* greekHeavyHoplite
* greekPhalangites
* greekHypaspist
* macedonianPhalangites (Eagle King Unit)

"missile" units (second or third line brigades)

* greekPsiloi
* greekPeltasts
* rhodianSlingers (Eagle King Unit)
* cretanArchers (Eagle King Unit)

"cavalry" (scout, quick respond or flanking brigades)

* thessalianCavalry (Eagle King Unit)
* elephant (Eagle King Unit)
* greekMountedJavelineers

"Siege" (for taking cities)

* scorpionbrigade (catapult)

"Fleet" (boats galore)

* romanwarshipbrigade
* flagship (Eagle King Unit)
* smallTransport (Eagle King Unit)
* largeTransport (Eagle King Unit)
* scoutShip (Eagle King Unit)

"Misc" (misc units)

* commonScouts
* commonCavalryScouts
* workerBrigade (workers)
* slavebrigade (slaves)
* colonistBrigade (colonists)
* greekHostages (hostages)
* commonBaggageTrain

### List of Etruscan brigades

Example
`brigadehere("etruscanSpearmen")` - creates a Etruscan spearmen brigade where the cursor is

Spearmen (frontline brigades)

* etruscanSpearmen
* etruscanAxemen
* etruscanLightHoplite
* etruscanHeavyHoplite
* etruscanLightSwordsmen
* etruscanHeavySwordsmen

"missile" units (second or third line brigades)

* etruscanArchers

"cavalry" (scout, quick respond or flanking brigades)

* etruscanLightCavalry
* etruscanHeavyCavalry

"Fleet" (boats galore)

* romanwarshipbrigade
* heavyWarship (Eagle King Unit)
* flagship (Eagle King Unit)
* smallTransport (Eagle King Unit)
* largeTransport (Eagle King Unit)
* scoutShip (Eagle King Unit)

"Misc" (misc units)

* commonScouts
* commonCavalryScouts
* workerBrigade (workers)
* slavebrigade (slaves)
* colonistBrigade (colonists)
* etruscanHostages (hostages)
* commonBaggageTrain

### List of Illyric brigades

Example
`brigadehere("illyricSpearmen")` - creates a illyric spearmen brigade where the cursor is

Spearmen (frontline brigades)

* illyricSpearmen
* illyricLightHoplite
* illyricHeavyHoplite
* illyricSkirmishers
* illyricLightSwordsmen
* illyricHeavySwordsmen

"missile" units (second or third line brigades)

* illyricPeltasts
* illyricSlingers

"cavalry" (scout, quick respond or flanking brigades)

* illyricMountedJavelineers

"Fleet" (boats galore)

* nonromanwarshipbrigade
* raidingShip
* heavyWarship (Eagle King Unit)
* smallTransport (Eagle King Unit)
* largeTransport (Eagle King Unit)
* scoutShip (Eagle King Unit)

"Misc" (misc units)

* commonScouts
* commonCavalryScouts
* workerBrigade (workers)
* slavebrigade (slaves)
* colonistBrigade (colonists)
* illyricHostages (hostages)
* commonBaggageTrain

### List of Sabellic brigades

Example
`brigadehere("sabellicSpearmen")` - creates a Sabellic spearmen brigade where the cursor is

Spearmen (frontline brigades)

* sabellicSpearmen
* sabellicLightHoplite
* sabellicHeavyHoplite
* sabellicLightSwordsmen
* sabellicHeavySwordsmen

"missile" units (second or third line brigades)

* sabellicVelites
* sabellicJavelineers

"cavalry" (scout, quick respond or flanking brigades)

* sabellicNobleCavalry

"Fleet" (boats galore)

* romanwarshipbrigade
* heavyWarship (Eagle King Unit)
* flagship (Eagle King Unit)
* smallTransport (Eagle King Unit)
* largeTransport (Eagle King Unit)
* scoutShip (Eagle King Unit)

"Misc" (misc units)

* commonScouts
* commonCavalryScouts
* workerBrigade (workers)
* slavebrigade (slaves)
* colonistBrigade (colonists)
* sabellicHostages (hostages)
* commonBaggageTrain

### List of Gallic Brigades

Example
`brigadehere("gallicSpearmen")` - creates a Gallic spearmen brigade where the cursor is

Spearmen (frontline brigades)

* gallicSpearmen
* gallicLightSwordsmen
* gallicNakedSwordsmen
* gallicNobleSwordsmen

"missile" units (second or third line brigades)

* gallicJavelineers
* gallicSlingers
* gallicArchers

"cavalry" (scout, quick respond or flanking brigades)

* gallicLightCavalry
* gallicNobleCavalry

"Fleet" (boats galore)

* nonromanwarshipbrigade
* raidingShip
* heavyWarshipGallic (Eagle King Unit)
* smallTransport (Eagle King Unit)
* largeTransport (Eagle King Unit)
* scoutShip (Eagle King Unit)

"Misc" (misc units)

* commonScouts
* commonCavalryScouts
* workerBrigade (workers)
* slavebrigade (slaves)
* colonistBrigade (colonists)
* gallicHostages (hostages)
* commonBaggageTrain

### List of Sicilian Brigades

(The Eagle King DLC)
Example
`brigadehere("sabellicSpearmen")` - creates a Sicilian Spearmen brigade where the cursor is

Spearmen (frontline brigades)

* sabellicSpearmen
* greekLightHoplite
* greekHeavyHoplite
* sabellicLightSwordsmen
* sabellicHeavySwordsmen

"missile" units (second or third line brigades)

* sabellicVelites
* sabellicJavelineers

"cavalry" (scout, quick respond or flanking brigades)

* greekMountedJavelineers

"Fleet" (boats galore)

* romanwarshipbrigade
* heavyWarship (Eagle King Unit)
* flagship (Eagle King Unit)
* smallTransport (Eagle King Unit)
* largeTransport (Eagle King Unit)
* scoutShip (Eagle King Unit)

"Misc" (misc units)

* commonScouts
* commonCavalryScouts
* workerBrigade (workers)
* slavebrigade (slaves)
* colonistBrigade (colonists)
* greekHostages (hostages)
* commonBaggageTrain

### List of Raider Brigades

Example
`brigadehere("raiderHoplites")` - creates a raider Hoplite brigade where the cursor is

Spearmen (frontline brigades)

* raiderHoplites

Sword units with ranged (first or second line brigades)

* raiderSkirmishers

"missile" units (second or third line brigades)

* raiderJavelineers
* raiderSlingers
* raiderArchers

"cavalry" (scout, quick respond or flanking brigades)

* raiderLightCavalry

"Fleet" (boats galore)

* nonromanwarshipbrigade
* heavyWarship (Eagle King Unit)
* heavyWarshipGallic (Eagle King Unit)
* smallTransport (Eagle King Unit)
* largeTransport (Eagle King Unit)
* scoutShip (Eagle King Unit)