• 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] i don't understand why don't work

Status
Not open for further replies.
Level 2
Joined
Apr 5, 2013
Messages
10
i try to make a spell... This spells move all enemy for the hero and move the position of the ball... but it doesn't work

  • Shockwave del Sexopata
    • Acontecimientos
      • Unidad - A unit Inicia el efecto de una habilidad
    • Condiciones
      • (Ability being cast) Igual a Shockwave del Sexopata
    • Acciones
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Si: Condiciones
          • (Level of Shockwave del Sexopata for Franco) Igual a 1
        • Entonces: Acciones
          • Grupo de unidad - Pick every unit in (Units within 600.00 of (Position of Sexopata)) and do (Actions)
            • Bucle: Acciones
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • Si: Condiciones
                  • ((Picked unit) belongs to an enemy of (Owner of Franco)) Igual a True
                  • ((Picked unit) is in (Units within 600.00 of (Position of Sexopata))) Igual a True
                • Entonces: Acciones
                  • Unidad - Move (Picked unit) instantly to (Position of Sexopata)
                  • Unidad - Cause Franco to damage (Picked unit), dealing 150.00 damage of attack type Magia and damage type Mejorado
                • Otros: Acciones
                  • Do nothing
        • Otros: Acciones
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Si: Condiciones
          • (Level of Shockwave del Sexopata for Franco) Igual a 2
        • Entonces: Acciones
          • Grupo de unidad - Pick every unit in (Units within 800.00 of (Position of Sexopata)) and do (Actions)
            • Bucle: Acciones
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • Si: Condiciones
                  • ((Picked unit) belongs to an enemy of (Owner of Franco)) Igual a True
                  • ((Picked unit) is in (Units within 800.00 of (Position of Sexopata))) Igual a True
                • Entonces: Acciones
                  • Unidad - Move (Picked unit) instantly to (Position of Sexopata)
                  • Unidad - Cause Franco to damage (Picked unit), dealing 225.00 damage of attack type Magia and damage type Mejorado
                • Otros: Acciones
                  • Do nothing
        • Otros: Acciones
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Si: Condiciones
          • (Level of Shockwave del Sexopata for Franco) Igual a 1
        • Entonces: Acciones
          • Grupo de unidad - Pick every unit in (Units within 1000.00 of (Position of Sexopata)) and do (Actions)
            • Bucle: Acciones
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • Si: Condiciones
                  • ((Picked unit) belongs to an enemy of (Owner of Franco)) Igual a True
                  • ((Picked unit) is in (Units within 1000.00 of (Position of Sexopata))) Igual a True
                • Entonces: Acciones
                  • Unidad - Move (Picked unit) instantly to (Position of Sexopata)
                  • Unidad - Cause Franco to damage (Picked unit), dealing 300.00 damage of attack type Magia and damage type Mejorado
                • Otros: Acciones
                  • Do nothing
        • Otros: Acciones
PD: sorry i have the we in spanish
 
Level 23
Joined
Oct 20, 2012
Messages
3,075
I don't understand spanish but I'll try to help...

First.. You're leaking a lot of points and unit groups there.. Read this: Things that leak

You also forgot to change this last line to three.. (I think that's the level of the spell?)
  • (Level of Shockwave del Sexopata for Franco) Igual a 1
  • (Level of Shockwave del Sexopata for Franco) Igual a 2
  • (Level of Shockwave del Sexopata for Franco) Igual a 1
You also don't need this anymore because you already checked it in the pick every unit action so remove it
  • ((Picked unit) is in (Units within 1000.00 of (Position of Sexopata))) Igual a True
oh and remove the do nothing's too.. they're useless..
 
Level 2
Joined
Apr 5, 2013
Messages
10
65ed878306604e6c19cfb10c8efd27ado.jpg


this is the hero and his parnter...the hero name is franco and the partner name is sexopata....

i try to make you say but don't work..

  • Orbe inicio
    • Acontecimientos
      • Unidad - A unit Adquiere una habilidad
    • Condiciones
      • (Learned Hero Skill) Igual a Invocacion sexopata
    • Acciones
      • Unidad - Change ownership of Sexopata 0020 <gen> to (Owner of Franco) and Cambiar color
      • Unidad - Unhide Sexopata 0020 <gen>
      • Set Sexopata = Sexopata 0020 <gen>
      • Unidad - Move Sexopata instantly to (Position of Franco)
this is the code to set partner...
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
I tried to simplify your spell. I didn't see anything wrong with it (apart from what others already posted). I also add comments to the spell to explain some things.

  • Shockwave del Sexopata
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Shockwave del Sexopata
    • Actions
      • -------- SETS POSITION OF SEXOPATA --------
      • -------- it is important to set the location like this so it can be removed later to prevent leaks --------
      • Set Point_var = (Position of Sexopata)
      • -------- this is a "Point"-type variable --------
      • -------- ------------------------------------------------------------------------------------------ --------
      • -------- ------------------------------------------------------------------------------------------ --------
      • -------- ------------------------------------------------------------------------------------------ --------
      • -------- SETS DAMAGE AND RANGE OF THE SPELL --------
      • -------- because damage is same for every target of the spell, it is better to set it beforehand so the trigger won't calculate damage for each unit individually --------
      • Set Damage_var = (75.00 + (Real((75 x (Level of Shockwave del Sexopata for (Triggering unit)))))) /// so if Shockwave del Sexopata is 1, it will calculated damage as 75 + (75*1) => 150
      • Set Range_var = (400.00 + (Real((200 x (Level of Shockwave del Sexopata for (Triggering unit))))))
      • -------- both Range_var and Damage_var are "Real"-type variables. --------
      • -------- ------------------------------------------------------------------------------------------ --------
      • -------- ------------------------------------------------------------------------------------------ --------
      • -------- ------------------------------------------------------------------------------------------ --------
      • -------- PICKS TARGETS --------
      • -------- the following custom script immediately destroys the group after it was used. That way it prevents leaks --------
      • Custom script: set bj_wantDestroyGroup = true
      • -------- I also use condition "(Matching unit) is Alive" so no dead unit is picked into group. --------
      • Unit Group - Pick every unit in (Units within Range_var of Point_var matching ((((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True) and (((Matching unit) is alive) Equal to True))) and do (Actions)
        • Loop - Actions
          • Unit - Cause (Triggering unit) to damage (Picked unit), dealing Damage_var damage of attack type Spells and damage type Normal
          • Unit - Move (Picked unit) instantly to Point_var
      • -------- ------------------------------------------------------------------------------------------ --------
      • -------- ------------------------------------------------------------------------------------------ --------
      • -------- ------------------------------------------------------------------------------------------ --------
      • -------- CLEAR LEAKS --------
      • Custom script: call RemoveLocation(udg_Point_var)
      • Custom script: set udg_Point_var = null

Your other trigger also leaks position, set it like this
  • Orbe inicio
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Invocacion sexopata
    • Actions
      • Unit - Change ownership of Sexopata 0020 <gen> to (Owner of Franco) and Change color
      • Unit - Unhide Sexopata 0020 <gen>
      • Set Sexopata = Sexopata 0020 <gen>
      • Set Point_var = (Position of Franco)
      • Unit - Move Sexopata instantly to Point_var
      • Custom script: call RemoveLocation(udg_Point_var)
      • Custom script: set udg_Point_var = null
This is just assumption, but what I see possibly wrong with your spell is that you check what level of Shockwave del Sexopata has Franco, not Sexopata himself.
Of course this is just assumption going by the name of that spell.

Thus my question is: Who casts this ability? Sexopata or Franco?
 
you leak points in the loop. change to this

  • Unit Group - Pick every unit in (Units within Range_var of Point_var matching ((((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True) and (((Matching unit) is alive) Equal to True))) and do (Actions)
  • Loop - Actions
    • Set Point_var = (Position of Sexopata)
    • Unit - Cause (Triggering unit) to damage (Picked unit), dealing Damage_var damage of attack type Spells and damage type Normal
    • Unit - Move (Picked unit) instantly to Point_var
    • Custom script: call RemoveLocation(udg_Point_var)
 
Status
Not open for further replies.
Top