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

Collision system needed (if possible)

Status
Not open for further replies.
Level 4
Joined
Mar 11, 2008
Messages
84
I want to create simple map like warlocks with differend idea, but i need that kind of collision system witch could be modified with gui.

the system is like this:
you shoot fireball if it hits unit unit takes damage. If it hits another fireball it they nulify each other.

If you havent played warlocks. I suggest trying it, its super cool :).
 
Level 22
Joined
Dec 31, 2006
Messages
2,216
Here:

Cast trigger
  • Cast
    • Events:
      • Unit - A unit Begins casting an ability
    • Conditions:
      • (Ability being cast) Equal to Fireball
    • Actions:
      • Set Caster = (Casting unit)
      • Set Player = (Owner of Caster)
      • Set Point = (Position of Caster)
      • Set Point2 = (Target point of ability being cast)
      • Unit - Create 1 Fireball for Player at Point facing (Angle from Point to Point2) degrees
      • Custom script: set udg_Caster = null
      • Custom script: set udg_Player = null
      • Custom script: call RemoveLocation(udg_Point)
      • Custom script: set udg_Point = null
      • Custom script: call RemoveLocation(udg_Point2)
      • Custom script: set udg_Point2 = null
Move trigger
  • Move
    • Events:
      • Time - Every 0.03 seconds of game time
    • Conditions:
    • Actions:
      • Set Group = (Units of type Fireball)
      • Unit Group - Pick every unit in Group and do (Actions)
        • Loop - Actions
          • Set Fireball = (Picked unit)
          • Set Player = (Owner of Fireball)
          • Set Point = (Position of Fireball)
          • Set Point2 = (Point offset by 25.00 towards (Facing of Fireball) degrees)
          • Unit - Move Fireball instantly to Point2
          • Set Group2 = (Units within 100.00 of Point2 matching (((Matching unit) belongs to an enemy of Player) Equal to True))
          • Unit Group - Pick every unit in Group2 and do (Actions)
            • Loop - Actions
              • Set Unit = (Picked unit)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of Unit) Equal to Fireball
                • Then - Actions
                  • Unit - Remove Fireball from the game
                  • Unit - Remove Unit from the game
                  • Special Effect - Create a special effect at Point2 using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
                  • Set SFX = (Last created special effect)
                  • Special Effect - Destroy SFX
                  • Custom script: set udg_SFX = null
                • Else - Actions
                  • Unit - Cause Fireball to damage Unit, dealing 200.00 damage of attack type Spells and damage type Fire
                  • Unit - Remove Fireball from the game
                  • Special Effect - Create a special effect at Point2 using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
                  • Set SFX = (Last created special effect)
                  • Special Effect - Destroy SFX
                  • Custom script: set udg_SFX = null
              • Custom script: set udg_Unit = null
          • Custom script: call DestroyGroup(udg_Group2)
          • Custom script: set udg_Group2 = null
          • Custom script: set udg_Fireball = null
          • Custom script: set udg_Player = null
          • Custom script: call RemoveLocation(udg_Point)
          • Custom script: set udg_Point = null
          • Custom script: call RemoveLocation(udg_Point2)
          • Custom script: set udg_Point2 = null
    • Custom script: call DestroyGroup(udg_Group)
    • Custom script: set udg_Group = null
This should be MUI and leakless
 
Status
Not open for further replies.
Top