Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
16 changes: 12 additions & 4 deletions common.eai
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down