From 1ddb647725b129392b664c4ce5a00a852aa0050b Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Sun, 17 Nov 2024 04:45:28 +0800 Subject: [PATCH 01/17] Update common.eai --- common.eai | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/common.eai b/common.eai index ac42899f3..e2e5245d7 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 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 + else cmd < 8000 then call cmd_misc(cmd, data) + else + call cmd_api(cmd, data) + endif endloop From 5bb57186889a1e55cd500250e200ca424a7a4a0d Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Sun, 17 Nov 2024 04:57:21 +0800 Subject: [PATCH 02/17] Update README.md --- README.md | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index bcdd4e352..b43598e7a 100644 --- a/README.md +++ b/README.md @@ -331,6 +331,16 @@ 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. These APIs will quickly help you modify AMAI's system +You can use `AI - Send Command` in trigger +This API is still under improvement + +| AMAI cmd API | cmd | data | Submit during initialization | Describe +| ----------------- | ------------------- | ------------------| ------------------| +| **No Use Neutral Heros** | 8000 | 0 | should be | all AI No Use Neutral Heros | + # Credits ### Helpers @@ -339,15 +349,15 @@ AMAI has built in support to be able to write new strategies and profiles using - DK Slayer (For the Commander) ### Translations -- English - Chad Nicholas -- Swedish - Zalamander -- German - AIAndy, Sagan -- French - JUJU, WILL THE ALMIGHTY -- Spanish - Vexorian, Moyack, Slayer95 -- Romanian - Andas_007 -- Chinese - Dr Fan, Sheeryiro KeamSpring, Pixyy -- Russian - RaZ and Darkloke, Lolasik011 -- Portuguese - imba curisco ghouleh +- English - Chad Nicholas, +- Swedish - Zalamander, +- German - AIAndy, Sagan, +- French - JUJU, WILL THE ALMIGHTY, +- Spanish - Vexorian, Moyack,, Slayer95, +- Romanian - Andas_007, +- Chinese - Dr Fan, Sheeryiro, KeamSpring, Pixyy +- Russian - RaZ and Darkloke, Lolasik011, +- Portuguese - imba curisco ghouleh, - Norwegian - Aray ### Quality Assurance From 8a74ca43273d20775e3d58656b4d8e497437f59f Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Sun, 17 Nov 2024 04:59:36 +0800 Subject: [PATCH 03/17] Update CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) 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. From dbf71e25c03ad32d45f3a1b49298157a9a789195 Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Sun, 17 Nov 2024 05:01:33 +0800 Subject: [PATCH 04/17] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b43598e7a..143a30f25 100644 --- a/README.md +++ b/README.md @@ -333,11 +333,11 @@ AMAI has built in support to be able to write new strategies and profiles using ## 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. These APIs will quickly help you modify AMAI's system -You can use `AI - Send Command` in trigger -This API is still under improvement +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. 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. +This API is still under improvement. -| AMAI cmd API | cmd | data | Submit during initialization | Describe +| AMAI cmd API | cmd value | data value | Submit during initialization | Describe | ----------------- | ------------------- | ------------------| ------------------| | **No Use Neutral Heros** | 8000 | 0 | should be | all AI No Use Neutral Heros | From 0e2186824e0aed405caa34f6a5204b25d2cde88c Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Sun, 17 Nov 2024 05:05:58 +0800 Subject: [PATCH 05/17] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 143a30f25..900e4d2ad 100644 --- a/README.md +++ b/README.md @@ -337,7 +337,7 @@ The official version will not use the shutdown function, but permissions will be You can use `AI - Send Command` in trigger. This API is still under improvement. -| AMAI cmd API | cmd value | data value | Submit during initialization | Describe +| AMAI cmd API | cmd value | data value | Submit during initialization | Describe | | ----------------- | ------------------- | ------------------| ------------------| | **No Use Neutral Heros** | 8000 | 0 | should be | all AI No Use Neutral Heros | From 315d7d615514540724f007ad94941e448bc2be91 Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Sun, 17 Nov 2024 05:07:31 +0800 Subject: [PATCH 06/17] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 900e4d2ad..fe87e9644 100644 --- a/README.md +++ b/README.md @@ -337,8 +337,8 @@ The official version will not use the shutdown function, but permissions will be You can use `AI - Send Command` in trigger. This API is still under improvement. -| AMAI cmd API | cmd value | data value | Submit during initialization | Describe | -| ----------------- | ------------------- | ------------------| ------------------| +| AMAI cmd API | cmd value | data value | Submit during initialization | Describe | +| ----------------- | ------------------- | ------------------| ------------------ | | **No Use Neutral Heros** | 8000 | 0 | should be | all AI No Use Neutral Heros | # Credits From aafe8f4b746c2731e4da480756f3531c25c28aa5 Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Sun, 17 Nov 2024 05:08:42 +0800 Subject: [PATCH 07/17] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fe87e9644..e6aeae73b 100644 --- a/README.md +++ b/README.md @@ -337,8 +337,8 @@ The official version will not use the shutdown function, but permissions will be You can use `AI - Send Command` in trigger. This API is still under improvement. -| AMAI cmd API | cmd value | data value | Submit during initialization | Describe | -| ----------------- | ------------------- | ------------------| ------------------ | +| 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 From 689d3dca3b6e700d1e2b870d1c40e1f43ca5722e Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Sun, 17 Nov 2024 05:13:30 +0800 Subject: [PATCH 08/17] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20README.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index e6aeae73b..248c2823b 100644 --- a/README.md +++ b/README.md @@ -349,15 +349,15 @@ This API is still under improvement. - DK Slayer (For the Commander) ### Translations -- English - Chad Nicholas, -- Swedish - Zalamander, -- German - AIAndy, Sagan, -- French - JUJU, WILL THE ALMIGHTY, -- Spanish - Vexorian, Moyack,, Slayer95, -- Romanian - Andas_007, +- English - Chad Nicholas +- Swedish - Zalamander +- German - AIAndy, Sagan +- French - JUJU, WILL THE ALMIGHTY +- Spanish - Vexorian, Moyack, Slayer95 +- Romanian - Andas_007 - Chinese - Dr Fan, Sheeryiro, KeamSpring, Pixyy -- Russian - RaZ and Darkloke, Lolasik011, -- Portuguese - imba curisco ghouleh, +- Russian - RaZ and Darkloke, Lolasik011 +- Portuguese - imba curisco ghouleh - Norwegian - Aray ### Quality Assurance From 49dc8c231e0d12d468b61935295d88b85eb6e3dc Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Sun, 17 Nov 2024 05:15:35 +0800 Subject: [PATCH 09/17] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20common.eai?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common.eai | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common.eai b/common.eai index e2e5245d7..d8b545b0e 100644 --- a/common.eai +++ b/common.eai @@ -8104,7 +8104,7 @@ function cmd_loop takes nothing returns nothing elseif cmd < 40 then call cmd_queue(cmd, data) - else cmd < 8000 then + elseif cmd < 8000 then call cmd_misc(cmd, data) else From 85f935a524cfeb09ad3f3719c04c84ee140a9ec1 Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Sun, 17 Nov 2024 05:18:43 +0800 Subject: [PATCH 10/17] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20README.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 248c2823b..17b79138b 100644 --- a/README.md +++ b/README.md @@ -334,10 +334,12 @@ AMAI has built in support to be able to write new strategies and profiles using ## 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. 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. + This API is still under improvement. -| AMAI API | cmd value | data value | Submit during initialization | Describe | +| **AMAI API** | **cmd value** | **data value** | **Submit during initialization** | **Describe** | | ----------------- | ------------------- | ------------------ | ------------------ | | **No Use Neutral Heros** | 8000 | 0 | should be | all AI No Use Neutral Heros | From dd153382fd6d443ca152708df1ca91a23d2d7f95 Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Sun, 17 Nov 2024 05:20:15 +0800 Subject: [PATCH 11/17] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20README.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 17b79138b..2859fb8df 100644 --- a/README.md +++ b/README.md @@ -333,14 +333,16 @@ AMAI has built in support to be able to write new strategies and profiles using ## 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. These APIs will quickly help you modify AMAI's system and this is real time intervention in the game. +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. These APIs will quickly help you modify AMAI's system and this is real time intervention in the game.You don't need to study AMAI code. You can use `AI - Send Command` in trigger. This API is still under improvement. | **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 From fdfe0ab281f1c351e5ac7812bede03e642b9990b Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Sun, 17 Nov 2024 05:21:25 +0800 Subject: [PATCH 12/17] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20README.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 2859fb8df..2c8f9a815 100644 --- a/README.md +++ b/README.md @@ -340,9 +340,7 @@ You can use `AI - Send Command` in trigger. This API is still under improvement. | **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 From 83f16f8da1ac505c71b3df6e103bcae10e94e40e Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Sun, 17 Nov 2024 05:23:28 +0800 Subject: [PATCH 13/17] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20README.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2c8f9a815..50b8e8cbe 100644 --- a/README.md +++ b/README.md @@ -333,7 +333,7 @@ AMAI has built in support to be able to write new strategies and profiles using ## 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. These APIs will quickly help you modify AMAI's system and this is real time intervention in the game.You don't need to study AMAI code. +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. From e86523861e253499dec2040ef8d8168b2ba66336 Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Sun, 17 Nov 2024 05:32:17 +0800 Subject: [PATCH 14/17] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20common.eai?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common.eai | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common.eai b/common.eai index d8b545b0e..e02973003 100644 --- a/common.eai +++ b/common.eai @@ -8068,7 +8068,7 @@ endfunction //============================================================================ function cmd_api takes integer cmd, integer data returns nothing - if cmd == 8000 then + if cmd == 8000 and data == 0 then set recalculate_heros = true endif endfunction From 391844d449e1a84e5fd1038ea4e9b7c5a5dd8d42 Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Sun, 17 Nov 2024 05:36:14 +0800 Subject: [PATCH 15/17] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20README.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 50b8e8cbe..325f7361c 100644 --- a/README.md +++ b/README.md @@ -335,9 +335,11 @@ AMAI has built in support to be able to write new strategies and profiles using 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. +You can use `AI - Send Command` in trigger. -This API is still under improvement. +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** | | ----------------- | ------------------- | ------------------ | ------------------ | ------------------ | From 3c1c7a9828c5542acf59e2a4b6c37e3d8a85988c Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Sun, 17 Nov 2024 05:36:53 +0800 Subject: [PATCH 16/17] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20README.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 325f7361c..7f8d8a56d 100644 --- a/README.md +++ b/README.md @@ -337,7 +337,8 @@ The official version will not use the shutdown function, but permissions will be You can use `AI - Send Command` in trigger. -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. +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. From 5cfc14f756612cc840e595d9639d170858333c9d Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Sun, 17 Nov 2024 05:42:51 +0800 Subject: [PATCH 17/17] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20README.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7f8d8a56d..b0765554b 100644 --- a/README.md +++ b/README.md @@ -335,7 +335,7 @@ AMAI has built in support to be able to write new strategies and profiles using 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. +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.