scripting:ems
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.
| Nächste Überarbeitung | Vorherige Überarbeitung | ||
| scripting:ems [2019/06/28 19:34] – angelegt madshadow | scripting:ems [2022/01/11 23:27] (aktuell) – madshadow | ||
|---|---|---|---|
| Zeile 5: | Zeile 5: | ||
| ===== Verwendung ===== | ===== Verwendung ===== | ||
| Folgendes Skript kann ins Mapskript kopiert werden: | Folgendes Skript kann ins Mapskript kopiert werden: | ||
| - | <code lua>-- ################################################################################################## | + | <code lua> |
| - | -- # # | + | -- ################################################################################################### |
| - | -- # # | + | |
| - | -- # | + | |
| -- # # | -- # # | ||
| - | -- # | ||
| -- # # | -- # # | ||
| -- # | -- # | ||
| Zeile 38: | Zeile 35: | ||
| end </ | end </ | ||
| + | |||
| + | ===== Die Konfiguration ===== | ||
| + | Jede Karte lädt eine Standardkonfiguration. Die reicht in der Regel jedoch nicht aus, daher musst du noch ein Konfigurationsskript erstellen und in den **EMSconfigurations** Ordner kopieren: | ||
| + | Damit das Skript geladen wird **muss** es denselben Namen wie die Karte tragen.\\ | ||
| + | Beispiel: Heißt die Karte "(4) Toscana V2", so muss das Skript "(4) toscana v2.lua" | ||
| + | <code lua> | ||
| + | -- ************************************************************************************************ | ||
| + | -- * * | ||
| + | -- * * | ||
| + | -- * EMS * | ||
| + | -- * | ||
| + | -- * * | ||
| + | -- * * | ||
| + | -- ************************************************************************************************ | ||
| + | |||
| + | EMS_CustomMapConfig = | ||
| + | { | ||
| + | -- ******************************************************************************************** | ||
| + | -- * Configuration File Version | ||
| + | -- * A version check will make sure every player has the same version of the configuration file | ||
| + | -- ******************************************************************************************** | ||
| + | Version = 1, | ||
| + | |||
| + | -- ******************************************************************************************** | ||
| + | -- * Debug Mode | ||
| + | -- * Activates the ems debug mode if set to true. | ||
| + | -- * This will enable key bindings to achieve some common debug tasks. | ||
| + | -- * Ingame a button with the text " | ||
| + | -- * (Default: false) | ||
| + | -- ******************************************************************************************** | ||
| + | ActivateDebug = true, | ||
| + | |||
| + | -- ******************************************************************************************** | ||
| + | -- * Custom debug functions | ||
| + | -- * If ActivateDebug is set to true, these two debug methods can be called by pressing N or M | ||
| + | -- * _fromPlayer - the id of the player that pressed the key | ||
| + | -- * _targetPlayerId1 - a player id between 1-8 (or 16 on cnetwork), that the caller wants to target | ||
| + | -- * _targetPlayerId2 - a second player id | ||
| + | -- * _x, _y - the position of the callers mouse at the time of pressing the key | ||
| + | -- * Example content: | ||
| + | -- * SetFriendly(_targetPlayerId1, | ||
| + | -- * Logic.CreateEntity(Entities.PU_Serf, | ||
| + | -- ******************************************************************************************** | ||
| + | CustomDebugFunc1 = function(_fromPlayer, | ||
| + | Logic.CreateEntity(Entities.PU_Serf, | ||
| + | end, | ||
| + | CustomDebugFunc2 = function(_fromPlayer, | ||
| + | Logic.CreateEntity(Entities.PU_Serf, | ||
| + | end, | ||
| + | |||
| + | -- ******************************************************************************************** | ||
| + | -- * Callback_OnMapStart | ||
| + | -- * Called directly after the loading screen vanishes and works as your entry point. | ||
| + | -- * Similar use to FirstMapAction/ | ||
| + | -- ******************************************************************************************** | ||
| + | Callback_OnMapStart = function() | ||
| + | AddPeriodicSummer(60); | ||
| + | SetupHighlandWeatherGfxSet(); | ||
| + | LocalMusic.UseSet = HIGHLANDMUSIC; | ||
| + | end, | ||
| + | |||
| + | |||
| + | -- ******************************************************************************************** | ||
| + | -- * Callback_OnGameStart | ||
| + | -- * Called at the end of the 10 seconds delay, after the host chose the rules and started | ||
| + | -- ******************************************************************************************** | ||
| + | Callback_OnGameStart = function() | ||
| + | end, | ||
| + | |||
| + | -- ******************************************************************************************** | ||
| + | -- * Callback_OnPeacetimeEnded | ||
| + | -- * Called when the peacetime counter reaches zero | ||
| + | -- ******************************************************************************************** | ||
| + | Callback_OnPeacetimeEnded = function() | ||
| + | end, | ||
| + | |||
| + | |||
| + | -- ******************************************************************************************** | ||
| + | -- * Peacetime | ||
| + | -- * Number of minutes the players will be unable to attack each other | ||
| + | -- ******************************************************************************************** | ||
| + | Peacetime = 30, | ||
| + | |||
| + | -- ******************************************************************************************** | ||
| + | -- * GameMode | ||
| + | -- * GameMode is a concept of a switchable option, that the scripter can freely use | ||
| + | -- * | ||
| + | -- * GameModes is a table that contains the available options for the players, for example: | ||
| + | -- * GameModes = {" | ||
| + | -- * | ||
| + | -- * GameMode contains the index of selected mode by default - ranging from 1 to X | ||
| + | -- * | ||
| + | -- * Callback_GameModeSelected | ||
| + | -- * Lets the scripter make changes, according to the selected game mode. | ||
| + | -- * You could give different ressources or change the map environment accordingly | ||
| + | -- * _gamemode contains the index of the selected option according to the GameModes table | ||
| + | -- ******************************************************************************************** | ||
| + | GameMode = 1, | ||
| + | GameModes = {" | ||
| + | Callback_GameModeSelected = function(_gamemode) | ||
| + | end, | ||
| + | |||
| + | -- ******************************************************************************************** | ||
| + | -- * Resource Level | ||
| + | -- * Determines how much ressources the players start with | ||
| + | -- * 1 = Normal | ||
| + | -- * 2 = FastGame | ||
| + | -- * 3 = SpeedGame | ||
| + | -- * See the ressources table below for configuration | ||
| + | -- ******************************************************************************************** | ||
| + | ResourceLevel = 1, | ||
| + | |||
| + | -- ******************************************************************************************** | ||
| + | -- * Resources | ||
| + | -- * Order: | ||
| + | -- * Gold, Clay, Wood, Stone, Iron, Sulfur | ||
| + | -- * Rules: | ||
| + | -- * 1. If no player is defined, default values are used | ||
| + | -- * 2. If player 1 is defined, these ressources will be used for all other players too | ||
| + | -- * 3. Use the players index to give ressources explicitly | ||
| + | -- ******************************************************************************************** | ||
| + | Ressources = | ||
| + | { | ||
| + | -- * Normal default: 1k, 1.8k, 1.5k, 0.8k, 50, 50 | ||
| + | Normal = { | ||
| + | [1] = { | ||
| + | 500, | ||
| + | 2400, | ||
| + | 1750, | ||
| + | 700, | ||
| + | 50, | ||
| + | 50, | ||
| + | }, | ||
| + | }, | ||
| + | -- * FastGame default: 2 x Normal Ressources | ||
| + | FastGame = {}, | ||
| + | |||
| + | -- * SpeedGame default: 20k, 12k, 14k, 10k, 7.5k, 7.5k | ||
| + | SpeedGame = {}, | ||
| + | }, | ||
| + | |||
| + | -- ******************************************************************************************** | ||
| + | -- * Callback_OnFastGame | ||
| + | -- * Called together with Callback_OnGameStart if the player selected ResourceLevel 2 or 3 | ||
| + | -- * (FastGame or SpeedGame) | ||
| + | -- ******************************************************************************************** | ||
| + | Callback_OnFastGame = function() | ||
| + | end, | ||
| + | |||
| + | -- ******************************************************************************************** | ||
| + | -- * AI Players | ||
| + | -- * Player Entities that belong to an ID that is also present in the AIPlayers table won't be | ||
| + | -- * removed | ||
| + | -- ******************************************************************************************** | ||
| + | AIPlayers = {}, | ||
| + | |||
| + | -- ******************************************************************************************** | ||
| + | -- * DisableInitCameraOnHeadquarter | ||
| + | -- * Set to true if you don't want the camera to be set to the headquarter automatically | ||
| + | -- * (default: false) | ||
| + | -- ******************************************************************************************** | ||
| + | DisableInitCameraOnHeadquarter = false, | ||
| + | |||
| + | -- ******************************************************************************************** | ||
| + | -- * DisableSetZoomFactor | ||
| + | -- * If set to false, ZoomFactor will be set to 2 automatically | ||
| + | -- * Set to true if nothing should be done | ||
| + | -- * (default: false) | ||
| + | -- ******************************************************************************************** | ||
| + | DisableSetZoomFactor = false, | ||
| + | |||
| + | -- ******************************************************************************************** | ||
| + | -- * DisableStandardVictoryCondition | ||
| + | -- * Set to true if you want to implement your own victory condition | ||
| + | -- * Otherwise the player will lose upon losing his headquarter | ||
| + | -- * (default: false) | ||
| + | -- ******************************************************************************************** | ||
| + | DisableStandardVictoryCondition = false, | ||
| + | |||
| + | -- ******************************************************************************************** | ||
| + | -- * NeedsCppLogic | ||
| + | -- * If true, the script will check if all players have mcbs CppLogic dll loaded | ||
| + | -- * Set to true if you use function of CppLogic | ||
| + | -- * (default: false) | ||
| + | -- ******************************************************************************************** | ||
| + | NeedsCppLogic = false, | ||
| + | |||
| + | -- ******************************************************************************************** | ||
| + | -- * NeedsS5CommunityLib | ||
| + | -- * If true, the script will check if all players have the same version of the S5CommunityLib | ||
| + | -- * Set to true if you use function of the S5CommunityLib | ||
| + | -- * (default: false) | ||
| + | -- ******************************************************************************************** | ||
| + | NeedsS5CommunityLib = false, | ||
| + | |||
| + | -- ******************************************************************************************** | ||
| + | -- * Units | ||
| + | -- * Various units can be allowed or forbidden | ||
| + | -- * A 0 means the unit is forbidden - a higher number represents the maximum allowed level | ||
| + | -- * Example: | ||
| + | -- * Sword = 0, equals Swords are forbidden | ||
| + | -- * Sword = 2, equals the maximum level for swords is 2 = Upgrading once | ||
| + | -- ******************************************************************************************** | ||
| + | Sword | ||
| + | Bow = 4, | ||
| + | PoleArm = 4, | ||
| + | HeavyCavalry = 0, | ||
| + | LightCavalry = 0, | ||
| + | Rifle = 2, | ||
| + | Thief = 1, | ||
| + | Scout = 1, | ||
| + | Cannon1 = 0, | ||
| + | Cannon2 = 0, | ||
| + | Cannon3 = 0, | ||
| + | Cannon4 = 0, | ||
| + | |||
| + | -- * Buildings | ||
| + | Bridge = 1, | ||
| + | |||
| + | -- * Markets | ||
| + | -- * -1 = Building markets is forbidden | ||
| + | -- * 0 = Building markets is allowed | ||
| + | -- * >0 = Markets are allowed and limited to the number given | ||
| + | Markets = 0, | ||
| + | |||
| + | -- * Trade Limit | ||
| + | -- * 0 = no trade limit | ||
| + | -- * greater zero = maximum amount that you can buy in one single trade | ||
| + | TradeLimit = 0, | ||
| + | |||
| + | -- * TowerLevel | ||
| + | -- * 0 = Towers forbidden | ||
| + | -- * 1 = Watchtowers | ||
| + | -- * 2 = Balistatowers | ||
| + | -- * 3 = Cannontowers | ||
| + | TowerLevel = 1, -- 0-3 | ||
| + | |||
| + | -- * TowerLimit | ||
| + | -- * 0 = no tower limit | ||
| + | -- * >0 = towers are limited to the number given | ||
| + | TowerLimit = 0, | ||
| + | |||
| + | -- * WeatherChangeLockTimer | ||
| + | -- * Minutes for how long the weather can't be changed directly again after a weatherchange happened | ||
| + | WeatherChangeLockTimer = 3, | ||
| + | |||
| + | -- * Enables chaning to a specific weather with the weather tower | ||
| + | MakeSummer = 1, | ||
| + | MakeRain | ||
| + | MakeSnow | ||
| + | |||
| + | -- * Fixes the DestrBuild bug | ||
| + | AntiBug | ||
| + | |||
| + | -- * HQRush | ||
| + | -- * If set to 1, Headquarters are invulernerable as long the player still has village centers | ||
| + | AntiHQRush = 1, | ||
| + | |||
| + | -- * If set to 1, Players can't abuse blessing and overtime in combination for unlimited work | ||
| + | BlessLimit = 1, | ||
| + | |||
| + | -- * if set to true, Players are not able to lose their Headquarter. | ||
| + | InvulnerableHQs = false, | ||
| + | |||
| + | -- * Heroes | ||
| + | -- * NumberOfHeroesForAll sets the number of heroes every player can pick | ||
| + | -- * 1 behind each hero defines if the hero is allowed; 0 for forbidden | ||
| + | NumberOfHeroesForAll = 2, | ||
| + | Dario | ||
| + | Pilgrim | ||
| + | Ari = 1, | ||
| + | Erec = 1, | ||
| + | Salim | ||
| + | Helias | ||
| + | Drake | ||
| + | Yuki = 1, | ||
| + | Kerberos = 1, | ||
| + | Varg = 1, | ||
| + | Mary_de_Mortfichet = 1, | ||
| + | Kala = 1, | ||
| + | }; | ||
| + | </ | ||
scripting/ems.1561750486.txt.gz · Zuletzt geändert: 2021/09/18 19:00 (Externe Bearbeitung)
