• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Get your art tools and paintbrushes ready and enter Hive's 34th Texturing Contest: Void! Click here to enter!

How to activate AI on inactive slots?

Level 4
Joined
Apr 16, 2025
Messages
50
Hello, dear editors, it is hardly possible to find a solution to my problem, but I will try.

How to activate AI for colored players, for whom I did not set the "computer" role in the "player property"?

Neutral hostiles at least use spells, and these oafs do not even use autoheal.

I need this so that I can create a map with a lot of units that would not lag during the attack on the castle. At the same time, I do not want the map to look like this in the lobby: 1/24 players.

I tried this, it didn't work. Is there another way?
JASS:
function Trig_TEST_Actions takes nothing returns nothing
    call StartMeleeAI( GetEnumPlayer(), "map.ai" )
endfunction

//===========================================================================
function InitTrig_TEST takes nothing returns nothing
    set gg_trg_TEST = CreateTrigger(  )
    call TriggerAddAction( gg_trg_TEST, function Trig_TEST_Actions )
endfunction
 
Last edited:

Uncle

Warcraft Moderator
Level 74
Joined
Aug 10, 2018
Messages
7,948
Well, that code you posted doesn't do anything. There's no Event, so Trig_TEST_Actions never runs.
JASS:
function Trig_TEST_Actions takes nothing returns nothing
    call StartMeleeAI( GetEnumPlayer(), "map.ai" )
endfunction

function InitTrig_TEST takes nothing returns nothing
    call ForGroup( bj_FORCE_ALL_PLAYERS, function Trig_TEST_Actions )
endfunction
But maybe you left that part out. If you're working in GUI (standard trigger editor) then just post your triggers in their normal form, there's no need to convert them to code.

Anyway, I don't think Non-Computers can run AI, so you probably have to accept the fact that your Lobby will look weird. Alternatively, you can use a custom system for managing the spellcasting behavior of your units. It's not that difficult to get something decent going, hell, you could even make better AI than what Blizzard provides. There's some existing systems on Hive, I even have some examples lying around somewhere.

Edit: Attached an example map I made years ago. Not sure if it has any major issues, it seems fine.
 

Attachments

  • Basic Caster AI 1.w3m
    31.8 KB · Views: 1
Last edited:
Level 4
Joined
Apr 16, 2025
Messages
50
Cool system, will come in handy someday. Especially for bosses. Thanks for that!

But I have a slightly different problem. My castle will be attacked by hundreds of units of different types with their own abilities. The standard AI copes well with the task of autocasting these abilities, like curse, slowdown, etc. But it stops casting them if you set this unit to the color of a computer that is not added through "player properties".

I'm trying to fix this without adding this computer through "player properties", otherwise when creating a lobby it will say 1/24, and this is ugly and will scare many people away. 1/5 is a different matter, isn't it?))

As for my code - I just wanted to show the gist of what I used. It didn't work =(



Overall, you answered my question. Thank you very much!
 
Top