• 🏆 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] Detect Units with Locust & Stampede question

Level 11
Joined
Aug 11, 2009
Messages
594
Hello again xD

I have 2 questions.


1. I was working on a Boss mechanic where the Boss spawns fireballs (dummy units) randomly in the room which then moves towards the boss at random speed, dealing damage to players coming near. When the fireballs reach the Boss they disappear.

The problem I encountered is that I would like the fireballs to have locust, but then the triggers cant detect them when they come within 200 of the boss. When replacing locust with invulnerable, it works, but then the fireballs has health bars if players have it on.

Is there an easy way to detect units with locust or should i just stick with invulnerable instead?


2. I wanted to use the stampede spell as a Boss mechanic aswell but wanted it to be tornados (which worked) but the problem is they still splash blood when hit just like regular stampede, even though i replaced the blood model with a lightning effect. Anyone knows how this works or if it cant be changed?

Thanks in advance!
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,570
1) How about not using Dummy units at all?
Otherwise, you need to add the Locust units to a Unit Group manually and then use a Periodic trigger to compare their Distance from the Boss. You can destroy them once they come within range and then remove them from the Unit Group.

2) I believe some effects are bugged and will always use the "base" effect. This is found on the original ability or buff. Unfortunately, this means that ALL of your Stampede abilities will share the same art effects. Maybe it'd be best just to remove the art entirely. You can also trigger a custom Stampede spell and avoid this headache (the above system would actually work great for this).
 
Level 11
Joined
Aug 11, 2009
Messages
594
Ok, that looks like a really neat system, will see if I can get it to work :D However I got this error when i tried to copy it over to my map. I copied all triggers except the "This Map Only".

Do you know whats wrong?
 

Attachments

  • Error.jpg
    Error.jpg
    102.7 KB · Views: 8
Level 25
Joined
Sep 26, 2009
Messages
2,381
that is because you have imported lua script into map that is running jass. The system you imported probably has vJass version as well, so import that one into your map.
The other option is change the map's setting to use lua instead of jass. Do note if you change that, then any jass/vjass script you have in your map will stop working instead.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,570
Ok, that looks like a really neat system, will see if I can get it to work :D However I got this error when i tried to copy it over to my map. I copied all triggers except the "This Map Only".

Do you know whats wrong?
I imagine you don't want to use Lua, so download the Jass version and make sure you have JassHelper enabled (there's a dropdown menu in the Trigger Editor).
 
Level 17
Joined
Apr 13, 2008
Messages
1,597
Alternatively:

You can store locust units in variables and have a trigger check every 1 second or whatever if the unit is close to your boss. I have some similar boss fights.
I made a short code snippet for checking unit distance (well, technically, the distance between any 2 points):

JASS:
function UDistance takes real AX, real AY, real BX, real BY returns real
    local real dx = BX - AX
    local real dy = BY - AY
    return SquareRoot(dx * dx + dy * dy)
endfunction

If it's not clear:
AX is the X coordinate of the first point, and so on.

Alternatively, you can use the goblin mine abilities and check in a trigger if the ability has been triggered / or the unit has died. I also have a few scripted abilities that do that successfully. I don't remember if it works with locust or not.
 
Level 11
Joined
Aug 11, 2009
Messages
594
I tried the vJass version and got 2 errors this time xD
Jasshelper is active, I have other vJass systems that work fine :)

@emperor_d3st ty for your reply but i am really bad with coding, all i can do myself is gui xD even as simple as your suggestion seem i dont know how to edit/use it to fit my need.
 

Attachments

  • Error1.jpg
    Error1.jpg
    100.7 KB · Views: 4
  • Error2.jpg
    Error2.jpg
    138.7 KB · Views: 4

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,570
Try copying the system folder that I have in this map, I don't think you should get any errors. I believe I removed the "extras" since Chopinski sort of threw all of his systems into one folder.
 

Attachments

  • Arcane Missiles 1.w3m
    97.5 KB · Views: 1
Last edited:
Level 11
Joined
Aug 11, 2009
Messages
594
It worked to copy the folder from the arcane missiles :)

Seems to work very well for my Boss ability so thats great :D just one thing if any of you know, is it possible to delay the missiles movements?

Preferably I would like the missiles to spawn, then wait 2 seconds before they start moving towards their point so players has time to react and see where there are free space? I looked at the Pause spell from the missile system map but it seems to paus all missiles in a specific area? so if a hero uses the missile system for one of their abilities it would potentially paus its missiles aswell or do I misunderstand how it works?

If its too complicated to do I will just reduce the number of missiles that is created to make it easier to dodge.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,570
It worked to copy the folder from the arcane missiles :)

Seems to work very well for my Boss ability so thats great :D just one thing if any of you know, is it possible to delay the missiles movements?

Preferably I would like the missiles to spawn, then wait 2 seconds before they start moving towards their point so players has time to react and see where there are free space? I looked at the Pause spell from the missile system map but it seems to paus all missiles in a specific area? so if a hero uses the missile system for one of their abilities it would potentially paus its missiles aswell or do I misunderstand how it works?

If its too complicated to do I will just reduce the number of missiles that is created to make it easier to dodge.
There's most likely a proper way of doing this, but I'm not a complete expert at the system yet. What I would try to do is set the missile Speed to 0 and then after 2 seconds increase it to the proper amount. I imagine you could do this by taking advantage of the On Periodic trigger and MissileData.

So give it a default speed of 0.00 and tell it run the following trigger every interval (I assume the missiles use a 0.03 or 0.0325 second interval):
  • // Define your Missile settings...
  • Set Variable MissileSpeed = 0.00
  • Set Variable Missile_onPeriod = BossMissilePeriodic
This trigger will run every interval:
  • BossMissilePeriodic
    • Events
    • Conditions
    • Actions
      • Set Variable MissileData = (MissileData + 1)
      • If MissileData Equal to 65 then Set Variable MissileSpeed = 900.00
I can't promise this will work because MissileData and MissileSpeed may not get updated properly.

@chopinski
Sorry to bother you but perhaps you'd be so kind as to share a solution to this delayed missile effect?
 
Level 11
Joined
Aug 11, 2009
Messages
594
@Uncle unfortunately it did not work but I think you are on to something.

I found in the pause triggers that you could pick missiles of types (defined by number of choice). However, when using this method only like half of the missiles started moving.

  • R13 Fire onPeriod
    • Events
    • Conditions
    • Actions
      • Set VariableSet Counter[Missile] = (Counter[Missile] + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Counter[Missile] Equal to 65
        • Then - Actions
          • Set VariableSet MissileGroupType = 1
          • Set VariableSet MissileGroupCounted = 20
          • Trigger - Run MissilesOfTypeCounted <gen> (ignoring conditions)
          • For each (Integer MissileAt) from 0 to (MissileGroupSize - 1), do (Actions)
            • Loop - Actions
              • Trigger - Run PickedMissile <gen> (ignoring conditions)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                • Then - Actions
                  • Set VariableSet MissileSpeed = (Random real number between 250.00 and 500.00)
                • Else - Actions
        • Else - Actions
Maybe you would need knowledge of the system to know why only some of them moved.
 
Top