• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Spell] Yoru(Valorant) Teleport like Spell help

Level 6
Joined
May 13, 2023
Messages
72
Hello again Hive, I'm trying to make Spell that works by initially creating a Summon then activating it's sub-ability allows the caster to teleport to the Summon's location like gatecrash from Yoru. I tried to do it with MUI but the ability only works on it's first iteration and the sub-ability part is poorly made and needs improvements
Heres the triggers:
  • Predestined Chronology Init
    • Events
      • Unit - A unit Spawns a summoned unit
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Chronosphere
    • Actions
      • Set VariableSet PredestinedChronoINDEX = (PredestinedChronoINDEX + 1)
      • Set VariableSet PredestinedChronoCaster[PredestinedChronoINDEX] = (Summoning unit)
      • Set VariableSet PredestinedChronoDummy[PredestinedChronoINDEX] = (Triggering unit)
      • Unit - Add Predestined Chronology (Dummy) to PredestinedChronoCaster[PredestinedChronoINDEX]
      • Unit - Set level of Predestined Chronology (Dummy) for PredestinedChronoCaster[PredestinedChronoINDEX] to (Level of Predestined Chronology for PredestinedChronoCaster[PredestinedChronoINDEX])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PredestinedChronoINDEX Equal to 1
        • Then - Actions
          • Trigger - Turn on Predestined Chronology End <gen>
          • Trigger - Turn on Predestined Chronology Dummy <gen>
        • Else - Actions
  • Predestined Chronology End
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer PredestinedChronoLOOP) from 1 to PredestinedChronoINDEX, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (PredestinedChronoDummy[PredestinedChronoLOOP] is alive) Equal to True
            • Then - Actions
              • Do nothing
            • Else - Actions
              • Unit - Remove Predestined Chronology (Dummy) from PredestinedChronoCaster[PredestinedChronoLOOP]
              • Set VariableSet PredestinedChronoCaster[PredestinedChronoLOOP] = PredestinedChronoCaster[PredestinedChronoINDEX]
              • Set VariableSet PredestinedChronoDummy[PredestinedChronoLOOP] = PredestinedChronoDummy[PredestinedChronoINDEX]
              • Set VariableSet PredestinedChronoINDEX = (PredestinedChronoINDEX - 1)
              • Set VariableSet PredestinedChronoLOOP = (PredestinedChronoLOOP - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ResonantDecimationINDEX Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                  • Trigger - Turn off Predestined Chronology Dummy <gen>
                • Else - Actions
  • Predestined Chronology Dummy
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Predestined Chronology (Dummy)
    • Actions
      • Unit Group - Pick every unit in (Units owned by (Owner of (Triggering unit)).) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Chronosphere
            • Then - Actions
              • Unit - Move (Triggering unit) instantly to (Position of (Picked unit))
              • Unit - Kill (Picked unit)
            • Else - Actions
 
Level 29
Joined
Sep 26, 2009
Messages
2,596
The "Predestined Chronology Init" trigger seems fine.
The issue most likely is that your unit group does not filter out dead units. So it could still pick up dead Chronospheres.
Also, why use unit group in "Predestined Chronology Dummy" in the first place? You put both caster and summoned unit into unit arrays, why not iterate through them?
There could also be an issue with removing "Predestined Chronology (Dummy)" ability from unit that is currently casting it.

As for "Predestined Chronology End", I think this trigger is not really needed, tbh.
Instead of periodically looking for dead chronospheres in unit array, you could just use a Unit Dies event and react to it imediately.
Basically:
  • "Predestined Chronology Init" trigger adds summoner and summoned unit into unit arrays using indexing technique
  • "Predestined Chronology Dummy" should use "For each (int var) do" action to find the index of the caster (predestinedChronoLoop) and move the caster to chronosphere that uses same index. Then kill the chronosphere
  • Have a new trigger that reacts to chronosphere's death => use again a "For each (int var) do" action to find its index and deindex the spell instance.
  • As for removing caster's "Predestined Chronology (Dummy)" ability - that could also be in a separate trigger that reacts to event "Unit stops casting an ability"
 
Level 6
Joined
May 13, 2023
Messages
72
Alright I'll give it a shot
Another question is there downside to these types of triggers
  • WIP
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Footman
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Spell for (Triggering unit)) Equal to 1
        • Then - Actions
          • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + 150.00)
        • Else - Actions
if its okay to use i'd like to use these types of triggers to give heroes custom passive abilities that run after hero casts any spells
 
Last edited:
Level 6
Joined
May 13, 2023
Messages
72
Well this is my try and it doesn't work
  • Predestined Chronology End
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • For each (Integer PredestinedChronoLOOP) from 1 to PredestinedChronoINDEX, do (Actions)
        • Loop - Actions
          • Set VariableSet PredestinedChronoCaster[PredestinedChronoLOOP] = PredestinedChronoCaster[PredestinedChronoINDEX]
          • Set VariableSet PredestinedChronoDummy[PredestinedChronoLOOP] = PredestinedChronoDummy[PredestinedChronoINDEX]
          • Set VariableSet PredestinedChronoINDEX = (PredestinedChronoINDEX - 1)
          • Set VariableSet PredestinedChronoLOOP = (PredestinedChronoLOOP - 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • PredestinedChronoINDEX Equal to 0
            • Then - Actions
              • Trigger - Turn off (This trigger)
              • Trigger - Turn off Predestined Chronology Dummy <gen>
              • Trigger - Turn off Predestined Chronology End 2 <gen>
            • Else - Actions
  • Predestined Chronology Dummy
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Predestined Chronology (Dummy)
    • Actions
      • For each (Integer PredestinedChronoLOOP) from 1 to PredestinedChronoINDEX, do (Actions)
        • Loop - Actions
          • Unit - Move PredestinedChronoCaster[PredestinedChronoLOOP] instantly to (Position of PredestinedChronoDummy[PredestinedChronoLOOP])
          • Unit - Kill PredestinedChronoDummy[PredestinedChronoLOOP]
  • Predestined Chronology End 2
    • Events
      • Unit - A unit Stops casting an ability
    • Conditions
      • (Ability being cast) Equal to Predestined Chronology (Dummy)
    • Actions
      • For each (Integer PredestinedChronoLOOP) from 1 to PredestinedChronoINDEX, do (Actions)
        • Loop - Actions
          • Unit - Remove Predestined Chronology (Dummy) from PredestinedChronoCaster[PredestinedChronoLOOP]
How do i get the caster's index?
 
Level 29
Joined
Sep 26, 2009
Messages
2,596
Trigger Predestined Chronology End => add a condition that unit-type of triggering unit == chronosphere. Right now it fires for each and every unit that dies in the map
All triggers => add an If/Then/Else inside the loop, check that PredestinedChronoDummy[PredestinedChronoLOOP] == triggering unit (in case of the unit dies event for chronosphere) and PredestinedChronoCaster[PredestinedChronoLOOP] == triggering unit (in case of starts/stops the effect of the dummy ability)
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877
I feel like you're overthinking this. The rules for this ability allow you to only have 1 Dummy active at a time, so it's pretty simple, just link the dummy to the caster and kill the old dummy upon summoning a new one (if one exists). When you cast the teleport ability, reference the Dummy using the previously linked data.

Let's use Unit Indexing since it's the easiest way to link data to units and make a spell MUI:
  • Predestined Chronology Summon
    • Events
      • Unit - A unit Spawns a summoned unit
    • Conditions
      • (Unit-type of (Summoned unit)) Equal to Chronosphere
    • Actions
      • Set VariableSet Predestined_CV = (Custom value of (Summoning unit))
      • -------- --------
      • -------- Kill the previous chronosphere if it exists --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Predestined_Dummy[Predestined_CV] is Alive) Equal to True
        • Then - Actions
          • Unit - Kill Predestined_Dummy[Predestined_CV]
        • Else - Actions
      • -------- --------
      • -------- Link the chronosphere to the caster --------
      • Set VariableSet Predestined_Dummy[Predestined_CV] = (Summoned unit)
  • Predestined Chronology Teleport
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Predestined Chronology (Dummy)
    • Actions
      • Set VariableSet Predestined_CV = (Custom value of (Triggering unit))
      • -------- --------
      • -------- Check if a chronosphere exists --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Predestined_Dummy[Predestined_CV] is Alive) Equal to True
        • Then - Actions
          • Set VariableSet Predestined_Point = (Position of Predestined_Dummy[Predestined_CV])
          • Unit - Move (Triggering unit) instantly to Predestined_Point
          • Custom script: call RemoveLocation( udg_Predestined_Point )
          • Unit - Kill Predestined_Dummy[Predestined_CV]
        • Else - Actions
Of course you could take it a step further and Enable/Disable the teleport ability based on the living status of the Dummy. That would prevent it from ever being used while there's no Chronosphere.
 
Last edited:
Top