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

Impact Bullet spell

Status
Not open for further replies.
Level 11
Joined
Sep 9, 2010
Messages
368
Solved




Yo,
I'm currently working on a map that contains a spell that will fire away a bullet. The bullet will move automaticly (you won't be able to assign the facing with your mouse). Move 1000 yards forward with the facing as the casting unit. When the bullet comes within 100-150 yards within an enemy unit, dummy or wall, the bullet will explode, causing AoE damage.

The problem is that the bullets aren't exploding at the impact.

Here is my triggers
  • Fire
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Fire
    • Actions
      • Unit - Remove Bullet[(Player number of (Owner of (Casting unit)))] from the game
      • Unit - Create 1 Bullet Dummy for Player 1 (Red) at (Position of (Casting unit)) facing (Facing of (Casting unit)) degrees
      • Set Bullet[(Player number of (Owner of (Casting unit)))] = (Last created unit)
      • Unit - Order (Last created unit) to Move To ((Position of (Casting unit)) offset by 1000.00 towards (Facing of (Casting unit)) degrees)
      • Unit Group - Pick every unit in (Units owned by (Owner of (Casting unit)) of type Bullet Dummy) and do (Actions)
        • Loop - Actions
          • Trigger - Add to Fire Impact <gen> the event (Unit - A unit comes within 150.00 of (Picked unit))
      • Wait 2.00 seconds
      • Unit - Explode Bullet[(Player number of (Owner of (Casting unit)))]

  • Fire Impact
    • Events
    • Conditions
      • ((Entering unit) belongs to an enemy of (Owner of (Picked unit))) Equal to True
    • Actions
      • Unit - Order (Picked unit) to Neutral - Kaboom! (Entering unit)
Thanks in advance.
 
Last edited:
Level 11
Joined
Sep 9, 2010
Messages
368
That was my first plan, but I've no clue how to transfer a specefic unit to another trigger (just in this case).
This shall be a multiplayer map, so the trigger should be able for all aviable bullets.
 
Last edited:
Level 22
Joined
Jan 10, 2005
Messages
3,426
I think I could make it work, but it will definitely leak. :p

You could, for example, turn on a trigger that checks for nearby units every 0.10 seconds. If an enemy comes within range, make the bullet explode and turn the trigger off.

Also, in your second trigger you got ''((Entering unit) belongs to an enemy of (Owner of (Picked unit))) Equal to True''. But there is no ''Owner of (Picked unit)''. You'll need to set a variable for that in your first trigger.
 
Level 22
Joined
Jan 10, 2005
Messages
3,426
  • Events
    • Time - Every 0.10 seconds of game time
  • Conditions
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Number of units in (Units in (Region centered at (Position of (Bullet)) with size (150.00, 150.00)) matching (((Matching unit) belongs to an enemy of (Owner of (Bullet))) Equal to True))) Greater than 0
      • Then - Actions
      • Else - Actions
It's an integer condition. The region is a ''Conversion - Convert Point with Size to Region''.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Don't use a region, that is a square shape. Circle is better.

  • Unit Group - Pick every unit in Missile_Group and do (Actions)
    • Loop - Actions
      • Set u1 = (Picked unit)
      • Set p1 = (Position of u1)
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 64.00 of p1) and do (Actions)
        • Loop - Actions
          • Set u2 = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (u2 is alive) Equal to True
              • *Add more conditions if needed*
            • Then - Actions
            • Else - Actions
      • Custom script: call RemoveLocation(udg_p1)
 
Status
Not open for further replies.
Top