HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Stupid AI...

03-13-2007, 07:45 PM#1
Dil999
Is there any was I can remove the computer AI, so it does nothing but attack and move?
The problem is the units still have to have useable abilities, since they will be owned by a computer but 2 players will have control over them.
Right now the computers make my units cast abilities (such as feral spirit and slow), and i would like that to be only useable by the players.

Also, i'm using a trigger to create 4 units and make them patrol somewhere. Problem is if they stop halfway there to battle, they go back to the base sometimes instead of continuing.. Is there a way I can fix this (Units must not patrol if they were ordered to do something else by a player, thats the hard part)
03-18-2007, 06:57 PM#2
botanic
as for the returning goto gameplay constants and change the guard posistions and such
03-18-2007, 10:10 PM#3
Thunder_Eye
For the first one you could replace all spells with dummy channel ones. Detect when a player casts it, add appropriate spell and order unit to cast it and then remove it.
03-18-2007, 11:20 PM#4
moyack
There is one option...
  • open in notepad a new file and write this text:
    Collapse JASS:
    function main takes nothing returns nothing
        call InitAI()
        call SleepForever()
    endfunction
  • Then save this file as dummy.ai
  • Import this file to your map with the import manager.
  • In the map initialization trigger, add this action:
    Trigger:
    AI - Start melee AI script for Player 1 (Red): war3mapImported\dummy.ai
    (usually that would be the path)
  • Do this script for all the computer player you will need, changing the player.
  • Save and test.

With this configuration, the units controlled with this AI will be fully controlable via triggers (or by the user using full shared control) and at the same time they will react and cast spells automatically.
03-19-2007, 04:12 AM#5
Dil999
Thats the problem, they Shouldnt be casting spells, just attacking >.<.
03-19-2007, 03:51 PM#6
moyack
Then do this test (I'm not sure if it will work). Do this AI script intead.

Collapse JASS:
function main takes nothing returns nothing
    call SleepForever()
endfunction

And check how the AI players behave. In theory, the AI is not loaded with this option.
03-19-2007, 08:52 PM#7
Szythe
Collapse JASS:
call SetPlayerAbilityAvailable(Player(Computer Number), 'A000', false)

Do one for each ability which you don't want the computer to be able to use. Granted, I have not tested this myself, but I see no reason that it would not work.
03-20-2007, 01:53 AM#8
Dil999
Looks reliable scyze, but one question (I cant write JASS for my life)
Do i replace (Computer Number) with the player number?

Edit: All guard positions are maximum distance and the time to return to guard is as high as it can go.. units still go back. Anyone know why?
03-20-2007, 02:08 AM#9
Pyrogasm
Dil999, you can use the GUI function instead:
Trigger:
Player - Disable YOUR ABILITY for (YOUR PLAYER)
03-20-2007, 02:13 AM#10
Dil999
Wow.. why did I never see that extremely convenient GUI function??
Edit: Satan.. that little trickster...
03-20-2007, 05:51 AM#11
Zycat
Just use the trigger action AI - Ignore All Unit Guard Positions
03-20-2007, 07:54 PM#12
Dil999
I really need to look around the GUI functions before posting... dont I?