Skip to content

Latest commit

 

History

History
334 lines (327 loc) · 53.5 KB

kp.Actions.new.md

File metadata and controls

334 lines (327 loc) · 53.5 KB

Actions

Actions are written in a form Actions.ACTION_NAME(ACTION_PARAMETERS); like so:

    if States.StatArmyCount(0) <= 3 then
      Actions.PlayerDefeat(0); // Defeat 1st player

Most of action parameters are numeric (except houses, units and some others when mentioned).

Version column description:
"-" Means this action was added from the start.
"5678" Means this action was introduced in revision 5678.
"-5678" Means this action was removed in revision 5678.



Ver
sion
Action description Parameters
and types
Returns
8250 CampaignChapterSetup
Sets up campaign chapter info in campaign menu. Campaign-only action!
aChapter: Integer; // chapter index to set up
aTitle: string; // text to display for the chapter title
aShortTitle: string; // text to display for the chapter short title
aBackgroundImg: string; // sprite to be used for the chapter background map (*.png)
8794 CampaignMissionResult
Sets up mission result in campaign menu. Campaign-only action!
aMission: Integer; // mission index to set up
aResult: string; // text to display for the mission result
8250 CampaignMissionSetup
Sets up all of the campaign mission info in campaign menu. Campaign-only action!
aMission: Integer; // mission index to set up
aUnlocked: Boolean; // Should it be available for selection and play
aWon: Boolean; // should it be marked as won
aFlagImgLocked: string; // sprite to be used for the locked state flag (*.png)
aFlagImgNormal: string; // sprite to be used for the normal state flag (*.png)
aFlagImgWon: string; // sprite to be used for the won state flag (*.png)
aFlagPosX: Integer; // flag X position on the campaign map
aFlagPosY: Integer; // flag Y position on the campaign map
aTitle: string; // text to display for the mission title
aBriefing: string; // text to display for the mission briefing
8261 CampaignMissionUnlock
Sets up unlocked status of a campaign mission in a campaign menu. Campaign-only action!
aMission: Integer; // mission index to unlock
aUnlocked: Boolean; // Should it be available for selection and play
8722 CampaignMissionWon
Sets up won status of a campaign mission in a campaign menu. Campaign-only action!
aMission: Integer; // mission index to set up
aWon: Boolean; // Won status
8261 CampaignProgress
Sets up progress campaign info in campaign selection menu. Campaign-only action!
aProgress: string; // campaign progress displayed in the campaign selection menu
11581 CampaignSelect
Sets up which mission will be selected in campaign selection menu. Campaign-only action!
aMissionNext: Integer; // which mission will be selected by default to be played next
11581 CampaignSetup
Sets up generic campaign info in campaign selection menu. Campaign-only action!
aProgress: string; // campaign progress displayed in the campaign selection menu
aNodeImg: string; // sprite to be used for the nodes between mission flags (*.png)
8155 CinematicBarsHide
Hides cinematic black bars around the screen
8155 CinematicBarsShow
Shows cinematic black bars around the screen
8155 CinematicBegin
Starts cinematic mode. Blocks all viewport controls
8155 CinematicEnd
Ends cinematic mode. Unblocks viewport controls
8155 CinematicFadeIn
Gradually reveals the screen from full black
aDurationSec: Single; // effect duration in seconds
8155 CinematicFadeOut
Gradually darkens the screen to full black
aDurationSec: Single; // effect duration in seconds
8585 CinematicSpeechBubble
Shows speech bubble at specified location and height over terrain
aX, aY: Single;
aHeight: Single;
aScale: Byte;
aText: string;
aDurationSec: Single;
12776 CinematicSpeechBubbleUnit
Shows speech bubble for specified unit
aUnitID: Integer;
aScale: Byte;
aText: string;
aDurationSec: Single; // for how many game seconds to show this bubble
8155 CinematicSubtitle
Shows the subtitles
aText: string;
12776 CinematicTalkingHead
Shows an avatar with a message
aImage: string; // image names (need to be .png)
aText: string; // message text
aSound: string; // sound to play
12947 CinematicTalkingHeadWithButtons
Shows an avatar with a message
aImage: string; // image names (need to be .png)
aText: string; // message text
aSound: string; // sound to play
aButtons: array of string;
aTags: array of Integer;
8155 CinematicText
Shows the text in the middle of the screen
aText: string;
aScale: Byte; // Text scale 1..16
8155 CinematicViewMoveTo
Moves the camera
aX, aY: Single;
aHeading: Single;
aZoom: Single;
aDurationSec: Single; // move duration in seconds
8155 CinematicViewMoveToEx
Moves the camera with more control over the setup
aX, aY: Single;
aHeading: Single;
aPitch: Single;
aDist: Single;
aFOV: Single;
aDurationSec: Single; // move duration in seconds
8155 CinematicViewReset
Resets the camera to default orientation and zoom
8155 CinematicViewRevert
Restores player viewport setup (position, orientation, zoom)
8155 CinematicViewSetTo
Sets the camera
aX, aY: Single;
aHeading: Single;
aZoom: Single;
8166 CinematicViewSetToDefault
Sets the camera X and Y. Heading and zoom are set to default
aX, aY: Single;
8155 CinematicViewSetToEx
Sets the camera with more control over the setup
aX, aY: Single;
aHeading: Single;
aPitch: Single;
aDist: Single;
aFOV: Single;
8155 CinematicViewStore
Saves player viewport setup (position, orientation, zoom)
8461 FenceAdd
Set a fence on terrain
X,Y: Tile where the fence should be set
X, Y: Word;
aDir: Word; // Side of the tile (only N, E, S and W are allowed)
aFenceType: TKMFenceType; // Type of the fence
aPlayer: Integer; // Owner of the fence
Boolean // Success or fail
8461 FenceRemove
Remove fence from terrain
X,Y: Tile from which the fence should be removed
X, Y: Word;
aDir: Word; // Side of the tile (only N, E, S and W are allowed)
- FogCoverAll
Cover whole map with fog of war for specified player
aPlayer: Integer;
- FogCoverCircle
Cover circle with fog of war to fully dark
Circle will have a GPU assist for 10 ticks fading out in 30 ticks after that
Note that covering inside active area (e.g. town) will not work and/or flicker as the fow gets immediately re-reveled by houses/units
aPlayer: Integer;
X, Y: Word;
aRadius: Word;
- FogCoverRect
Cover rectangle with fog of war to fully dark
Note that covering inside active area (e.g. town) will not work and/or flicker as the fow gets immediately re-reveled by houses/units
aPlayer: Integer;
X1: Word;
Y1: Word;
X2: Word;
Y2: Word;
- FogRevealAll
Reveal whole map
aPlayer: Integer;
- FogRevealCircle
Reveals a circle in fog of war
Circle will have a GPU assist for 10 ticks fading out in 30 ticks after that
aPlayer: Integer;
X, Y: Word;
aRadius: Word;
- FogRevealRect
Reveal rectangle
aPlayer: Integer;
X1: Word;
Y1: Word;
X2: Word;
Y2: Word;
- GiveGroup
Gives warriors group to a player
aPlayer: Integer;
aUnitType: TKMUnitType;
X, Y: Word;
aDir: Word;
aCount: Word;
aColumns: Word;
Integer // UID of the group on success
4433 GiveHouse
Places house on terrain, removing removable objects below it (trees and such)
If there are units below - placement fails
aPlayer: Integer;
aHouseType: TKMHouseType;
X, Y: Word;
aFace: TKMHouseFace;
Integer // UID of the house on success
- GiveUnit
Gives unit to a player
Should be a citizen unit. For warriors - use GiveGroup
aPlayer: Integer;
aUnitType: TKMUnitType;
X, Y: Word;
aDir: Word;
Integer // UID of the unit on success
- GiveWares
Try to give wares to the player. Wares will be added to the first suitable house
aPlayer: Integer;
aWareType: TKMWareType;
aCount: Word;
-12605 GiveWeapons
Removed
Method was removed, use GiveWares instead
aPlayer: Integer;
aWareType: TKMWareType;
aCount: Word;
r14230 GroupBannerDisplay
Hides or shows groups banner for the specified group
aGroupID: Integer;
aShow: Boolean;
- GroupOrderAttackHouse aGroupID: Integer;
aHouseID: Integer;
- GroupOrderAttackUnit aGroupID: Integer;
aUnitID: Integer;
- GroupOrderFood aGroupID: Integer;
- GroupOrderHalt aGroupID: Integer;
- GroupOrderLink
Order the group to link to another group (if possible)
aGroupID: Integer;
aDestGroupID: Integer;
- GroupOrderSplit aGroupID: Integer; Integer // UID of the separated group
- GroupOrderStorm aGroupID: Integer;
- GroupOrderWalk aGroupID: Integer;
aX, aY: Word;
aDirection: Word;
6982 GroupOwnerChange
Change owner of the group. Technically it kills old units and creates new ones with the same basic properties
(type, position, direction, hp, condition). All the advanced props and states do not get copied over.
If old group was moving/fighting, it is not guaranteed that new group units will be placed on the same positions
aGroupID: Integer;
aPlayer: Integer;
Integer // UID of new group
- GroupSetFormation aGroupID: Integer;
aNumColumns: Byte;
- HouseAddDamage aHouseID: Integer;
aDamage: Word; // number of hitpoints to take from the house
- HouseAddRepair aHouseID: Integer;
aRepair: Word; // number of hitpoints to give to the house
-7981 HouseAddWaresTo
Removed
Method was removed, use HouseWareAdd instead
aHouseID: Integer;
aWareType: TKMWareType;
aCount: Word;
-10696 HouseAllow
Removed
Method was removed, use PlayerHouseBlock instead
Allow or block the house from being built
aPlayer: Integer;
aHouseType: TKMHouseType;
aAllowed: Boolean;
- HouseDestroy aHouseID: Integer;
aSilent: Boolean; // Wherever to play the sound and leave rubble on terrain or not
5194 HouseOwnerChange
Change owner of the House. Technically it destroys old House and creates a new one with the same basic props
(type, position, direction, hp, ..). All the advanced props and states do not get copied over.
Wares do not get copied over yet.
aHouseID: Integer;
aPlayer: Integer;
Integer // UID of new House
- HouseRepairEnable aHouseID: Integer;
aRepairEnabled: Boolean;
4820 HouseTrainQueueAdd
Train units in the house (School/Fort/Barracks)
aHouseID: Integer;
aUnitType: TKMUnitType;
aCount: Integer;
Integer // number of units added to the queue
4820 HouseTrainQueueRemove
Try to remove units from training queue in the house (School/Fort/Barracks)
aHouseID: Integer;
aQueueIndex: Integer; // Should be in 0..5 range
-10696 HouseUnlock
Removed
Method was removed, use PlayerHouseGrant instead
Allow the house to be built irregardless of preceeding houses availability
aPlayer: Integer;
aHouseType: TKMHouseType;
7981 HouseWareAdd
Adds wares to specified house
aHouseID: Integer;
aWareType: TKMWareType;
aCount: Word; // number of wares to add. Gets trimmed to not exceed house max storage
7021 HouseWareInBlock
Set spacious house ware delivery policy. Works only for spacious houses (Camp, Fort, Store, Barracks)
aHouseID: Integer;
aWareType: TKMWareType;
aBlock: Integer; // 0 - allow, 1 - block, 2 - evacuate
7985 HouseWareRemove
Removes wares from specified house. Works only on complete houses
aHouseID: Integer;
aWareType: TKMWareType;
aCount: Word; // number of wares to take
Word // number of wares that were actually taken
10399 HouseWaresInBlock
Set common house ware delivery policy. Works only for common houses
aHouseID: Integer;
aBlock: Integer; // 0 - allow, 1 - block
- HouseWeaponsOrderSet aHouseID: Integer;
aWareType: TKMWareType;
aAmount: Integer;
8900 HouseWoodcutterMode
Modes are: 0 - cut and plant, 1 - chop only, 2 - plant only
aHouseID: Integer;
aChopMode: Byte;
12950 InteractionMarkerAdd
Adds interaction marker
aMarkerType: TKMInteractionType; // type of the marker
aX, aY: Single;
Integer // unique ID of the created marker
12950 InteractionMarkerAddOnUnit
Adds interaction marker on to a unit
aMarkerType: TKMInteractionType; // type of the marker
aUnitID: Integer; // UID of the unit
Integer // unique ID of the created marker
13777 InteractionMarkerBob
Updates interaction marker property
aMarkerID: Integer;
aBob: Boolean; // enable or disable bobbing of the marker
12950 InteractionMarkerRemove
Removes interaction marker
aMarkerID: Integer; // identifier of the marker
12950 InteractionMarkerUpdate
Updates interaction marker properties
aMarkerID: Integer; // identifier of the marker
aColor: Integer; // new RGB color of the marker. Pass -1 to reset to default
aGlow: Boolean; // enable or disable glow around the marker
aHeight: Single; // new height of the marker (must be within range 0 .. 2.0). Pass -1 to reset to default
8775 MissionHighscore
Sets the mission score
Score can be set only for single-player Campaign and Story missions that have Highscores enabled in MapEd.
Timed missions can have highscores too, but the score there is supplementary.
Good highscore mission are:
- Single-Player, so other players can not affect the outcome
- Story, so player can not choose weaker or stronger AI opponents
- If it is in a campaign - not affected by previous campaign missions
- Have no random or dynamic difficulty or difficulty/bonuses choice via script
Thus, only mapmaker can tell if mission should be scored or not, and it can be done by calling this action
aScore: Integer; // number between -1 and 99999. -1 will keep highscore calculation to the default game formula
- PlanAddField aPlayer: Integer;
X, Y: Word;
Boolean // success or fail
4433 PlanAddHouse
Places house plan on terrain, removing removable objects below it (trees and such)
aPlayer: Integer;
aHouseType: TKMHouseType;
X, Y: Word;
aFace: TKMHouseFace;
Boolean // success or fail
- PlanAddOrchard aPlayer: Integer;
X, Y: Word;
Boolean // success or fail
- PlanAddRoad aPlayer: Integer;
X, Y: Word;
Boolean // success or fail
- PlanRemove
Removes any house or fieldwork plan
aPlayer: Integer;
X, Y: Word;
Boolean // success or fail
5374 PlayerAIArmyCompositionReset
Reset the rate at which AI should equip new warriors to 0
aPlayer: Integer;
5374 PlayerAIArmyCompositionSet
Change the rate at which AI should equip new warriors (units per hour)
aPlayer: Integer;
aUnitType: TKMUnitType;
aWarriorsPerHour: Word;
5735 PlayerAIDispositionAdd
Changed
Method was changed
aPlayer: Integer;
X, Y: Word;
aDir: Word;
aGroupType: TKMGroupType;
aGuardRadius: Word;
aNumUnits: Word;
aUnitsPerRow: Word;
Boolean
15205 PlayerAIDispositionAdd
Add disposition for players AI
aPlayer: Integer;
X, Y: Word;
aDir: Word;
aGroupType: TKMGroupType;
aNumUnits: Word;
aUnitsPerRow: Word;
aGuardRadius: Word;
Boolean // Success or fail (due to bad parameters or already existing position)
5735 PlayerAIDispositionRemove
Remove disposition
aPlayer: Integer;
aX, aY: Word;
Boolean // Success or fail
15082 PlayerAIDispositionUIDAdd
Changed
Method was changed
aPlayer: Integer;
X, Y: Word;
aDir: Word;
aGroupType: TKMGroupType;
aGuardRadius: Word;
aNumUnits: Word;
aUnitsPerRow: Word;
Integer
15205 PlayerAIDispositionUIDAdd
Add disposition for players AI
aPlayer: Integer;
X, Y: Word;
aDir: Word;
aGroupType: TKMGroupType;
aNumUnits: Word;
aUnitsPerRow: Word;
aGuardRadius: Word;
Integer // Returns disposition UID in case of success or 0 on fail (due to bad parameters or already existing position)
15082 PlayerAIDispositionUIDRemove
Remove disposition
aPlayer: Integer;
aDispositionUID: Integer;
Boolean // Success or fail
4053 PlayerAllianceChange
Change alliance between players. Always symmetrical
aPlayer1: Integer;
aPlayer2: Integer;
aAllied: Boolean; // Ally or enemy
aShareFOW: Boolean; // Start sharing FOW between players
5422 PlayerColorChange
Change players color. Note that animals have their own colors on the minimap
aPlayer: Integer; // Player index (0..N-1)
aColor: Integer; // New color
- PlayerDefeat
Set player defeated
aPlayer: Integer;
- PlayerGoalsSetDefault
Add default multiplayer goals for a player - to kill all enemies.
aPlayer: Integer; // Player index (0..N-1)
aBuildings: Boolean; // destroy core houses too
10696 PlayerHouseBlock
Block the house from being built irregardless of preceeding houses availability
If house is both granted and blocked - it will be blocked
aPlayer: Integer;
aHouseType: TKMHouseType;
aBlock: Boolean;
10696 PlayerHouseGrant
Allow the house to be built irregardless of preceeding houses availability
If house is both granted and blocked - it will be blocked
aPlayer: Integer;
aHouseType: TKMHouseType;
aGrant: Boolean;
8180 PlayerMessage
Send a message to the player. Message gets stored in message log
aPlayer: Integer; // can be -1 to send the message to all the players
aText: string; // text with libx codes to substitute
aOpen: Boolean; // should the message be opened to the player at once
-8131 PlayerMessageFormatted
Removed
Method was removed, Formatted messages can be made with Utils.Format()
aPlayer: Integer;
aText: string;
Params: array of const;
-8180 PlayerMessageGoto
Removed
Method was removed, Goto messages should be done with Actions.PlayerMessageWithButtons
aPlayer: Integer;
aX, aY: Word;
aText: string;
-8131 PlayerMessageGotoFormatted
Removed
Method was removed, Formatted messages can be made with Utils.Format()
aPlayer: Integer;
aX, aY: Word;
aText: string;
Params: array of const;
-8180 PlayerMessageOpen
Removed
Method was removed, Adjoined with PlayerMessage with a boolean key
aPlayer: Integer;
aText: string;
9746 PlayerMessageWithButtons
Send a message to the player with options (buttons) player can choose from
Message result will return asynchronously in the OnScriptButton event from each player (possibly even in different tick).
In multiplayer games, event might be several ticks later due to lag.
When you need to show several modal messages - spread them over different ticks, to avoid piling up.
In rare cases, when player cheats, he can miss the message altogether (e.g. by viewing different Hand during message invocation).
AI players can receive modal messages, but can not react to them in meaningful manner. The messages will be just ignored and written in to log as warnings
aPlayer: Integer;
aText: string; // Message text
aButtons: array of string; // Array of button captions. Can be up to 8
aImages: array of string; // Array of button image names (need to be .png)
aTags: array of Integer; // Array of button tags (need to be > 0. Will be passed back in click event)
aOpen: Boolean; // Opens the message and sets the game on pause after current tick is done
aBlockAfterClick: Boolean; // Block buttons after a click
aModal: Boolean; // Block "close" and "prev/next" buttons, forcing player to choose one of the message options
8742 PlayerMissionResultString
Sets a message shown to the player on mission result.
Typically used in campaign and story missions.
Can be set at any moment and is shown for any mission outcome.
Available size is around 18 by 8 characters.
aPlayer: Integer;
aText: string;
5027 PlayerNameSet
Rename a player (works only in Singleplayer and for AIs in Multiplayer)
Note: renaming a player updates texts for all affected objectives created from goals
aPlayer: Integer;
aName: string;
3026 PlayerObjectiveAdd
Add objective for the player
aPlayer: Integer;
aObjectiveType: TKMObjectiveType; // type of the objective (see TKMObjectiveType for details)
aPriority: Integer; // Affects objective position in the list. Smaller numbers come first. Otherwise objectives keep order in which they were added
aStatus: TKMObjectiveStatus; // status of the objective (see TKMObjectiveStatus for details)
aCaption: string; // text displayed
Integer // UID of the objective
3026 PlayerObjectiveUpdateStatus
Update objective status
aPlayer: Integer;
aObjectiveId: Integer;
aStatus: TKMObjectiveStatus;
- PlayerObjectiveUpdateText
Update objective text displayed in GUI. Color-coding is supported
aPlayer: Integer;
aObjectiveId: Integer;
aText: string;
4947 PlayerOverlayAppend aPlayer: Integer;
aText: string;
-8131 PlayerOverlayAppendFormatted
Removed
Method was removed, Formatted messages can be made with Utils.Format()
aPlayer: Integer;
aText: string;
Params: array of const;
4947 PlayerOverlaySet aPlayer: Integer;
aText: string;
-8131 PlayerOverlaySetFormatted
Removed
Method was removed, Formatted messages can be made with Utils.Format()
aPlayer: Integer;
aText: string;
Params: array of const;
- PlayerShareFog
Start or stop sharing FOW between players. This can be done assymetrically
True means that aPlayer1 shares his FOW with aPlayer2 (in other words, P1 allows P2 to see his FOW
aPlayer1: Integer;
aPlayer2: Integer;
aShare: Boolean;
8460 PlayerTradeAllow
Allows or forbids trading of certain ware in Marketplace
aPlayer: Integer;
aWareType: TKMWareType;
aAllowed: Boolean;
- PlayerWareDistribution
Change ware distribution between players houses
aPlayer: Integer;
aWareType: TKMWareType;
aHouseType: TKMHouseType;
aAmount: Byte; // Sets how many wares of the type can be a maximum in the house type. Allowed values (0..5)
- PlayerWin
Sets all player IDs in aVictors to victorious. All other players are set to defeated.
aVictors: array of Integer;
aTeamVictory: Boolean; // If all teammates win too
- PlayWAV
Play WAV file
aPlayer: Integer;
aFilename: string; // Name of the file from the map folder, without a path. Must have ".wav" extension.
aVolume: Single; // Playback volume. From 0.0 to 1.0
- PlayWAVAtLocation
Play WAV file at specified location on map
aPlayer: Integer;
aFilename: string; // Name of the file from the map folder, without a path. Must have ".wav" extension.
aVolume: Single; // Playback volume. From 0.0 to 1.0
X: Word; // X tile coordinate
Y: Word; // Y tile coordinate
10523 RoadAdd
Set a road on terrain
X, Y: Word;
aPlayer: Integer; // Owner of the road
Boolean // Success or fail
10523 RoadRemove
Remove road from terrain
X, Y: Word;
4586 StockpileAdd
Add stockpile on the map
aWareType: TKMWareType; // Ware type
aX, aY: Word;
aCount: Word; // Ware count. Must be in range 1 .. 10
Integer // UID of the stockpile in case of success
12776 StockpileAt
Returns stockpile UID at location
aX, aY: Word; Integer // UID of the stockpile in case of success
4586 StockpileSetCount
Change number of wares in a stockpile. Stockpile must be not empty
aStockpileID: Integer; // UID of the stockpile
aCount: Word; // New ware count. If zero, stockpile will be removed
8166 TerrainHighlightDelete
Delete highlight previously placed on terrain
aUID: Integer;
8166 TerrainHighlightFill
Add highlighted area to terrain
aX, aY: Single;
aWidth: Single;
aHeight: Single;
aColor: Cardinal;
Integer
8166 TerrainHighlightLine
Add outline highlight to terrain
aX, aY: Single;
aWidth: Single;
aHeight: Single;
aThickness: Single;
aColor: Cardinal;
Integer // Id of the highlight (to be used in delete). -1 in case of fail
13765 TerrainObjectRemoveTile
Tries to remove an object from the terrain tile
Function may fail if the object was used by someone in the game (e.g. grain being cut)
aX, aY: Integer; Boolean // Success or fail
13765 TerrainObjectRemoveVert
Tries to remove an object from the terrain vertice
Function may fail if the object was used by someone in the game (e.g. tree being cut)
aX, aY: Integer; Boolean // Success or fail
13765 TerrainObjectSet
Tries to set an object on to the terrain (possibly replacing existing one)
Consult with the MapEd to see which objects are tile-placed and vertice-placed
Trees, grain fields and such are allowed and supported
Function may fail if the tile/vertice was used by someone in the game (e.g. unit or a house)
aX, aY: Integer;
aRot: Byte;
aObject: Word;
Boolean // Success or fail
14725 TerrainObjectSetEx
Tries to set an object on to the terrain (possibly replacing existing one)
Consult with the MapEd to see which objects are tile-placed and vertice-placed
Trees, grain fields and such are allowed and supported
Function may fail if the tile/vertice was used by someone in the game (e.g. unit or a house)
aX, aY: Integer;
aRot: Byte;
aObject: string;
Boolean // Success or fail
14230 TerrainObjectStateChange
Toggles map object to certain state
aX, aY: Integer;
aCoord: Byte;
aNewState: Byte; // New state (as listed in MapEd)
aSkipAnim: Boolean; // Change objects state without transition animation
Boolean
6620 TerrainParticleEmitterAdd
Adds particle emitter on to terrain. Replaces any existing emitter on the spot
aX, aY: Word;
aType: Integer;
6620 TerrainParticleEmitterDelete
Remove particle emitter from terrain
aX, aY: Word;
5094 TerrainTriggerAdd
Adds rectangle trigger area on to terrain
aLeft: Word;
aTop: Word;
aRight: Word;
aBottom: Word;
Integer // Id of the trigger in case of success. Otherwise -1.
5094 TerrainTriggerDelete
Remove trigger area from terrain
aId: Integer; // Id of the trigger to be removed
9785 UnitAnimalSteer
Tells animal to steer around a new spot. Note than this is only a hint, animal could be busy with other task or be restricted.
aUnitID: Integer; // ID of the animal
aAnchorX: Integer; // New anchor around which the animal will try to steer. -1 for none
aAnchorY: Integer; // New anchor around which the animal will try to steer. -1 for none
aGuardRadius: Integer; // New guard radius (only for agressive animals). How far from the anchor animal can actively attack foes. 0..255
aWanderRadius: Integer; // New wandering radius. How far from the anchor animal can wander. Needs to be >= than guard radius. 0..255
7968 UnitCarryGive
Give wares to the unit (only Wagons supported yet)
aUnitID: Integer;
aWare: TKMWareType;
aCount: Integer;
Integer // number of wares Given (could be 0 or smaller than requested due to max Wagon capacity and ware type mismatch)
2732 UnitCarryTake
Take wares from the unit (only Wagons supported yet)
aUnitID: Integer;
aWare: TKMWareType;
aCount: Integer;
Integer // number of wares taken (0 if unsuccessfull)
15091 UnitDamageSet
Sets units damage
Applicable to melee, ranged and agressive animals
If unit changes owner, this setting will be carried over
aUnitID: Integer; // ID of the unit
aDamageMin: Integer; // Allowed values are 0 .. 100. Pass -1 to reset to default
aDamageMax: Integer; // Allowed values are 1 .. 100. Pass -1 to reset to default
- UnitDirectionSet
Make idle unit face specified direction
aUnitID: Integer;
aDir: Integer;
Boolean // success or fail
14230 UnitFlagColorOverride
Changed unit flag color to a custom one. Valid values are 0..$FFFFFF. Pass -1 to reset to default
aUnitID: Integer;
aColor: Integer;
14498 UnitHitpointsChange
Changes unit Hitpoints. If hitpoints reach zero, unit will die with animation
aUnitID: Integer; // ID of the unit
aValue: Integer; // Hitpoints change. Plus to add, Minus to reduce
14505 UnitHitpointsMax
Sets unit maximum Hitpoints
aUnitID: Integer; // ID of the unit
aValue: Integer; // Allowed values are 1 .. 500. Pass -1 to reset to default
14505 UnitHitpointsRestorePace
One hitpoint will be restored for the unit once every X ticks
Note that hitpoint restoration is naturally paused when unit is taking damage
If unit changes owner, this setting will be carried over
aUnitID: Integer; // ID of the unit
aRestorePace: Integer; // Allowed values are from 0 (no restoration) to 600 (once every minute). Pass -1 to reset to default
14498 UnitHitpointsSet
Set unit Hitpoints. If hitpoints are set to zero, unit will die with animation
aUnitID: Integer; // ID of the unit
aValue: Integer; // Hitpoints
14498 UnitHungerChange
Changes unit hunger level.
If unit changes owner, this setting will be carried over
aUnitID: Integer; // ID of the unit
aHungerSec: Integer; // Hunger level change in seconds of unit life. Should be within 0 and 2700 (45min). Plus to add, Minus to reduce
6692 UnitHungerSet
Set unit hunger level.
If unit changes owner, this setting will be carried over
aUnitID: Integer; // ID of the unit
aHungerSec: Integer; // Hunger level in seconds of unit life. Should be within 0 and 2700 (45min)
- UnitKill
Kills a unit
Actual death could still take up to a couple of ticks, until all internal interactions are resolved
Units in training can not die until they are trained.
aUnitID: Integer;
aSilent: Boolean; // Makes unit die without exiting house, death animation and sound
15063 UnitNameSet
Set unit name to be diplayed in HUD
aUnitID: Integer; // ID of the unit
aName: string; // Name of the unit. Pass empty string to reset to default
- UnitOrderWalk
Order a unit to walk to location. Can not order to animals. Only idle units can be ordered to walk.
aUnitID: Integer;
X, Y: Word;
Boolean // success or fail
5128 UnitOwnerChange
Change owner of the unit. Technically it kills old unit and creates a new one with the same basic properties
(type, position, direction, hp, condition, wares). All the advanced props and states do not get carried over.
Warriors need to change owner via GroupOwnerChange (even single ones)
aUnitID: Integer;
aPlayer: Integer;
Integer // UID of new unit
14501 UnitSight
Change unit sight radius. Measured in whole tiles from the units position
If unit changes owner, this setting will be carried over
Valid values are 1 .. 32. Pass -1 to reset to default
aUnitID: Integer;
aSight: Integer;
Alpha 11.2 UnitUnlock
Allow the unit to be trained (if was blocked in a static script)
aPlayer: Integer;
aUnitType: TKMUnitType;
r10636 UnitWagonOrderEnterHouse
Order wagon to enter a building
aWagonID: Integer;
aHouseID: Integer;
r10636 UnitWagonOrderHalt
Order wagon to stop movement
aWagonID: Integer;
r10636 UnitWagonOrderWalk
Order wagon to move to destination
aWagonID: Integer;
aX, aY: Word;
aDirection: Word;
14230 WeatherAmbColorSet
Sets new color for the ambient lighting
aColor: Integer; // RGB color value. Use -1 to reset to default
14230 WeatherSkyColorSet
Sets new color for the sky
aColor: Integer; // RGB color value. Use -1 to reset to default
14230 WeatherSunColorSet
Sets new color for the sun
aColor: Integer; // RGB color value. Use -1 to reset to default
14230 WeatherSunPositionSet
Sets new position for the sun
aAzimuth: Single; // Setting the sun to shine from North is 0.0, from East is 90.0, from South is 180.0, from West is 270.0. Allowed range is 0.0 .. 360.0. Use < 0.0 to reset to default
aAltitude: Single; // Sunset is at 0.0 degrees, Noon is at 90.0 degrees. Allowed range is -90.0 .. 90.0. Use < -90.0 to reset to default