• 🏆 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] 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
I tried the test and it shows or add the ability to computer player dummy unit but the dummy unit does not follow the order :((. The storm bolt stun ability actually works in computer dummy unit follows that order.
 
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 33
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