diff --git a/(10)trymemode.stormmap/base.stormdata/Modules/LibUtilities.galaxy b/(10)trymemode.stormmap/base.stormdata/Modules/LibUtilities.galaxy index 1cf5091..adacee0 100644 --- a/(10)trymemode.stormmap/base.stormdata/Modules/LibUtilities.galaxy +++ b/(10)trymemode.stormmap/base.stormdata/Modules/LibUtilities.galaxy @@ -29,6 +29,7 @@ trigger libUTIL_gt_SetCameraObject; trigger libUTIL_gt_ResetCameraObject; trigger libUTIL_gt_ForceRunTrigger; trigger libUTIL_gt_ToggleACTS; +trigger libUTIL_gt_MinionWaveInterval; // Library Initialization void libUTIL_InitVariables (); @@ -544,6 +545,56 @@ void libUTIL_gt_ToggleACTS_Init () { TriggerAddEventChatMessage(libUTIL_gt_ToggleACTS, c_playerAny, "alliancecontrolteamselection", true); } +//-------------------------------------------------------------------------------------------------- +// Trigger: Minion Wave Interval +//-------------------------------------------------------------------------------------------------- +bool libUTIL_gt_MinionWaveInterval_Func (bool testConds, bool runActions) { + // Variable Declarations + trigger lv_minionSpawnTrigger; + fixed lv_seconds; + + // Automatic Variable Declarations + // Variable Initialization + lv_seconds = 30.0; + + // Conditions + if (testConds) { + if (!(((StringWord(EventChatMessage(false), 1) == "mwi") || (StringWord(EventChatMessage(false), 1) == "minonwaveinterval")))) { + return false; + } + } + + // Actions + if (!runActions) { + return true; + } + + if ((StringWord(EventChatMessage(false), 2) == null)) { + lv_seconds = libCore_gv_bALMinionWaveInterval; + UIDisplayMessage(PlayerGroupAll(), c_messageAreaDebug, StringToText(("Minion Wave Interval is: " + FixedToString(lv_seconds, c_fixedPrecisionAny)))); + } + else { + lv_seconds = StringToFixed(StringWord(EventChatMessage(false), 2)); + if ((lv_seconds > 0.0)) { + libCore_gv_bALMinionWaveInterval = lv_seconds; + libGame_gf_MinionStartStopMinionSpawnCycle(false); + libGame_gf_MinionStartStopMinionSpawnCycle(true); + UIDisplayMessage(PlayerGroupAll(), c_messageAreaDebug, StringToText(("Minion Wave Interval set to: " + FixedToString(lv_seconds, c_fixedPrecisionAny)))); + } + else { + UIDisplayMessage(PlayerGroupAll(), c_messageAreaDebug, StringToText(("Invalid Interval Value: " + StringWord(EventChatMessage(false), 2)))); + } + } + return true; +} + +//-------------------------------------------------------------------------------------------------- +void libUTIL_gt_MinionWaveInterval_Init () { + libUTIL_gt_MinionWaveInterval = TriggerCreate("libUTIL_gt_MinionWaveInterval_Func"); + TriggerAddEventChatMessage(libUTIL_gt_MinionWaveInterval, c_playerAny, "mwi", false); + TriggerAddEventChatMessage(libUTIL_gt_MinionWaveInterval, c_playerAny, "minionwaveinterval", false); +} + void libUTIL_InitTriggers () { libUTIL_gt_MapInit_Init(); libUTIL_gt_ClearTextMessage_Init(); @@ -560,6 +611,7 @@ void libUTIL_InitTriggers () { libUTIL_gt_ResetCameraObject_Init(); libUTIL_gt_ForceRunTrigger_Init(); libUTIL_gt_ToggleACTS_Init(); + libUTIL_gt_MinionWaveInterval_Init(); } //-------------------------------------------------------------------------------------------------- diff --git a/(10)trymemode.stormmap/base.stormdata/Modules/Modules_Editor.SC2Mod b/(10)trymemode.stormmap/base.stormdata/Modules/Modules_Editor.SC2Mod index 1516747..2a59492 100644 Binary files a/(10)trymemode.stormmap/base.stormdata/Modules/Modules_Editor.SC2Mod and b/(10)trymemode.stormmap/base.stormdata/Modules/Modules_Editor.SC2Mod differ diff --git a/(10)trymemode.stormmap/base.stormdata/Modules/doc.json b/(10)trymemode.stormmap/base.stormdata/Modules/doc.json index 7f2fdcc..62c4670 100644 --- a/(10)trymemode.stormmap/base.stormdata/Modules/doc.json +++ b/(10)trymemode.stormmap/base.stormdata/Modules/doc.json @@ -280,6 +280,41 @@ "description": "Toggle Alliance Control + Multi-Selection" } ] + }, + { + "shortCommand": "mwi", + "command": "minionwaveinterval", + "description": [ + "Get or Set the minion wave interval (Times to spawn a minion. Usually 30s but for 15s in ARAM.)" + ], + "uiAvailable": false, + "parameters": [ + { + "name": "seconds", + "required": false, + "description": "Defines interval for minion wave to spawn", + "defaultValue": "(The map's original interval, usually 30 but 15 for ARAMs)", + "type": "float" + } + ], + "examples": [ + { + "command": "mwi", + "description": "Get the minion wave interval" + }, + { + "command": "minionwaveinterval", + "description": "Get the minion wave interval" + }, + { + "command": "mwi 0.0625", + "description": "Set the minion wave to spawn every 0.0625 seconds (each game loop)" + }, + { + "command": "mwi 100", + "description": "Set the minion wave to spawn every 100 seconds." + } + ] } ] }, @@ -1382,7 +1417,6 @@ " - Some of the fields are READ-ONLY, meaning it cannot be modified, e.g `Unit,HeroChromie,PlaneArray[Air]` (Unable to make Chromie become an air unit like Medivh Raven). This would require an override to the XML instead (see [MODDING.md](MODDING.md)).", " - The catalog modification is applied after parental inheritance, meaning that it is not possible to modify a parent (`parent=\"xxx\"`) for its effect to apply to all child catalogs. You must need to do it on each of the child catalogs.", " - It is not possible \"create\" a value that does not exist after the map loaded. Meaning it can only modify value based on existed ones (after inherit attributes from parent)" - ], "uiAvailable": false, "parameters": [ diff --git a/USAGE.md b/USAGE.md index 8a4f7b9..c5b35d8 100644 --- a/USAGE.md +++ b/USAGE.md @@ -1,7 +1,7 @@ # Usage -*(Generated from [doc.json](./(10)trymemode.stormmap/base.stormdata/Modules/doc.json) at Sat, 26 Dec 2020 01:59:03 GMT)* +*(Generated from [doc.json](./(10)trymemode.stormmap/base.stormdata/Modules/doc.json) at Wed, 30 Dec 2020 02:59:36 GMT)* Generally, most of the functionalities are using chat commands. Simply type the commands in the chat box (like how you would normally chat with teammates). >Note: Remember to either use allies or all chat channel when try to use the commands. Public chat channels and Private Messages (PM) does not work. @@ -36,6 +36,8 @@ Some of the commands have an UI counterpart implemented, which will display a me - ๐Ÿ’ญ [Command: `forceruntrigger`](#cmd-forceruntrigger) + - ๐Ÿ’ญ [Command: `minionwaveinterval`](#cmd-minionwaveinterval) + - ๐Ÿ’ญ [Command: `resetcameraobject`](#cmd-resetcameraobject) - ๐Ÿ’ญ [Command: `restartgame`](#cmd-restartgame) @@ -282,6 +284,44 @@ Force to Run a Trigger created by `TriggerCreate()` with ignoring conditions and +[\[Return to Table of Contents ๐Ÿงพ\]](#meta-toc) + +[\[Return to Top โฌ†\]](#meta-top) + + + +## (`minionwaveinterval` | `mwi`) `[seconds]` + + +#### โœ Description: +Get or Set the minion wave interval (Times to spawn a minion. Usually 30s but for 15s in ARAM.) + + + +#### โš™ Parameters: + [seconds] + Required: false + Type: float + Usage: Defines interval for minion wave to spawn + Default: (The map's original interval, usually 30 but 15 for ARAMs) + + +#### ๐Ÿ”ง Examples: + > mwi + (Get the minion wave interval) + > minionwaveinterval + (Get the minion wave interval) + > mwi 0.0625 + (Set the minion wave to spawn every 0.0625 seconds (each game loop)) + > mwi 100 + (Set the minion wave to spawn every 100 seconds.) + + +#### ๐Ÿ–ผ UI Availability: +- โŒ **Not Implemented** + + + [\[Return to Table of Contents ๐Ÿงพ\]](#meta-toc) [\[Return to Top โฌ†\]](#meta-top)