diff --git a/CHANGELOG.md b/CHANGELOG.md index e7829c623..b57cffcfa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ### Added +- Community API.(Slayer95) + - In the future, AMAI will develop some interfaces for the community to enable map authors to quickly modify certain functions in the game without the need to study AMAI's code. - Basic AI interopability for LUA maps but with some issues: - Commander works enough in LUA maps to let you set the initial language and game mode, but bringing up rest of commander during the game or typing commands does not currently work. - (DevTools) Note chat placeholders is no longer supported in languages. This affects both Jass and Lua maps. diff --git a/README.md b/README.md index bcdd4e352..b0765554b 100644 --- a/README.md +++ b/README.md @@ -331,6 +331,21 @@ If your custom map has custom units you will need to make custom changes to AMAI AMAI has built in support to be able to write new strategies and profiles using the **Strategy Manager UI Client** . The `Manual` folder contains more details. +## Community API + +The official version will not use the shutdown function, but permissions will be open to community map authors, especially those who use AMAI but are not clear about its internal operating logic, don't need you study AMAI code. These APIs will quickly help you modify AMAI's system and this is real time intervention in the game. + +You can use `AI - Send Command` in trigger. But it can only be sent after the action of running the AI script is completed. + +Most functions only determine cmd, but a small portion of functions can be precisely controlled using data. +For example, when data is -1, it refers to all AI players, while other values correspond to specific players. + +This API is still under improvement.If the function you want to implement is not here, please provide feedback. + +| **AMAI API** | **cmd value** | **data value** | **Submit during initialization** | **Describe** | +| ----------------- | ------------------- | ------------------ | ------------------ | ------------------ | +| **No Use Neutral Heros** | 8000 | 0 | should be | all AI No Use Neutral Heros | + # Credits ### Helpers @@ -345,7 +360,7 @@ AMAI has built in support to be able to write new strategies and profiles using - French - JUJU, WILL THE ALMIGHTY - Spanish - Vexorian, Moyack, Slayer95 - Romanian - Andas_007 -- Chinese - Dr Fan, Sheeryiro KeamSpring, Pixyy +- Chinese - Dr Fan, Sheeryiro, KeamSpring, Pixyy - Russian - RaZ and Darkloke, Lolasik011 - Portuguese - imba curisco ghouleh - Norwegian - Aray diff --git a/common.eai b/common.eai index ac42899f3..e02973003 100644 --- a/common.eai +++ b/common.eai @@ -8061,13 +8061,18 @@ function cmd_misc takes integer cmd, integer data returns nothing elseif cmd == 73 then set console_on = true - elseif cmd == 80 then - set nearest_neutral[NEUTRAL_TAVERN] = null - set recalculate_heros = true endif endfunction +//============================================================================ +function cmd_api takes integer cmd, integer data returns nothing + + if cmd == 8000 and data == 0 then + set recalculate_heros = true + endif +endfunction + //============================================================================ function cmd_loop takes nothing returns nothing local integer cmd = 0 @@ -8099,9 +8104,12 @@ function cmd_loop takes nothing returns nothing elseif cmd < 40 then call cmd_queue(cmd, data) - else + elseif cmd < 8000 then call cmd_misc(cmd, data) + else + call cmd_api(cmd, data) + endif endloop