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

[Trigger] Detected but No Cast

Status
Not open for further replies.
Level 6
Joined
Jul 23, 2018
Messages
243
Hello everyone,
I made a trigger that creates a unit whenever a specific tower strikes a unit, it will create 3 thunder clap in 3 random areas where the dummy will spawn, cast Channel-based thunder clap to triggers another trigger. The second trigger creates another dummy that stuns the enemy with Storm Bolt and repeated for each enemy in range. The problem is that in the first trigger, the dummy units did not cast the spell, and another problem is that the second trigger did not work either. Also, when I tried to add 2 models to Art - Caster, only the priority model would show, but not 2 at the same time. I supposed that can be fixed with creating special effects through trigger instead? And what did I do wrong in the trigger that prevents them from working the way I want? Thank you in advance.
  • Lightning Tower
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (Unit-type of DamageEventSource) Equal to Lightning Tower
      • DamageEventType Equal to 0
    • Actions
      • Set CV = (Custom value of DamageEventSource)
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • Set TempPoint[CV] = (Random point in (Region centered at (Position of DamageEventTarget) with size (2000.00, 2000.00)))
          • Unit - Create 1 Tower Warning (Flame Warning) for (Owner of DamageEventSource) at TempPoint[CV] facing Default building facing degrees
          • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
          • Unit - Add Thunder Lightning to (Last created unit)
          • Unit - Order (Last created unit) to Human Mountain King - Thunder Clap
          • Custom script: call RemoveLocation(udg_TempPoint[udg_CV])
      • Skip remaining actions
      • Unit - Create 1 Dummy (No Model) for (Owner of DamageEventSource) at TempPoint[CV] facing Default building facing degrees
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • Unit - Add Chain Lightning (Lightning Tower to (Last created unit)
      • Unit - Set level of Chain Lightning (Lightning Tower for (Last created unit) to 3
      • Unit - Order (Last created unit) to Orc Far Seer - Chain Lightning DamageEventTarget
  • Thunder Lightning Stun
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Thunder Lightning
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Set TempPoint[(Custom value of (Triggering unit))] = (Position of (Triggering unit))
      • Unit - Create 1 Dummy (No Model) for (Owner of (Triggering unit)) at TempPoint[(Custom value of (Triggering unit))] facing Default building facing degrees
      • Unit - Add Storm Bolt (Thunder) to (Last created unit)
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Unit Group - Pick every unit in (Units within 1000.00 of TempPoint[(Custom value of (Triggering unit))]) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is alive) Equal to True
              • ((Picked unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True
              • ((Picked unit) is A ground unit) Equal to True
              • ((Picked unit) is A structure) Equal to False
              • ((Picked unit) is invulnerable) Equal to False
              • ((Picked unit) is hidden) Equal to False
            • Then - Actions
              • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Picked unit)
            • Else - Actions
      • Custom script: call RemoveLocation (udg_TempPoint[GetUnitUserData(GetTriggerUnit())])
 
Level 25
Joined
Sep 26, 2009
Messages
2,378
If the thunder clap is channel based, make sure the field Data - Base Order ID is actually thunderclap, else it will not work.
Make sure the spell is castable by the unit (i.e. no mana cost, no cast time, etc.)
Another problem could be in dummy unit itself:
  • Art - Animation - Cast Point offsets when the spell is initiated and when it is actually cast. This and the Cast Backswing fields should be 0.0
  • Movement speed - should be 0, Turn Rate probably 0.0 as well
At least the fields above will cause a delay (before casting spell due to cast point, or before turning anywhere) - in your case the unit could actually expire before it had chance to cast the spell.

The first thing you could try to debug this yourself is to temporarily assign a proper model for the dummy units, remove locust so you can select them and given them no expiration time. When you cast the spell ingame, you should see the dummy unit appear somewhere in the map - select it and manually cast the spell youself to make sure the dummy can actually cast it.

  • Skip remaining actions
I'll assume the position of the above command in your trigger is intentional and you know it won't fire your chain lightning :D

In your first trigger the action below leaks a location and a region:
  • Set TempPoint[CV] = (Random point in (Region centered at (Position of DamageEventTarget) with size (2000.00, 2000.00)))
In this case the location leak is caused by "(Position of DamageEventTarget)" and the region is of course by "(Region centered at loc with size (x, y))"

You could create a location yourself via a custom script like this:
  • Custom script: set udg_TempPoint[GetUnitUserData(GetTriggerUnit())] = Location(GetUnitX(udg_DamageEventTarget) + GetRandomReal(-1000.0, 1000.0), GetUnitY(udg_DamageEventTarget) + GetRandomReal(-1000.0, 1000.0))
The GetRandomReal for both X and Y axis will basically imitate a region of size (2000.0, 2000.0) without creating a region

Anyway, I don't think you actually need a thunder clap-like channel ability only to see the effect - if it is all for the effect itself.
You can do the following in the first trigger's loop:
  • Select random point
  • Create a special effect for thunder clap at that location
  • Create dummy unit at that location, give it Storm Bolt
  • Pick every nearby unit and order dummy to cast Storm Bolt on them
No need for second trigger.

As for the 2 effects set in Art - Caster: as far as I know, this only ever uses one (first?) of the models - even if it is a list. There may be some abilities which are exceptions to this rule, but I wouldn't count on it.
 
Status
Not open for further replies.
Top