• 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.

[AI] AI Computer Players can't execute a spell properly with dummy

Status
Not open for further replies.
Level 20
Joined
Aug 13, 2013
Messages
1,696
Hello hiveworkshop =)),

I'm finishing a map ( Heroes' Arena [ AI ] ) ( it is like DotA still it is different ) but there's a weird problem with computer players when casting a dummy triggered spell. Example, the spell "Waning Rift" that damages units nearby and silencing them in 3 seconds in 300 radius around the caster. So I decided to trigger this spell and create a dummy unit that will cast silence, I've tried the spell working properly and my dummy unit silenced them, the computer player AI tried the spell but their dummy unit DOES NOT cast the silence while my dummy unit cast it properly. How to fix this stuff? I've checked my trigger code and there's nothing wrong with it. So how to fix this?
 
Level 20
Joined
Aug 13, 2013
Messages
1,696
Anyway I think this thread is solved, I've fixed the problem in a weird solution, I've just changed the ownership of the dummy to GetOwningPlayer( udg_WR_Caster ) instead of GetTriggerPlayer( ). Now I know that using GetTriggerPlayer can cause a problem in this case so I'll better stick to GetOwningPlayer() function but I'm still not sure about this if GetTriggerPlayer( ) has a problem so better test it.
 

Kazeon

Hosted Project: EC
Level 34
Joined
Oct 12, 2011
Messages
3,449
Set the AI player slot to None at Player Properties.
h1.jpg
If you set it to computer, there will be a simple AI script running behind which control all of it's units, no exception for dummy units too, which prevent external scripts to control them, mostly.

Or if you want the slot to be selectable by player, then you can use some tricks. Like this one:
JASS:
            if GetLocalPlayer() == AI then
                call EnableUserControl(false)
            endif

Hope it helps.
 
Status
Not open for further replies.
Top