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

Suck and Pull system By colourcloud

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
This is my suck and pull system, name says it all

triggers
GUI/MUI
Cast
  • Starfall
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Push
    • Actions
      • Set Starfall_Unit[1] = (Triggering unit)
      • Set Starfall_Loc[1] = (Position of Starfall_Unit[1])
      • Set Starfall_Loc[2] = (Target point of ability being cast)
      • Special Effect - Create a special effect at Starfall_Loc[2] using Abilities\Spells\NightElf\Starfall\StarfallTarget.mdl
      • Set Starfall_Effect = (Last created special effect)
      • Wait 0.60 seconds
      • Special Effect - Destroy Starfall_Effect
      • Set Starfall_Group = (Units within 400.00 of Starfall_Loc[2] matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of Starfall_Unit[1])) Equal to True)))
      • Unit Group - Pick every unit in Starfall_Group and do (Actions)
        • Loop - Actions
          • Set Starfall_Unit[2] = (Picked unit)
          • Unit - Cause Starfall_Unit[1] to damage Starfall_Unit[2], dealing 300.00 damage of attack type Spells and damage type Normal
          • Set Starfall_Loc[3] = (Position of Starfall_Unit[2])
          • Special Effect - Create a special effect at Starfall_Loc[3] using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
          • Special Effect - Destroy (Last created special effect)
          • Unit - Create 1 Ordering Dummy for (Owner of Starfall_Unit[1]) at Starfall_Loc[3] facing Default building facing degrees
          • Set Starfall_Unit[3] = (Last created unit)
          • Unit - Add Slow to Starfall_Unit[3]
          • Unit - Order Starfall_Unit[3] to Undead Banshee - Curse Starfall_Unit[2]
          • Unit - Add a 1.50 second Generic expiration timer to Starfall_Unit[3]
      • Trigger - Turn on Starfall pull <gen>
      • Wait 1.00 seconds
      • Trigger - Turn off Starfall pull <gen>
      • Unit - Turn collision for Starfall_Unit[2] On
      • Custom script: call RemoveLocation(udg_Starfall_Loc[1])
      • Custom script: call RemoveLocation(udg_Starfall_Loc[2])
      • Custom script: call RemoveLocation(udg_Starfall_Loc[3])
      • Custom script: call RemoveLocation(udg_Starfall_Loc[4])
      • Custom script: call DestroyGroup(udg_Starfall_Group)
  • Starfall pull
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Starfall_Group and do (Actions)
        • Loop - Actions
          • Set Starfall_Unit[2] = (Picked unit)
          • Unit - Turn collision for Starfall_Unit[2] Off
          • Set Starfall_Loc[3] = (Position of Starfall_Unit[2])
          • Set Starfall_Loc[4] = (Starfall_Loc[3] offset by -10.00 towards (Angle from Starfall_Loc[3] to Starfall_Loc[2]) degrees)
          • Unit - Move Starfall_Unit[2] instantly to Starfall_Loc[4], facing Starfall_Loc[2]
          • Special Effect - Create a special effect at Starfall_Loc[3] using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
          • Special Effect - Destroy (Last created special effect)
          • Set Starfall_Loc[3] = Starfall_Loc[4]
          • Wait 1.50 seconds
          • Unit - Turn collision for Starfall_Unit[2] On
The pull trigger is the same besides from the angel,

JASS
  • function Trig_Starfall_scripted_Conditions takes nothing returns boolean
    • if ( not ( GetSpellAbilityId() == 'A003' ) ) then
      • return false
    • endif
    • return true
  • endfunction
  • function Trig_Starfall_scripted_Func008002003001 takes nothing returns boolean
    • return ( IsUnitAliveBJ(GetFilterUnit()) == true )
  • endfunction
  • function Trig_Starfall_scripted_Func008002003002 takes nothing returns boolean
    • return ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_Starfall_Unit[1])) == true )
  • endfunction
  • function Trig_Starfall_scripted_Func008002003 takes nothing returns boolean
    • return GetBooleanAnd( Trig_Starfall_scripted_Func008002003001(), Trig_Starfall_scripted_Func008002003002() )
  • endfunction
  • function Trig_Starfall_scripted_Func009A takes nothing returns nothing
    • set udg_Starfall_Unit[2] = GetEnumUnit()
    • call UnitDamageTargetBJ( udg_Starfall_Unit[1], udg_Starfall_Unit[2], 300.00, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
    • set udg_Starfall_Loc[3] = GetUnitLoc(udg_Starfall_Unit[2])
    • call AddSpecialEffectLocBJ( udg_Starfall_Loc[3], "Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl" )
    • call DestroyEffectBJ( GetLastCreatedEffectBJ() )
    • call CreateNUnitsAtLoc( 1, 'h000', GetOwningPlayer(udg_Starfall_Unit[1]), udg_Starfall_Loc[3], bj_UNIT_FACING )
    • set udg_Starfall_Unit[3] = GetLastCreatedUnit()
    • call UnitAddAbilityBJ( 'Aslo', udg_Starfall_Unit[3] )
    • call IssueTargetOrderBJ( udg_Starfall_Unit[3], "curse", udg_Starfall_Unit[2] )
    • call UnitApplyTimedLifeBJ( 1.50, 'BTLF', udg_Starfall_Unit[3] )
  • endfunction
  • function Trig_Starfall_scripted_Actions takes nothing returns nothing
    • set udg_Starfall_Unit[1] = GetTriggerUnit()
    • set udg_Starfall_Loc[1] = GetUnitLoc(udg_Starfall_Unit[1])
    • set udg_Starfall_Loc[2] = GetSpellTargetLoc()
    • call AddSpecialEffectLocBJ( udg_Starfall_Loc[2], "Abilities\\Spells\\NightElf\\Starfall\\StarfallTarget.mdl" )
    • set udg_Starfall_Effect = GetLastCreatedEffectBJ()
    • call TriggerSleepAction( 0.60 )
    • call DestroyEffectBJ( udg_Starfall_Effect )
    • set udg_Starfall_Group = GetUnitsInRangeOfLocMatching(400.00, udg_Starfall_Loc[2], Condition(function Trig_Starfall_scripted_Func008002003))
    • call ForGroupBJ( udg_Starfall_Group, function Trig_Starfall_scripted_Func009A )
    • call EnableTrigger( gg_trg_Starfall_pull_scripted )
    • call TriggerSleepAction( 1.00 )
    • call DisableTrigger( gg_trg_Starfall_pull_scripted )
    • call SetUnitPathing( udg_Starfall_Unit[2], true )
    • call RemoveLocation(udg_Starfall_Loc[1])
    • call RemoveLocation(udg_Starfall_Loc[2])
    • call RemoveLocation(udg_Starfall_Loc[3])
    • call RemoveLocation(udg_Starfall_Loc[4])
    • call DestroyGroup(udg_Starfall_Group)
  • endfunction
  • //===========================================================================
  • function InitTrig_Starfall_scripted takes nothing returns nothing
    • set gg_trg_Starfall_scripted = CreateTrigger( )
    • call TriggerRegisterAnyUnitEventBJ( gg_trg_Starfall_scripted, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    • call TriggerAddCondition( gg_trg_Starfall_scripted, Condition( function Trig_Starfall_scripted_Conditions ) )
    • call TriggerAddAction( gg_trg_Starfall_scripted, function Trig_Starfall_scripted_Actions )
  • endfunction
  • function Trig_Starfall_pull_scripted_Func001A takes nothing returns nothing
    • set udg_Starfall_Unit[2] = GetEnumUnit()
    • call SetUnitPathing( udg_Starfall_Unit[2], false )
    • set udg_Starfall_Loc[3] = GetUnitLoc(udg_Starfall_Unit[2])
    • set udg_Starfall_Loc[4] = PolarProjectionBJ(udg_Starfall_Loc[3], -10.00, AngleBetweenPoints(udg_Starfall_Loc[3], udg_Starfall_Loc[2]))
    • call SetUnitPositionLocFacingLocBJ( udg_Starfall_Unit[2], udg_Starfall_Loc[4], udg_Starfall_Loc[2] )
    • call AddSpecialEffectLocBJ( udg_Starfall_Loc[3], "Objects\\Spawnmodels\\Undead\\ImpaleTargetDust\\ImpaleTargetDust.mdl" )
    • call DestroyEffectBJ( GetLastCreatedEffectBJ() )
    • set udg_Starfall_Loc[3] = udg_Starfall_Loc[4]
    • call TriggerSleepAction( 1.50 )
    • call SetUnitPathing( udg_Starfall_Unit[2], true )
  • endfunction
  • function Trig_Starfall_pull_scripted_Actions takes nothing returns nothing
    • call ForGroupBJ( udg_Starfall_Group, function Trig_Starfall_pull_scripted_Func001A )
  • endfunction
  • //===========================================================================
  • function InitTrig_Starfall_pull_scripted takes nothing returns nothing
    • set gg_trg_Starfall_pull_scripted = CreateTrigger( )
    • call DisableTrigger( gg_trg_Starfall_pull_scripted )
    • call TriggerRegisterTimerEventPeriodic( gg_trg_Starfall_pull_scripted, 0.03 )
    • call TriggerAddAction( gg_trg_Starfall_pull_scripted, function Trig_Starfall_pull_scripted_Actions )
  • endfunction
Keywords:
suck, pull, system, colourcloud, and
Contents

Suck & Pull System (Map)

Reviews
12th Dec 2015 IcemanBo: For long time as NeedsFix. Rejected. 09:03, 7th Jun 2011 Maker: The waits make it not MUI. The "JASS" version looks just like it's converted from GUI.

Moderator

M

Moderator

12th Dec 2015
IcemanBo: For long time as NeedsFix. Rejected.

09:03, 7th Jun 2011
Maker: The waits make it not MUI. The "JASS" version looks just like it's converted from GUI.
 
Level 16
Joined
Apr 4, 2011
Messages
995
@Color Cloud

1. Don't ever use waits in spells unless there are local variables.

2. You have to use the destroy function for the third point inside the loop, or else it will only destroy the last point, also, you don't even use the fourth point, so deleting it is stupid.

3. Instead of assigning group to a variable, just call the magic function
  • set bj_wantDestroyGroup = true
it is easier and you will only need 1 extra function instead of 2 for the group (1 to destroy group, versus 1 to create and 1 to destroy.)

4. You don't clear any memory leaks in the loop part.

5. You need to use time in a hashtable to turn on and off the loop. Use an If/Then/Else to check if the unit group has anything in it.

6. Post jass in jass tags, not trigger tags. And having the spell in jass is 100% useless if it is just converted from GUI. The reason people code in jass is because it is faster and more optimal, so if you don't use the cool things about jass, it's pointless.

Please don't make the same mistake I made and upload tons of spells that are broken. Learn from your mistakes, post frequently in the trigger help section about anything you have problems with, and heed the words of knowledgable people. Also, you really should learn hashtables, it has helped me become more creative with spells, and allowed me to create unique effects. Finally, don't feel pressured to post spells, just because you finished making them. I have about 8 finished spells just sitting on my computer, because I don't want to submit bad resources.

LEARN FROM YOUR MISTAKES! IT IS THE BEST THING YOU CAN DO
 
Last edited:
Top