• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

AI possibly blocks spell casts

Status
Not open for further replies.
Level 1
Joined
Nov 1, 2019
Messages
1
Hey guys,


I'm currently working on a simplistic meele-style map.
One of the things i'm trying to implement right now is a system that buffs the units of the player with the most kills, making them even more dangerous. Determine the player whos units will be buffed does work and the index of that player is saved in FIRE_CURRENT_PLAYER_INDEX. All units on the map are saved in an array of unitgroups, for example workers are saved in worker_array, meaning that worker_array[FIRE_CURRENT_PLAYER_INDEX] will contain all workers for the "best" player. The ability i use to buff the units is based on the Bloodlust ability.

For buffing the units of a given player i use:

  • Unitgroup - Pick every unit in worker_Array[FIRE_CURRENT_PLAYER_INDEX] and do (Actions)
    • Loop - Actions
      • Set to_Buff = (Picked unit)
      • Set no_time_loc = (Position of to_Buff)
      • Unit - Create 1 DUMMY for (Player(FIRE_CURRENT_PLAYER_INDEX)) at no_time_loc facing 0 degrees
      • Custom script: call RemoveLocation(udg_no_time_loc)
      • Set no_time_dummy = (Last created unit)
      • Unit - Add ON_FIRE to no_time_dummy
      • Unit - Order no_time_dummy to Orc-Shaman - 'Bloodlust' To_Buff
      • Unit - Add a 2.00 second Standard expiration timer to no_time_dummy
On death, the dummy will be removed by a separate trigger. I also know, that to_Buff and no_time_dummy are not necessary in that context, both variables were used to debug.

My problem now is, that AI controlled players are not getting buffed by bloodlust, while it does work if the "best" player is controlled by a non-CPU player, meaning that if i am the best player all my units will receive the buff while CPU will not receive the buff if they are the best player.

Things i was able to already rule out:
  • worker_array does contain the right units for the right players as i am using them for other actions.
  • FIRE_CURRENT_PLAYER_INDEX is the correct index of the best player.
  • All dummies are created, but they are just chilling for computer controlled players.

After looking for a while i found this thread, stating that it might be possible for AI to block casting certain abilites. Could this be the case for this trigger? If so - what can i do to stop this?

Thanks for reading
 
Level 39
Joined
Feb 27, 2007
Messages
5,036
Make the ability able to target hostiles and friendly units and instead create the dummies for Neutral Hostile/Neutral Passive/Neutral Extra/Any non-CPU player (whichever of these works best). They probably won't be prevented from casting that way.
 
Status
Not open for further replies.
Top