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

Why this trigger not working in different map?

Status
Not open for further replies.
Level 17
Joined
Jun 2, 2009
Messages
1,137
This trigger not working in my map and since 3 days we haven't found the issue. Do you have any idea?
When we learn Q yetenegi 2 times and using R yetenegi (transforms into another unit) it is not changing it's level
Example: When you level up your Q yetenegi, it also counts for Lightning shield and Forked Lightning.
It works well but not works within my map.

I can provide any extra information you need.

  • Q W E R Yetenegi Learn
    • Events
      • Unit - A unit Learns a skill
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Learned Hero Skill) Equal to Q Yetenegi
        • Then - Actions
          • If ((Unit-type of (Learning Hero)) Equal to Shaman (Adam olmayan)) then do (Unit - Increase level of Lightning Shield [|cffffcc00Q|r] for (Learning Hero)) else do (Do nothing)
          • If ((Unit-type of (Learning Hero)) Equal to Shaman (Adam olan)) then do (Unit - Increase level of Forked Lightning [|cffffcc00Q|r] for (Learning Hero)) else do (Do nothing)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Learned Hero Skill) Equal to W Yetenegi
            • Then - Actions
              • If ((Unit-type of (Learning Hero)) Equal to Shaman (Adam olmayan)) then do (Unit - Increase level of Dash [|cffffcc00W|r] for (Learning Hero)) else do (Do nothing)
              • If ((Unit-type of (Learning Hero)) Equal to Shaman (Adam olan)) then do (Unit - Increase level of Totem [|cffffcc00W|r] for (Learning Hero)) else do (Do nothing)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Learned Hero Skill) Equal to E Yetenegi
                • Then - Actions
                  • If ((Unit-type of (Learning Hero)) Equal to Shaman (Adam olmayan)) then do (Unit - Increase level of Wolf Adept [|cffffcc00E|r] for (Learning Hero)) else do (Do nothing)
                  • If ((Unit-type of (Learning Hero)) Equal to Shaman (Adam olan)) then do (Unit - Increase level of Shaman Adept [|cffffcc00E|r] for (Learning Hero)) else do (Do nothing)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Learned Hero Skill) Equal to R Yetenegi
                    • Then - Actions
                      • If ((Unit-type of (Learning Hero)) Equal to Shaman (Adam olmayan)) then do (Unit - Increase level of Transform [|cffffcc00R|r] for (Learning Hero)) else do (Do nothing)
                      • If ((Unit-type of (Learning Hero)) Equal to Shaman (Adam olan)) then do (Unit - Increase level of Transform [|cffffcc00R|r] for (Learning Hero)) else do (Do nothing)
                    • Else - Actions
 
Last edited:
Level 39
Joined
Feb 27, 2007
Messages
5,011
Every time you say something like "not working" and never give details. What isn't occurring that you want to occur? How far does the trigger get? What does run? What have you checked or tested to confirm is or is not doing what you expect it to do? This trigger is very simple, you should be able to debug it yourself by checking values of variables or things like Learning Hero throughout the tirgger.
 
Level 39
Joined
Feb 27, 2007
Messages
5,011
The problem is likely that the base unit-type (before transformation) does not have those abilities, right? They only exist on the transformed unit-type, so setting their level before the unit is transformed does nothing (because the abilities don't exist on it yet). If this is what's happening, you have two options:
  1. Detect when the unit transforms and set the levels of these abilities correctly then after it has acquired them.
  2. Give these abilities to the base unit as well, but make them disabled by default. When the unit transforms, enable the abilities until it dies or un-transforms. This will allow you to set the level whenever without problem, but requires you to know/detect when it untransforms to re-disable the abilities.
Also consider what happens if the unit levels up while transformed. Does it get a skill point? If so, leveling up one of these transformed abilities should also level up its base ability, right?
 
Level 39
Joined
Feb 27, 2007
Messages
5,011
If you copied an ability that used a rawcode that was already in use in your map, then the unit will not have the right abilities when it's pasted. If you copied the unit before the abilities then the unit will not necessarily have the correct abilities.

Always copy in this order: Imported files > Buffs > Abilities > Units > Upgrades > Triggers


Edit: Actually the order isn't necessarily always that. If you were copying a summon spell you might copy units before abilities so that the correct unit is summoned. Use your best judgement about what depends on/refers to what.
 
Last edited:
Level 17
Joined
Jun 2, 2009
Messages
1,137
If you copied an ability that used a rawcode that was already in use in your map, then the unit will not have the right abilities when it's pasted. If you copied the unit before the abilities then the unit will not necessarily have the correct abilities.

Always copy in this order: Imported files > Buffs > Abilities > Units > Upgrades > Triggers
I mean everything is "exactly" the same except of Base ID.
If i will copy and paste both of the screenshots of both maps, you will not see difference. It is not my first time to copy something within my map.
But somehow it is not increasing ability levels after transform ability within my map.

  • Transform Copy
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Transform [|cffffcc00R|r]
    • Actions
      • Unit - Create 1 DUMMY [JFA] for (Owner of (Casting unit)) at (Position of (Casting unit)) facing Default building facing degrees
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • Unit - Add dummy_Bloodlust to (Last created unit)
      • Unit - Set level of dummy_Bloodlust for (Last created unit) to (Level of Transform [|cffffcc00R|r] for Hero_Shaman)
      • Unit - Order (Last created unit) to Orc Shaman - Bloodlust Hero_Shaman
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Casting unit)) Equal to Shaman (Adam olan)
        • Then - Actions
          • Set Hero_Shaman = (Casting unit)
          • Unit - Remove Forked Lightning [|cffffcc00Q|r] from Hero_Shaman
          • Unit - Remove Shaman Adept [|cffffcc00E|r] from Hero_Shaman
          • Unit - Remove Totem [|cffffcc00W|r] from Hero_Shaman
          • Unit - Add Lightning Shield [|cffffcc00Q|r] to Hero_Shaman
          • Unit - Set level of Lightning Shield [|cffffcc00Q|r] for Hero_Shaman to ((Level of Q Yetenegi for Hero_Shaman) + 1)
          • Unit - Set level of Lightning Shield [|cffffcc00Q|r] for Hero_Shaman to 3
          • Unit - Add Wolf Adept [|cffffcc00E|r] to Hero_Shaman
          • Unit - Set level of Wolf Adept [|cffffcc00E|r] for Hero_Shaman to ((Level of E Yetenegi for Hero_Shaman) + 1)
          • Unit - Add Dash [|cffffcc00W|r] to Hero_Shaman
          • Unit - Set level of Dash [|cffffcc00W|r] for Hero_Shaman to ((Level of W Yetenegi for Hero_Shaman) + 1)
        • Else - Actions
None of these work. When i put 3 points on Q yetenegi, then transform, lightning shield ability still stays at level 1

  • Unit - Set level of Lightning Shield [|cffffcc00Q|r] for Hero_Shaman to ((Level of Q Yetenegi for Hero_Shaman) + 1)
  • Unit - Set level of Lightning Shield [|cffffcc00Q|r] for Hero_Shaman to 3
Additional note. When we select heroes from tavern, i am already setting Hero_Shaman in here

  • HeroSet
    • Events
      • Unit - A unit enters (Entire map)
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Unit-type of (Triggering unit)) Equal to Shaman (Adam olan)
              • (Unit-type of (Triggering unit)) Equal to Shaman (Adam olmayan)
        • Then - Actions
          • Set Hero_Shaman = (Entering unit)
          • Trigger - Turn off (This trigger)
        • Else - Actions
 
Last edited:
Level 39
Joined
Feb 27, 2007
Messages
5,011
It helps when I translate the Turkish to understand why things have the names they have. You should put some debug messages in the Transform Copy trigger to see what's happening. Check that the shaman variable and things like "casting unit" are correct at various points in the trigger. You can do this for units easily by doing something to that unit with a trigger (like making it bigger or smaller or colored or flying or giving it an ability or making it explode or changing which player owns it, etc.).

Anyway this brings me to my next guess that you can check: I think the dummy unit casting bloodlust on the transforming shaman is overwriting Casting Unit. I think it doesn't happen in the map you're copying/importing from because it doesn't have a properly configured dummy unit so it doesn't cast instantly, and that in your map it is configured properly so it does an instantaneous cast and overwrites the "Casting Unit" global variable. That particular event response is essentially a global variable that gets overwritten; you can see so here: Event Response Myths.

If that's the case you can fix this by using Triggering Unit instead, since that functions like a local variable. Or move the bloodlust cast until after the ability replacement (I presume there are more If-Then-Else blocks in the trigger that you didn't post, yes?).

If that's not it then maybe it's the ability itself. The Transform ability is actually a transformation ability (like Demon Hunter or Tinker ultimates), yes? If so please tell me which ability it is based on. Perhaps the event "starts the effect" is triggering before the transformation is complete in some way so the unit being referenced is in transformation limbo.

One final thing: you can use a custom script line to make abilities added with triggers persist across transformations when a unit transforms. This action is not available in GUI, so the easiest way to interact with it is to create some variables, assign them in GUI, and then always use the same custom script (with your variable names properly in it).
  • Set YourUnit = (Triggering Unit)
  • Set YourAbility = (Ability being cast)
  • Custom script : call UnitMakeAbilityPermanent(udg_YourUnit, true, udg_YourAbility)
This may be helpful to you if neither of these things resolves the issue.
 
Level 17
Joined
Jun 2, 2009
Messages
1,137
First of all, let me share the original map with you. This hero made for my map from one of my friends. It is working without any issue when you test it on yourself. And i am already using this system within my map for heroes that can transform.

  • Wolf Form Settings
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: set udg_WolfForm_UnitType[1] = 'H02V'
      • Custom script: set udg_WolfForm_UnitType[2] = 'H03H'
      • Custom script: set udg_WolfForm_UnitType[3] = 'H034'
      • Custom script: set udg_WolfForm_UnitType[4] = 'H035'
      • Custom script: set udg_WolfForm_UnitType[5] = 'H044'
This is the previous version of my hero and it's forms. First one is our main hero Shaman. I have created this because players are choosing starting ability and it removes when they transform.

  • Wolf Form Ability
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Wolf Form
    • Actions
      • Set Level = (Level of StartingAbility[(Player number of (Owner of (Triggering unit)))] for (Triggering unit))
      • Unit - Add StartingAbility[(Player number of (Owner of (Triggering unit)))] to (Triggering unit)
Update: We gave up. This topic can be closed. I have decided to not to add this character to my game.
 

Attachments

  • ShamanRework_with_ID.w3x
    30.6 KB · Views: 3
Last edited:
Level 21
Joined
Dec 4, 2007
Messages
1,478
I'm using something similar:
  • Aura Sync
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Paladin of Dev (Auras of Dev)
    • Actions
      • Unit - Set level of Paladin of Dev (Aura of Devotion) for (Triggering unit) to (Level of Paladin of Dev (Auras of Dev) for (Triggering unit))
      • Unit - Set level of Paladin of Dev (Aura of Healing) for (Triggering unit) to (Level of Paladin of Dev (Auras of Dev) for (Triggering unit))
Said paladin is not using transformations, so i can't comment on that right now (Pyrogasm mentioned the most important parts, like ability permanence), but the trigger definitely works.
So at the least, your trigger in the first post should work, if you use triggering unit.
After checking that, go step by step to the next problem.

Or call for Uncle :gg:
 
Level 17
Joined
Jun 2, 2009
Messages
1,137
I'm using something similar:
  • Aura Sync
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Paladin of Dev (Auras of Dev)
    • Actions
      • Unit - Set level of Paladin of Dev (Aura of Devotion) for (Triggering unit) to (Level of Paladin of Dev (Auras of Dev) for (Triggering unit))
      • Unit - Set level of Paladin of Dev (Aura of Healing) for (Triggering unit) to (Level of Paladin of Dev (Auras of Dev) for (Triggering unit))
Said paladin is not using transformations, so i can't comment on that right now (Pyrogasm mentioned the most important parts, like ability permanence), but the trigger definitely works.
So at the least, your trigger in the first post should work, if you use triggering unit.
After checking that, go step by step to the next problem.

Or call for Uncle :gg:
Uncle is our superhero but i give up. I will not add this hero into my map. No more we don't want to see this trigger. Mystery is not solved and we gave up.
Thank you for your assistance by the way.
 
Level 39
Joined
Feb 27, 2007
Messages
5,011
IMO that’s a terrible attitude to have about problem solving in your map. The unexpected/unintended behavior are resolvable, understandable, and fixable but it requires delving into the triggers and checking almost everything at every stage of the process to make sure that what you think will happen/has happened actually will/has.

Only in extremely rare cases is something like this truly an unresolvable bug in the game code. Usually it’s just cleverly hidden operator error (the person writing the code/trigger).
 
Last edited:
Level 17
Joined
Jun 2, 2009
Messages
1,137
IMO that’s a terrible attitude to have about problem solving in your map. The unexpected/unintended behavior are resolvable, understandable, and fixable but it requires delving into the triggers and checking almost everything at every stage of the process to make sure that what you think will happen/has happened actually will/has.

Only in extremely rare cases is something like this truly a unresolvable bug in the game code. Usually it’s just cleverly hidden operator error (the person writing the code/trigger).
The person who created this hero, my 2 friends and myself tired of seeing this. We decided to "we have a lot of heroes, let's just pass this one" and i have accepted their request because we have a several heroes waiting for added to my map and i have accepted their request. Since 4 days we are talking about the same thing over and over again and honestly we accepted we will never solve this. Because this hero works on every map that created by my friends and my other maps but not works on my main map. Sometimes i can give up in my lifetime. I don't have to solve every problem and this problem is one of these because it is priority is not vital. We will continue to add other heroes into my map. Because we get tired to see this since 4 days and we gave up and still several heroes waiting for added.

Topic can be deleted or closed.
 
Level 17
Joined
Jun 2, 2009
Messages
1,137
Okay, it's reasonable to distribute you effort elsewhere if there are many other things you could be doing instead. I understand and am not trying to insult you, just to give my opinion.
I know no problem. If it was a vital, i would probably not give up. It is just one of my heroes.
But this is vital. I could use some help at here.

 
Status
Not open for further replies.
Top