• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[AI] Basic Ships AI support

Status
Not open for further replies.
Level 25
Joined
Feb 2, 2006
Messages
1,683
Hi,
my map has lots of water areas and I would like to give the AI players some attacking ships. I want players who have bases next to water sometimes be attacked by other player armadas even if the hero and the main army is not part of it. Ideally, I could sync it with the AI's actual target if the target is reachable via water.

There is no native support in Warcraft III from what I have found so far:
The AI is not able to use transport ships which is not an issue in my map since there are Zeppelins to reach other areas but fighting ships would still be nice.
I could create some shipyards via triggers if the AI is not able to build them at the correct location where nothing is blocked and I could try to exclude trained ships with:

JASS:
native RemoveGuardPosition  takes unit hUnit                                returns nothing

since it seems that AI scripts only have one single attack group at a time and some defending units.
Hence, I need to exclude the ships and somehow let them patrol on the map to some islands as soon as they are a group of n, so when they see another ship/building, they will start fighting.

I want to store all areas which are reachable from the water and as soon as the AI chooses a base which is reachable from the water in its AI script to be attacked, I trigger the corresponding group of ships to go there instead of simply defending/patroling on the sea.

This would require some custom triggers.

Is there any easier/better way to achieve this/any existing system and do you think it might work this way?

Btw. what is the effect of the AI native:
JASS:
native SetAmphibious        takes nothing                               returns nothing
for?
Does it mean they can attack through water?
 
Level 13
Joined
Jun 23, 2009
Messages
297
Most of what you're describing has to be done through the map's code unfortunately, .ai files are extremely limited in what they can do. Kam's Beyond the Throne back in the day (I mean, like a decade ago, when I first checked it out/provided some help with its .ai files) had a bunch of custom scripts for handling naval combat, I don't know if the current version has something like that still.
Btw. what is the effect of the AI native:
native SetAmphibious takes nothing returns nothing
SetAmphibious() is used in the TFT Campaigns for Naga AIs, as a command it basically tells the AI that it has units that can go through water as far as I can tell, I suspect it is just about units that can travel both through water and land as the AI never uses ships themselves iirc.
 
Last edited:
Status
Not open for further replies.
Top