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

Computer Player

Status
Not open for further replies.

Deleted member 242951

D

Deleted member 242951

Do you mind posting the entire trigger?
This is too little to go off of, I'm afraid.
 
Last edited by a moderator:

Deleted member 242951

D

Deleted member 242951

I suggested revealing the trigger because there are certain functions that do not respond to some conditions.

One example is the "Unit is attacked" event.
In the condition, you cannot choose to go for "Unit - Damaged unit " comparison or " Real - Damage recieved " comparison.

It's because they are only meant to respond to "A unit receives damage event" and will not be considered otherwise.

There are many similar things in the editor especially when it comes to players.

In short, it's impossible to zero in on your problem unless you reveal the entire trigger.
Is the map made in JNGP, by any chance?
 
Last edited by a moderator:
Level 11
Joined
Jan 23, 2015
Messages
788
Here's the trigger, it's not a silly error (at least that's what I think)..
  • AI Coin Chase
    • Events
      • Time - Every 0.40 seconds of game time
    • Conditions
    • Actions
      • Set AICoinChaseAllBuilders = (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Builder))
      • Game - Display to (All players) the text: trigger works
      • Unit Group - Pick every unit in AICoinChaseAllBuilders and do (Actions)
        • Loop - Actions
          • Game - Display to (All players) the text: trigger picks units
          • Set CoinChaseIndex = (Player number of (Owner of (Picked unit)))
          • Set AICoinChaseBPos[CoinChaseIndex] = (Position of (Picked unit))
          • Item - Pick every item in (Region centered at AICoinChaseBPos[CoinChaseIndex] with size (1000.00, 1000.00)) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Owner of (Picked unit)) controller) Equal to Computer
                  • (Item-type of (Picked item)) Equal to Gold Coins
                  • AICoinChase[CoinChaseIndex] Equal to False
                  • AIisBusy[CoinChaseIndex] Equal to False
                • Then - Actions
                  • Game - Display to (All players) the text: conditions met
                  • Set CoinItem = (Picked item)
                  • Set AICoinChase[CoinChaseIndex] = True
                  • Set AIisBusy[CoinChaseIndex] = True
                  • Set AICanChop[CoinChaseIndex] = False
                  • Unit - Order (Picked unit) to Right-Click CoinItem
                • Else - Actions
      • Custom script: call RemoveLocation(udg_AICoinChaseBPos[(udg_CoinChaseIndex)])
      • Custom script: call DestroyGroup(udg_AICoinChaseAllBuilders)
  • [/hidden]
You will probably fail to understand everything in this trigger of mine.. I've tested every condition as a separate if/then/else check, and only the player controller condition failed..


Edit: Okay, I've found the source of the problem, it was another periodic trigger that was setting the unit group to a different one, instead of setting an other unit group similar to this one (AllBuilders).. The AI is a complicated system, need to build triggers carefully to save time debugging them.. -_-

Thanks guys!!
 
Last edited:

Deleted member 242951

D

Deleted member 242951

Knew it was something silly :D
Glad to know your problem was fixed!
 
Last edited by a moderator:
Status
Not open for further replies.
Top