• 🏆 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!

A few problems/questions on AI

Level 3
Joined
Mar 18, 2023
Messages
28
Hello people of Hive. I barely starting to mess with AI's in my Hero Defense map and I'm still kinda new to learning the WE. As such, I need help with a few things. I'll provide the needed screenshot or video to help with my problems.

Problem 1: The AI get stuck when using a "Move - Instantly" trigger. Video Example
My Godzilla's tail swipe has a knockback on it. But when using it, the creeps will get stuck in place due to the "Move - Instantly" messing with their original order. A simple solution I thought of was to use a "Order - Attack/Move" after knocking them back while they're part of the knockback "Unit Group." However, wanted other people's ideas on how I should fix this. Me and some others want to have a bunch of crazy spells on this map (in terms of visuals), so need make sure if this will be a good fix in the long run.

Problem 2: The AI can't use the trigger spell I gave to them. Video Example
In this clip, the Mana Burn I have equipped to the boss is a simple trigger where it summons a spell casting dummy to cast volcano on the target's position. In the beginning, I show myself using the Mana Burn and that the trigger works. Next, I teleport Godzilla to mid to wait for the boss to come. At the same time, I check back at my controlled Boss to make sure the trigger ended so it doesn't overlap (which it shouldn't). Finally, I let the boss hit me with that same Mana Burn and the trigger doesn't set off. I also tested this in actual Wc3 in single player (not using the WE "test map" button") and still didn't work. I'll also have a pic of the Mana Burn trigger incase anyone wants to see it. Also, I did some research on AI's and found this Guide on what spells AIs uses. I'm probably going to be basing all the Bosses spells through this list as the "activators" for triggering their custom spells. Just like the first Problem, if anyone has an alternate or better solution, I'm all ears!

Problem/Question 3: Using a pre-set Region doesn't leak right?
I found this other site where people says it doesn't but just wanted to make sure. This is due to having a trigger running for the entirety of the match where it'll keep spawning waves of units. I'm in a constant hunt for leaks on my map so I want to make sure this thing is good to go. Screenshot of the trigger will be posted as well. Just like the last two, if anyone has any alternate or better ideas, feel free to post them! The intentions of this trigger is to have an endless wave of enemies always attacking to simulate a MOBA. Since this map is inspired from Dota 2: Horde, gotta make sure there's always waves of enemies trying to attack the towers.

If anyone can help me with these things, I'll appreciate it a lot! If more info is required about any of these, do ask and I'll provide the needed details. Thank you!
 

Attachments

  • Problem 2 Trig.png
    Problem 2 Trig.png
    27.5 KB · Views: 11
  • Region Question.png
    Region Question.png
    36.9 KB · Views: 11
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,564
I don't have time to read everything but quickly glancing at your Mana Burn trigger I see a few mistakes:

1) You're referencing a global variable after a Wait which is never recommended since it can change during the Wait. Instead, reference (Triggering unit) as it acts like a local variable which means it won't change to something else.

2) Remove the Location (Point) the moment you're done using it. Do NOT remove it after the Wait. Again, we want to remove all opportunities for these variables to change to something else during the gap in time.

3) (Center of Main HQ Region) leaks a Point. You need to use the same Set Point/Use Point/Remove Point method like you're doing with your Dummy unit.

4) I recommend setting a Unit variable for Dummy units and making sure that the last thing they do is cast the spell. Create Dummy -> Set Dummy variable -> Adjust abilities -> Add expiration timer -> Cast spell.

5) Make sure your Dummy unit is setup properly. It should be based on a Locust with the following changes: Model = None, Shadow = None, Attacks Enabled = None, Movement Type = None, Speed Base = 0.

6) The Do Nothing action does nothing. It's no different from a comment so adding it to the Else - Actions isn't necessary.

Looking at your ALL Basic Waves trigger, it's leaking A LOT of Points. Same as #3.
 
Last edited:
Level 3
Joined
Mar 18, 2023
Messages
28
I don't have time to read everything but quickly glancing at your Mana Burn trigger I see a few mistakes:

1) You're referencing a global variable after a Wait which is never recommended since it can change during the Wait. Instead, reference (Triggering unit) as it acts like a local variable which means it won't change to something else.

2) Remove the Location (Point) the moment you're done using it. Do NOT remove it after the Wait. Again, we want to remove all opportunities for these variables to change to something else during the gap in time.

3) (Center of Main HQ Region) leaks a Point. You need to use the same Set Point/Use Point/Remove Point method like you're doing with your Dummy unit.

4) I recommend setting a Unit variable for Dummy units and making sure that the last thing they do is cast the spell. Create Dummy -> Set Dummy variable -> Adjust abilities -> Add expiration timer -> Cast spell.

5) Make sure your Dummy unit is setup properly. It should be based on a Locust with the following changes: Model = None, Shadow = None, Attacks Enabled = None, Movement Type = None, Speed Base = 0.

6) The Do Nothing action does nothing. It's no different from a comment so adding it to the Else - Actions isn't necessary.

Looking at your ALL Basic Waves trigger, it's leaking A LOT of Points. Same as #3.
Thank you for responding on what you can anyways Uncle. I will look back on my triggers and follow your steps. 1 of the most goated person on Hive 100%.
 
Level 3
Joined
Mar 18, 2023
Messages
28
Godzilla vs Sargeras! Would really like to play your map sometime. Anyway,

Are you referring to an actual .ai script or more of just a cpu player being controlled by triggers?
The map has Godzilla and a bunch of characters from other works of fiction. I'd be down to adding more Kaiju if there were models available haha (I wanted to add Ghidorah as a boss :sad:). In terms of the AI, when they cast the simple-test spell I made, it doesn't trigger. In the video example, I show myself casting that same spell (Mana Burn is the activator) and it worked for me. So, it's not the trigger's fault. Yet, when the AI cast's that same custom Mana Burn, the trigger doesn't work. Me and the others wanted to make advance boss mechanics similar to that of an MMO/RPG/4PlayerCouch-Coop Bosses. But first, need to figure out why such a simple trigger didn't work for the AI. We're still somewhat new to the WE but are now familiar with most functions. AI is completely new since we just barely started tinkering with it. Any help or advice would be appreciated!
 
Top