• 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.

[Trigger] stun and sent back

Status
Not open for further replies.
Level 18
Joined
Aug 23, 2008
Messages
2,319
That got to be an animation made in the model itself. Once the animation is in the model, use the command 'Unit - Play Rufy's stun animation' or whatever the animation is called.

Another possibility is a special effect which should take place between the caster and the target of ability being cast.
 
I post the trigger pls look u, I m K.O XD

->>>> :fp:note in map ability dota spell random there is mh_links, here i put mh_links2

:fp:my variable:
MH_angle Real 0
MH_level integer 0
MH_link unit array1
MH_links2 Integer 0
MH_Unit unit array1
Temp_group-> group unit

  • MH Cast
    • Eventi
      • UnitÃ* - A unit Inizia il lancio di un'abilitÃ*
    • Condizioni
      • (Ability being cast) Uguale a Meat Hook
    • Azioni
      • Set MH_level = (Level of Meat Hook for (Triggering unit))
      • Set MH_Angle = (Angle from (Position of (Triggering unit)) to (Target point of ability being cast))
      • Set MH_Unit[1] = (Triggering unit)
      • Trigger - Turn on MH Extend <gen>
  • MH Extend
    • Eventi
      • Tempo - Every 0.04 seconds of game time
    • Condizioni
    • Azioni
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Se - Condizioni
          • MH_Links2 Minore di (5 + (6 x MH_level))
        • Allora - Azioni
          • Set MH_Links2 = (MH_Links2 + 1)
          • UnitÃ* - Create 1 Chain Link for (Owner of MH_Unit[1]) at ((Position of MH_Unit[1]) offset by (Real((40 x MH_Links2))) towards MH_Angle degrees) facing MH_Angle degrees
          • Set MH_Link[MH_Links2] = (Last created unit)
          • Set Temp_Group = (Units within 115.00 of (Position of MH_Link[MH_Links2]) matching (((Matching unit) is alive) Uguale a TRUE))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Se - Condizioni
              • MH_Links2 Maggiore di 3
            • Allora - Azioni
              • Set MH_Unit[2] = (Random unit from Temp_Group)
              • Custom script: call DestroyGroup(udg_Temp_Group)
              • Custom script: set udg_Temp_Group = null
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • Se - Condizioni
                  • (MH_Unit[2] belongs to an ally of (Owner of MH_Unit[1])) Uguale a FALSE
                • Allora - Azioni
                  • UnitÃ* - Cause MH_Unit[1] to damage MH_Unit[2], dealing (100.00 x (Real(MH_level))) damage of attack type Incantesimi and damage type Normale
                • Altrimenti - Azioni
            • Altrimenti - Azioni
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Se - Condizioni
              • MH_Unit[2] Diverso da Nessuna unitÃ*
            • Allora - Azioni
              • Trigger - Turn on MH Retract <gen>
              • Trigger - Turn off (This trigger)
            • Altrimenti - Azioni
        • Altrimenti - Azioni
          • Trigger - Turn on MH Retract <gen>
          • Trigger - Turn off (This trigger)
  • MH Retract
    • Eventi
      • Tempo - Every 0.04 seconds of game time
    • Condizioni
    • Azioni
      • UnitÃ* - Move MH_Unit[2] instantly to (Position of MH_Link[MH_Links2])
      • UnitÃ* - Remove MH_Link[MH_Links2] from the game
      • Set MH_Links2 = (MH_Links2 - 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Se - Condizioni
          • MH_level Uguale a 0
        • Allora - Azioni
          • Custom script: set udg_MH_Unit[2] = null
          • Custom script: set udg_MH_Unit[1] = null
          • Trigger - Turn off (This trigger)
        • Altrimenti - Azioni
 
ok this is in english, the variable are up

  • MH Cast
  • Events
  • * Unit - A unit starts the launch of an ability *
  • Conditions
  • (Ability being cast) Same as Meat Hook
  • Stocks
  • Set MH_level = (Level of Meat Hook for (Triggering unit))
  • Set MH_Angle = (Angle from (Position of (Triggering unit)) to (Target point of ability being cast))
  • Set MH_Unit [1] = (Triggering unit)
  • Trigger - Turn on MH Extend <gen>
:fp::fp::fp: UH, I have note that now when use forst second the meat hook the game make a error of memory or something why?

  • Extend MH
  • Events
  • Time - Every 0.04 seconds of game time
  • Conditions
  • Stocks
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • Less than MH_Links2 (5 (6 x MH_level))
  • Then - Actions
  • Set MH_Links2 = (MH_Links2 1)
  • Unit - Create Chain Link 1 for (Owner of MH_Unit [1]) at ((Position of MH_Unit [1]) offset by (Real ((40 x MH_Links2))) towards MH_Angle degrees) degrees facing MH_Angle
  • Set MH_Link [MH_Links2] = (Last created unit)
  • Set Temp_Group = (Units within 115.00 of (Position of MH_Link [MH_Links2]) matching (((Matching unit) is alive) Equal to TRUE))
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • MH_Links2 Maggiore 3
  • Then - Actions
  • Set MH_Unit [2] = (Random unit from Temp_Group)
  • Custom script: call DestroyGroup (udg_Temp_Group)
  • Custom script: set udg_Temp_Group = null
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • (MH_Unit [2] belongs to an ally of (Owner of MH_Unit [1])) Same as FALSE
  • Then - Actions
  • Unit - CAUSE MH_Unit [1] to damage MH_Unit [2], dealing (100.00 x (Real (MH_level))) damage type of attack Spells and damage type Normal
  • Otherwise - Stocks
  • Otherwise - Stocks
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • MH_Unit [2] Other than no units *
  • Then - Actions
  • Trigger - Turn on MH Retract <gen>
  • Trigger - Turn off (This trigger)
  • Otherwise - Stocks
  • Otherwise - Stocks
  • Trigger - Turn on MH Retract <gen>
  • Trigger - Turn off (This trigger)
  • MH Retract
  • Events
  • Time - Every 0.04 seconds of game time
  • Conditions
  • Stocks
  • Unit - Move MH_Unit [2] instantly to (Position of MH_Link [MH_Links2])
  • Unit - Remove MH_Link [MH_Links2] from the game
  • Set MH_Links2 = (MH_Links2 - 1)
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • MH_level Same 0
  • Then - Actions
  • Custom script: set udg_MH_Unit [2] = null
  • Custom script: set udg_MH_Unit [1] = null
  • Trigger - Turn off (This trigger)
  • Otherwise - Stocks
 
Last edited:
Level 18
Joined
Aug 23, 2008
Messages
2,319
First of all: When you Copy As Text a trigger, leave the spaces (like you did with the first trigger). If you remove them (like you did in the second), you'll get a trigger that's only harder to read.
Also I can't understand anything of 'Less than MH_Links2 (5 (6 x MH_level))', because that can't be made in GUI.

But with the 'error in memory' you probably have a leak somewhere. I'm not the anti-leak-master, so you best ask someone else. Please edit your trigger by pasting the uncensored edition (leaving the spaces and original commands).
 
Ok I now try to translate the trigger

  • MH Cast
    • Events
      • Unit - A unit starts the launch of a skill
    • Conditions
      • (Ability being cast) Same as Meat Hook
    • Stocks
      • Set MH_level = (Level of Meat Hook for (Triggering unit))
      • Set MH_Angle = (Angle from (Position of (Triggering unit)) to (Target point of ability being cast))
      • Set MH_Unit [1] = (Triggering unit)
      • Trigger - Turn on MH Extend <gen>


  • Extend MH
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Stocks
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Less than MH_Links2 (5 (6 x MH_level))
        • Then - Actions
          • Set MH_Links2 = (MH_Links2 1)
          • Unit - Create Chain Link 1 for (Owner of MH_Unit [1]) at ((Position of MH_Unit [1]) offset by (Real ((40 x MH_Links2))) towards MH_Angle degrees) degrees facing MH_Angle
          • Set MH_Link [MH_Links2] = (Last created unit)
          • Set Temp_Group = (Units within 115.00 of (Position of MH_Link [MH_Links2]) matching (((Matching unit) is alive) Equal to TRUE))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • MH_Links2 Maggiore 3
            • Then - Actions
              • Set MH_Unit [2] = (Random unit from Temp_Group)
              • Custom script: call DestroyGroup (udg_Temp_Group)
              • Custom script: set udg_Temp_Group = null
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (MH_Unit [2] belongs to an ally of (Owner of MH_Unit [1])) Same as FALSE
                • Then - Actions
                  • Unit - CAUSE MH_Unit [1] to damage MH_Unit [2], dealing (100.00 x (Real (MH_level))) damage type of attack Spells and damage type Normal
                • Otherwise - Stocks
            • Otherwise - Stocks
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • MH_Unit [2] Other than no units
            • Then - Actions
              • Trigger - Turn on MH Retract <gen>
              • Trigger - Turn off (This trigger)
            • Otherwise - Stocks
        • Otherwise - Stocks
          • Trigger - Turn on MH Retract <gen>
          • Trigger - Turn off (This trigger)

  • MH Retract
    • Eventi
      • Tempo - Every 0.04 seconds of game time
    • Condizioni
    • Azioni
      • UnitÃ* - Move MH_Unit[2] instantly to (Position of MH_Link[MH_Links2])
      • UnitÃ* - Remove MH_Link[MH_Links2] from the game
      • Set MH_Links2 = (MH_Links2 - 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Se - Condizioni
          • MH_level Uguale a 0
        • Allora - Azioni
          • Custom script: set udg_MH_Unit[2] = null
          • Custom script: set udg_MH_Unit[1] = null
          • Trigger - Turn off (This trigger)
        • Altrimenti - Azioni

Also I can't understand anything of 'Less than MH_Links2 (5 (6 x MH_level))', because that can't be made in GUI.
I have only copy the trigger of a spell in your forum section spells, the name is random spell dota. in original map there was variable links, instead here i change the name in links2.

my variable:
MH_angle Real 0
MH_level integer 0
MH_link unit array1
MH_links2 Integer 0
MH_Unit unit array1
Temp_group-> group unit

P.S--> in map ability dota spell random there is mh_links, here i put mh_links2
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
Now I see the cause of lag.

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • MH_Links2 Maggiore 3
    • Then - Actions
      • Set MH_Unit [2] = (Random unit from Temp_Group)
      • Custom script: call DestroyGroup (udg_Temp_Group)
      • Custom script: set udg_Temp_Group = null
So if the condition isn't made, the group will not be destroyed, causing leaks. Same for:

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • Se - Condizioni
      • MH_level Uguale a 0
    • Allora - Azioni
      • Custom script: set udg_MH_Unit[2] = null
      • Custom script: set udg_MH_Unit[1] = null
      • Trigger - Turn off (This trigger)
    • Altrimenti - Azioni
Whatever it says, it's destroying a group only if a condition is met, which is bad no matter what.
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
Your current second trigger is:

  • MH Retract
    • Eventi
      • Tempo - Every 0.04 seconds of game time
    • Condizioni
    • Azioni
      • UnitÃ* - Move MH_Unit[2] instantly to (Position of MH_Link[MH_Links2])
      • UnitÃ* - Remove MH_Link[MH_Links2] from the game
      • Set MH_Links2 = (MH_Links2 - 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Se - Condizioni
          • MH_level Uguale a 0
        • Allora - Azioni
          • Trigger - Turn off (This trigger)
        • Altrimenti - Azioni
      • Custom script: set udg_MH_Unit[2] = null
      • Custom script: set udg_MH_Unit[1] = null
Same for the other one.
 
Status
Not open for further replies.
Top