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

[General] HELP with trigger

Status
Not open for further replies.
Level 8
Joined
Feb 20, 2020
Messages
200
Hello,
Guys could someone please help me?
I have a trigger for "evolving a monster"
it's working fine, the monster is evolving and stuff.
But i want the effect to last longer... and some monsters doesnt have the origin point to attack the effect.
So what I need is in the second trigger :
  • monster pause and get invulnerable
  • show the first Effect for 3seconds
  • change the monster
  • pause the new monster and get it invulnerable
  • show the second effect for 3 seconds
  • unpause and turn the new monster vulnerable
  • I need that for multiplay and for multiple units for the same player
so basically 3 monsters of the same player can evolve at the same time
or 3 players can evolve at the same time...
and every monster (with or without the origin point) can have the effect.

What should I add to the triggers bellow to get that??

  • Evolution Gain Level Copy
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • (Owner of (Triggering unit)) Not equal to Player 13 (Maroon)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Leveling Hero) is dead) Equal to True
        • Then - Actions
          • Set VariableSet EvoDead = True
        • Else - Actions
          • Set VariableSet EvoDead = False
      • Set VariableSet Evolve_Index = 0
      • -------- --------
      • For each (Integer EvolveLoop) from 1 to Evolution_Total, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Leveling Hero)) Equal to Evoluton_NormalForm[EvolveLoop]
              • (Hero level of (Leveling Hero)) Greater than or equal to Evoluton_Level[EvolveLoop]
            • Then - Actions
              • Set VariableSet Evolve_Index = EvolveLoop
            • Else - Actions
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Evolve_Index Not equal to 0
        • Then - Actions
          • Set VariableSet MonsterEvolving = (Leveling Hero)
          • Set VariableSet PN = (Player number of (Owner of (Leveling Hero)))
          • Trigger - Run Evolve Run <gen> (ignoring conditions)
        • Else - Actions

  • Evolve Run
    • Events
    • Conditions
    • Actions
      • Set VariableSet Camera = (Current camera)
      • Set VariableSet TempPlayer = (Owner of MonsterEvolving)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • EvoDead Equal to True
        • Then - Actions
          • Set VariableSet TempPoint = (Random point in Player_Region[(Player number of TempPlayer)])
        • Else - Actions
          • Set VariableSet TempPoint = (Position of MonsterEvolving)
      • Cinematic - Send transmission to (Player group(TempPlayer)) from MonsterEvolving named (Proper name of MonsterEvolving): Play No sound and display is digievolving int.... Modify duration: Set to 2.00 seconds and Don't wait
      • Unit - Make MonsterEvolving Invulnerable
      • Unit - Pause MonsterEvolving
      • Special Effect - Create a special effect attached to the origin of MonsterEvolving using Digievolution1.mdx
      • Set VariableSet Delayed_Duration = 4.00
      • Trigger - Run Delayed Destroy Effect <gen> (ignoring conditions)
      • Unit - Hide MonsterEvolving
      • -------- --------
      • Unit - Create 1 Evoluton_EvolveForm[Evolve_Index] for TempPlayer at TempPoint facing Default building facing degrees
      • Set VariableSet NewEvolution = (Last created unit)
      • Unit - Pause NewEvolution
      • Special Effect - Create a special effect attached to the origin of NewEvolution using Digievolution2.mdx
      • Set VariableSet Delayed_Duration = 3.00
      • Trigger - Run Delayed Destroy Effect <gen> (ignoring conditions)
      • Cinematic - Send transmission to (Player group(TempPlayer)) from NewEvolution named (Proper name of NewEvolution): Play No sound and display (Proper name of NewEvolution). Modify duration: Set to 2.00 seconds and Don't wait
      • Unit - Move NewEvolution instantly to TempPoint
      • Unit - Unpause NewEvolution
      • Custom script: call RemoveLocation (udg_TempPoint)
      • -------- --------
      • Selection - Add NewEvolution to selection for (Owner of MonsterEvolving)
      • -------- --------
      • Hero - Give (Item carried by MonsterEvolving in slot 1) to NewEvolution
      • -------- --------
      • -------- --------
      • Unit - Change color of NewEvolution to (Color of Evolution_Color[Evolve_Index])
      • -------- --------
      • Set VariableSet Evolve_Experience = (Hero experience of MonsterEvolving)
      • -------- --------
      • -------- --------
      • -------- Replace old Monster with New Monster in Monster List --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PN Equal to 1
        • Then - Actions
          • For each (Integer A) from 1 to 6, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • PlayerDigimons_1[IndexPlayer[PNEvo]] Equal to MonsterEvolving
                • Then - Actions
                  • Unit Group - Remove MonsterEvolving from PlayerHeroes[IndexPlayer[(Integer A)]].
                  • Unit Group - Add NewEvolution to PlayerHeroes[IndexPlayer[(Integer A)]]
                  • Unit Group - Add NewEvolution to PlayerHeroes[PNEvo]
                  • Unit Group - Remove MonsterEvolving from PlayerHeroes[PNEvo].
                • Else - Actions
        • Else - Actions
      • -------- --------
      • Unit - Unhide MonsterEvolving
      • Unit - Remove MonsterEvolving from the game
      • -------- --------
      • -------- Add the experience last just in case it causes it to Evolve again (running the trigger again) --------
      • Hero - Set NewEvolution experience to Evolve_Experience, Hide level-up graphics

  • Delayed Destroy Effect
    • Events
    • Conditions
    • Actions
      • Custom script: local effect udg_Delayed_Sfx = GetLastCreatedEffectBJ()
      • Wait Delayed_Duration seconds
      • Special Effect - Destroy Delayed_Sfx
      • Custom script: set udg_Delayed_Sfx = null
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,535
This looks weird:
  • PlayerHeroes[IndexPlayer[(Integer A)]]
You shouldn't ever need an IndexPlayer variable when the Convert Player to Index function exists. But that's besides the point, you can just reference PlayerHeroes[PNEvo] here. You also seem to be referencing both PN and PNEvo. Use one or the other, I don't think PN is even Set anywhere.

For the Special Effect, just create it at the unit's Position and Set the Height to your desired value.
 
Last edited:
Level 8
Joined
Feb 20, 2020
Messages
200
Well it's working just fine, the part of PN and PNEvo is because there is other triggers that use PN so I dont want them to get mixed...
The thing I want is to implement some kind of countdown for the effect.
start effect 1 - stop unit, turn it invulnerable - wait for 2 seconds.
remove unit 1 - create unit 2 - start effect 2 over unit 2, stop unit, turn it invulnerable - wait more 2 seconds.
turn it vulnerable and resume the unit.
I need that for multiplayer... :X
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,535
Well it's working just fine, the part of PN and PNEvo is because there is other triggers that use PN so I dont want them to get mixed...
The thing I want is to implement some kind of countdown for the effect.
start effect 1 - stop unit, turn it invulnerable - wait for 2 seconds.
remove unit 1 - create unit 2 - start effect 2 over unit 2, stop unit, turn it invulnerable - wait more 2 seconds.
turn it vulnerable and resume the unit.
I need that for multiplayer... :X
I'm saying that you should use one or the other, not both. If PN isn't set in that trigger then you're counting on it being the correct value from a previous trigger. So who is to say that PN is even equal to the correct value? Sure, in singleplayer tests things will work fine, but that's because you're the only player that PN will ever get set to.

Long story short: You don't want to use PN in that trigger, you only want to use PNEvo. Replace all instances of PN with PNEvo.

Anyway, I attached a map with a GUI friendly Timer system that I made which can help you make MUI effects with Waits.

There's also this system which could be better I haven't tried it yet: [GUI-friendly] Timer System

I tried to make mine as user friendly as possible with a lot of examples.

What you need to do:
A unit gains a level -> If level is >= evolve level -> Proceed with the initial evolve stuff and start a 2 second timer using one of these timer systems.

When that timer expires you will proceed with the next part of the evolve process and start another 2 second timer.

When that final timer expires you will finish everything (unpause/vulnerable).

If using my system you would use the TS_StartOneUnit and possibly TS_StartTwoUnits functions.
 

Attachments

  • GUI Timer System 4.w3m
    26.8 KB · Views: 6
Status
Not open for further replies.
Top