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

[Trigger] Very simple trigger does not seem to be working, I have no idea why.

Status
Not open for further replies.
Level 8
Joined
Dec 1, 2010
Messages
316
  • East indian company unit group add
    • Events
      • Unit - A unit enters (Entire map)
    • Conditions
      • (Unit-type of (Entering unit)) Equal to Free company mercinary
    • Actions
      • Unit Group - Add (Entering unit) to EastIndianMercs
      • Quest - Display to (All players) the Hint message: Unit added to group...

Second part:

  • East indian company
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in EastIndianMercs and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Mana of (Picked unit)) Equal to 10.00
            • Then - Actions
              • Unit - Replace (Picked unit) with a Free company mercinary (ranged) using The old unit's relative life and mana
            • Else - Actions
the goal is to replace the unit to a ranged version as it reaches 10 mana, however. when playing the unit is not transforming.

I know for a fact that it is added to it's unit group correctly since the text message fired like it should.

Does anyone have any idea what i am not seeing? thanks!
 
Level 14
Joined
Jul 3, 2015
Messages
61
On a quick look-through these triggers look fine.

Only problems I can think of is if the unit has more than 10 mana or if they somehow get removed from the unit group.

If it has more than 10 mana the condition should be changed to 'greater than or equal to' and then have the unit be removed from EastIndianMercs to prevent it from constantly being replaced.
 
Level 8
Joined
Dec 1, 2010
Messages
316
To both replies above, i've used greater than before and it didnt work either, the units are capped at max 10 mana, however for testing sake i set the trigger to trigger at 5 mana. For a while this worked. However when i added triggers related to keeping the selection (which have nothing to do with this trigger to begin with) it stopped working again. I'm kind of dumbfound to be honest.
 
Level 8
Joined
Dec 1, 2010
Messages
316
Edit: I have decided to ditch this method of solving the problem, Instead i shall be using triggers to manually increase the units range and change it's dmg. As this also prevents it from becomming unselectable. the problem was indeed in the fact that mana didnt register correctly, so im just going to set it a bit lower.
 
Level 14
Joined
Jul 3, 2015
Messages
61
I just copied the two triggers into a map in world editor. They work fine.

It has to be because you didn't remove the unit from the unit group after it gets replaced. If the selection trigger runs after the unit's replaced that could explain the problem there.
 
Level 8
Joined
Dec 1, 2010
Messages
316
I just copied the two triggers into a map in world editor. They work fine.

It has to be because you didn't remove the unit from the unit group after it gets replaced. If the selection trigger runs after the unit's replaced that could explain the problem there.
wouldnt it just keep changing into the same unit then? i've ran into this problem though, i can see that being the case. I also changed the units animation by using a tag and while at first it worked it stopped working when i moved the implementation to this loop.

Btw, Do you have any idea if the 'unit enters the map' event fires after a unit is replaced? Is it counted as a new unit or is it just seen as the same unit with a different unit it's based on?
 
Status
Not open for further replies.
Top