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

[Trigger] Missile collision detection - again.

Status
Not open for further replies.
Level 2
Joined
Jun 20, 2011
Messages
19
First of all, this has to be a pretty popular question, but a quick search didn't give me a solution, so I decided to go ahead and ask.

I Have a bit of a boss battle in my little dungeon crawl map. One thing that happens during said battle is that daggers will start flying across the room, poisoning players on contact.
Visually, everything works fine and dandy, with the daggers flying around as expected. The boss "AI" runs smoothly too.
The only thing that doesn't work is, you guessed it, the collision detection for the flying daggers.

Here's a trigger that adds the event to the main collision handling trigger:
  • Vinit
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Trigger - Add to Vdaggerhit <gen> the event (Unit - A unit comes within 200.00 of CurrentDaggerDummy)
At this point, it's worth noting that only one dagger exists/is in flight at a time, and "CurrentDaggerDummy" is the variable for storing the visual for the dagger, an invulnerable locust unit that gets moved in a straight line by another trigger.

The trigger for the actual collision handling, which has the event added at the beginning of the map, is as follows:
  • Vdaggerhit
    • Events
    • Conditions
    • Actions
      • Unit - Create 1 SStriker for Player 12 (Brown) at (Position of (Triggering unit)) facing Default building facing degrees
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • Unit - Order (Last created unit) to Night Elf Warden - Shadow Strike (Triggering unit)
      • Unit - Remove CurrentDaggerDummy from the game
      • Set Vsscount = (Vsscount - 1)
      • Game - Display to (All players) the text: DAGGERHIT
      • Trigger - Turn off Vdaggermover <gen>
      • Trigger - Run Vshadowstrike <gen> (checking conditions)
Nothing that special in the actions, just a dummycaster being brought in for the actual effect, the flying dagger unit getting removed so it doesn't just pass through people and a little debug message getting displayed. At present, this trigger does none of those things, and that is the problem.

And in case it makes a difference, here's the trigger (initially off) that actually moves the missile (working as intended from what I can tell):
  • Vdaggermover
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Unit - Move CurrentDaggerDummy instantly to ((Position of CurrentDaggerDummy) offset by 16.00 towards (Facing of CurrentDaggerDummy) degrees), facing (Facing of CurrentDaggerDummy) degrees

As a final note, I'm aware that there are a bunch of leaks in this little thingy, but I'd rather go around patching those after I actually get the functionality I'm looking for. So please don't bother pointing that out.

Thanks in advance.

What I've tried so far to no effect:
-Removing locust ability from the missile unit
-Changing the movement type of the missile from flying to something else and altering movement height
-Setting the collision detection area size to an insanely high value
-Removing unit ownership conditions from the collision trigger (already done in the trigger I've posted here)
 
Last edited:
Level 2
Joined
Jun 20, 2011
Messages
19
Well, seems that moving the event creating to the trigger that swawns the daggers did the trick, thanks to the previous poster for pointing out my error.
Of course, my current method means that anywhere from four to a few dozen events are created to the daggerhit trigger in one playthrough of the boss (and thus the map) to cover each projectile that spawns, but at the moment it seems like a small price to pay for making the damn thing work.
  • Vdaggertrigger
    • Events
    • Conditions
    • Actions
      • Set MAIEVcurrentdaggerorigin = (Random integer number between 1 and 18)
      • Unit - Create 1 ssdagger for Player 12 (Brown) at (Center of Vdaggerorigins[Vcurrentdaggerorigin]) facing (Center of vCentre <gen>)
      • Set CurrentDaggerDummy = (Last created unit)
      • Trigger - Add to Vdaggerhit <gen> the event (Unit - A unit comes within 110.00 of CurrentDaggerDummy)
      • Trigger - Turn on Vdaggermover <gen>
 
Status
Not open for further replies.
Top