Actions

Difference between revisions of "ESOC UHC Plugin"

From The ESOC wiki for Age of Empires 3

m (updated for final 5.1.1.0 release)
m (update latest release date)
Line 3: Line 3:
 
| environment = ESOC Patch
 
| environment = ESOC Patch
 
| latest_release_date = November 28, 2018
 
| latest_release_date = November 28, 2018
| initial_release_date = May 28, 2018
+
| initial_release_date = December 18, 2018
 
| status = Actively maintained
 
| status = Actively maintained
 
| developer = Eaglemut
 
| developer = Eaglemut

Revision as of 00:00, 18 December 2018

ESOC UHC Plugin

Mod type
Game Enhancement
Part of
ESOC Patch
Initial release
December 18, 2018
Stable release
November 28, 2018
Status
Actively maintained
Developed by
Eaglemut
musketeer925

Contents



ESOC UHC Plugin is a game plugin developed primarily for ESOC Patch, though it can be utilized by any game version through the UHC Plugin System. Features include new cheat codes and an expanded number of helpful syscalls for Random Map Scripting or User Interface development. The plugin is distributed together with ESOC Patch since version 5.0.0.0.


List of available syscalls

The syscall replacement as defined in this specification makes it possible to develop cross-compatible maps that work to a certain extent even on environments without ESOC UHC Plugin included. Syscall replacement for ESOC Compatible Map Pack currently works in a rudimentary way by detecting first closing bracket as the end of function call. It is therefore not allowed to use the closing bracket for any other purpose inside a function's parameter list, such as calling another function.

Example of implementing a compatible fallback in a Random Map Script, based on the syscall replacement specification:

string forestType = "z87 Australian Woodland"; // special forest only available on EP
if (rmIsEnvironmentESOC() == false)
{
	forestType = "great plains forest";
}

Included from version 5.0.0.0

int kbUnitGetTactic(int unitID)

Originally aiUnitGetTactic, exported to KB context for use outside AI scripts. Gets the specified unit's current tactic.
In ESOC Compatible Map Pack, usage of this function is replaced by: -1

int rmGetGameMode()

Originally aiGetGameMode, exported to RM context for use outside AI scripts. Returns the current game mode.
Possible return values: cGameModeSupremacy, cGameModeDeathmatch, cGameModeConquest (probably irrelevant), cGameModeLightning (probably irrelevant)
In ESOC Compatible Map Pack, usage of this function is replaced by: -1

int rmGetWorldDifficulty()

Originally aiGetWorldDifficulty, exported to RM context for use outside AI scripts. Returns the current difficulty level.
Possible return values: cDifficultySandbox, cDifficultyEasy, cDifficultyModerate, cDifficultyHard, cDifficultyExpert
In ESOC Compatible Map Pack, usage of this function is replaced by: -1 on regular maps, 0 on Observer UI maps (equal to cDifficultySandbox)

bool rmIsEnvironmentESOC()

Simply returns true to indicate script is run in the ESOC UHC Plugin environment. Useful to define conditional logic dependent on the ESOC environment and unavailable in other environments (RE/WoL/NE..).
In ESOC Compatible Map Pack, usage of this function is replaced by: false
Aliases in other contexts: kbIsEnvironmentESOC

Included from version 5.1.0.0

bool trUnitSetTactic(int unitID, int tacticID)

Originally aiUnitSetTactic, exported to TR context for use outside AI scripts. Sets specified tactic on the specified unit.
In ESOC Compatible Map Pack, usage of this function is replaced by: -1

void trRepairUnit(int unitID)

Originally repairUnit, exported for use outside UI commands. Repairs the specified unit.
In ESOC Compatible Map Pack, any usage of this function is removed.
Aliases in other contexts: aiRepairUnit

int kbGetScore(int playerID)

Originally aiGetScore, exported to KB context for use outside AI scripts. Gets the specified player's current score.
In ESOC Compatible Map Pack, usage of this function is replaced by: -1

string kbGetTacticName(int tacticID)

Gets tactic name by ID.
In ESOC Compatible Map Pack, usage of this function is replaced by string: EUPL_UNKNOWN_VALUE

int kbGetTacticIDByName(string tacticName)

Gets tactic ID by name.
In ESOC Compatible Map Pack, usage of this function is replaced by: -1

int kbGetTechIDByName(string techName)

Gets tech ID by name.
In ESOC Compatible Map Pack, usage of this function is replaced by: -1

int kbGetUnitTypeIDByName(string unitTypeName)

Gets unit type ID by name.
In ESOC Compatible Map Pack, usage of this function is replaced by: -1

int kbGetCivIDByName(string civName)

Gets civilization ID by name.
In ESOC Compatible Map Pack, usage of this function is replaced by: -1

bool kbIsMultiplayer()

Originally aiIsMultiplayer, exported for use outside AI scripts. Returns true if currently in multiplayer, false otherwise.
In ESOC Compatible Map Pack, usage of this function is replaced by: false
Aliases in other contexts: rmIsMultiplayer

Persistent Storage API

The persistent storage syscalls are designed to allow implementing session-like logic. Values stored using these syscalls will persist throughout a game session until the game client is fully closed by user, this makes it easy to implement behavior affected by results of a previous match.

bool kbPersistentStorageIntIsSet(string key)

Returns true if given key exists in the persistent array of integers.
In ESOC Compatible Map Pack, usage of this function is replaced by: false
Aliases in other contexts: rmPersistentStorageIntIsSet

int kbPersistentStorageIntGet(string key)

Returns value for the specified key in the persistent array of integers, or -1 if no value is set for the key.
In ESOC Compatible Map Pack, usage of this function is replaced by: -1
Aliases in other contexts: rmPersistentStorageIntGet

void kbPersistentStorageIntSet(string key, int value)

Sets value for the specified key in the persistent array of integers.
In ESOC Compatible Map Pack, any usage of this function is removed.
Aliases in other contexts: rmPersistentStorageIntSet, uiPersistentStorageIntSet

bool kbPersistentStorageFloatIsSet(string key)

Returns true if given key exists in the persistent array of floats.
In ESOC Compatible Map Pack, usage of this function is replaced by: false
Aliases in other contexts: rmPersistentStorageFloatIsSet

float kbPersistentStorageFloatGet(string key)

Returns value for the specified key in the persistent array of floats, or -1 if no value is set for the key.
In ESOC Compatible Map Pack, usage of this function is replaced by: -1
Aliases in other contexts: rmPersistentStorageFloatGet

void kbPersistentStorageFloatSet(string key, float value)

Sets value for the specified key in the persistent array of floats.
In ESOC Compatible Map Pack, any usage of this function is removed.
Aliases in other contexts: rmPersistentStorageFloatSet, uiPersistentStorageFloatSet

bool kbPersistentStorageStringIsSet(string key)

Returns true if given key exists in the persistent array of strings.
In ESOC Compatible Map Pack, usage of this function is replaced by: false
Aliases in other contexts: rmPersistentStorageStringIsSet

string kbPersistentStorageStringGet(string key)

Returns value for the specified key in the persistent array of strings, or an empty string if no value is set for the key.
In ESOC Compatible Map Pack, usage of this function is replaced by string: EUPL_UNKNOWN_VALUE
Aliases in other contexts: rmPersistentStorageStringGet, uiPersistentStorageStringGet

void kbPersistentStorageStringSet(string key, string value)

Sets value for the specified key in the persistent array of strings.
In ESOC Compatible Map Pack, any usage of this function is removed.
Aliases in other contexts: rmPersistentStorageStringSet, uiPersistentStorageStringSet

bool kbPersistentStorageBoolIsSet(string key)

Returns true if given key exists in the persistent array of booleans.
In ESOC Compatible Map Pack, usage of this function is replaced by: false
Aliases in other contexts: rmPersistentStorageBoolIsSet

bool kbPersistentStorageBoolGet(string key)

Returns value for the specified key in the persistent array of booleans, or false if no value is set for the key.
In ESOC Compatible Map Pack, usage of this function is replaced by: false
Aliases in other contexts: rmPersistentStorageBoolGet

void kbPersistentStorageBoolSet(string key, bool value)

Sets value for the specified key in the persistent array of booleans.
In ESOC Compatible Map Pack, any usage of this function is removed.
Aliases in other contexts: rmPersistentStorageBoolSet, uiPersistentStorageBoolSet

bool kbPersistentStorageVectorIsSet(string key)

Returns true if given key exists in the persistent array of vectors.
In ESOC Compatible Map Pack, usage of this function is replaced by: false
Aliases in other contexts: rmPersistentStorageVectorIsSet

vector kbPersistentStorageVectorGet(string key)

Returns value for the specified key in the persistent array of vectors, or cInvalidVector if no value is set for the key.
In ESOC Compatible Map Pack, usage of this function is replaced by: cInvalidVector
Aliases in other contexts: rmPersistentStorageVectorGet

void kbPersistentStorageVectorSet(string key, vector value)

Sets value for the specified key in the persistent array of vectors.
In ESOC Compatible Map Pack, any usage of this function is removed.
Aliases in other contexts: rmPersistentStorageVectorSet, uiPersistentStorageVectorSet

Included from version 5.1.1.0

The "time" collection of helper functions is designed to make functionalities dependent on real date/time possible.

int kbTimeGetCurrentCalendarYear(bool gmt)

Returns current calendar year in either gmt or local time.
In ESOC Compatible Map Pack, usage of this function is replaced by: -1
Aliases in other contexts: rmTimeGetCurrentCalendarYear

int kbTimeGetCurrentCalendarMonth(bool gmt)

Returns current calendar month in either gmt or local time (1-12).
In ESOC Compatible Map Pack, usage of this function is replaced by: -1
Aliases in other contexts: rmTimeGetCurrentCalendarMonth

int kbTimeGetCurrentCalendarDay(bool gmt)

Returns current calendar day in either gmt or local time (1-31).
In ESOC Compatible Map Pack, usage of this function is replaced by: -1
Aliases in other contexts: rmTimeGetCurrentCalendarDay

int kbTimeGetCurrentHour(bool gmt)

Returns current hour of the current day in either gmt or local time (0-23).
In ESOC Compatible Map Pack, usage of this function is replaced by: -1
Aliases in other contexts: rmTimeGetCurrentHour

int kbTimeGetCurrentMinute(bool gmt)

Returns current minute of the current hour in either gmt or local time (0-59).
In ESOC Compatible Map Pack, usage of this function is replaced by: -1
Aliases in other contexts: rmTimeGetCurrentMinute

string kbTimeGetCurrentFormatted(bool gmt, string format)

Returns current date/time as a string in either gmt or local time, formatted per the format argument. See the documention of put_time for all available formats: https://en.cppreference.com/w/cpp/io/manip/put_time
In ESOC Compatible Map Pack, usage of this function is replaced by string: EUPL_UNKNOWN_VALUE
Aliases in other contexts: rmTimeGetCurrentFormatted

List of available cheat codes

Included from version 5.0.0.0

cowhax

this is a complication

kill 'em all

fear the elifents

it's raining men

dev

  • Invokes "it's raining men" + "this is a complication". Grants ten thousand of each resource, turns off fog & blackmap, increases research rate times 100.
  • Since 5.1.0.0: Also grants 50 population space.

devx

  • Can only be used in singleplayer. Invokes "dev", grants x100 handicap and x100 train rate.

devr

  • Reset research/train rates to normal, reset handicap to none, reactivate fog & blackmap.


External links