• 🏆 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] Trigger not working help urgent!

Status
Not open for further replies.
Level 6
Joined
Aug 5, 2015
Messages
202
I have a spell from Marvel vs. Capcom SP v1.1 : Berserker Barrage X

So i have a Boss in my map, i want Boss have that Skill.
and i want trigger if enemy units come near the boss then
from behind each enemy units from behind them (1000 range within the boss)
i want create dummy then order each created dummy to using Berserker barrage x spell (based on shockwave spell) and target it to the position of the Boss

still cant figure out the right trigger to working it

Code:
slash go
    Events
        Unit - A unit comes within 700.00 of Troll Chieftain 0244 <gen>
    Conditions
        ((Triggering unit) belongs to an enemy of (Owner of Troll Chieftain 0244 <gen>)) Equal to True
    Actions
        Set SLASHREGION = (Position of Troll Chieftain 0244 <gen>)
        Set SLASHPICKED = (Position of (Picked unit))
        Set SLASHGROUP = (Units within 1000.00 of SLASHREGION matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of Troll Chieftain 0244 <gen>)) Equal to True)))
        Unit Group - Pick every unit in SLASHGROUP and do (Actions)
            Loop - Actions
                Unit - Create 1 Dummy Unit for (Owner of Troll Chieftain 0244 <gen>) at (SLASHPICKED offset by 200.00 towards 270.00 degrees) facing SLASHREGION
                Unit - Add Troll X Slasher (Neutral Hostile) to (Last created unit)
                Unit - Order (Last created unit) to Orc Tauren Chieftain - Shockwave SLASHREGION
                Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
        Custom script:   call RemoveLocation (udg_SLASHREGION)
        Custom script:   call RemoveLocation (udg_SLASHPICKED)
        Custom script:   call DestroyGroup (udg_SLASHGROUP)

kinda desperate here :'(

Code:
BBarrage
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Troll X Slasher (Neutral Hostile)
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                BB_Integers[1] Equal to 0
            Then - Actions
                Trigger - Turn on BB2 <gen>
            Else - Actions
        Set BB_Integers[0] = (BB_Integers[0] + 1)
        Set BB_Integers[1] = (BB_Integers[1] + 1)
        Set BB_Caster[BB_Integers[1]] = (Triggering unit)
        Set MVC_Point[0] = (Position of BB_Caster[BB_Integers[1]])
        Set MVC_Point[1] = (Target point of ability being cast)
        Set BB_Angle[BB_Integers[1]] = (Angle from MVC_Point[0] to MVC_Point[1])
        -------- ---------------- --------
        -------- ---------------- --------
        -------- ------------------------SETUP------------------------ --------
        -------- ---------------- --------
        -------- Set below the damage of the spell per interval --------
        Set BB_Damage[BB_Integers[1]] = 900.00
        -------- ---------------- --------
        -------- You can change the variable below if you want the unit to exceed the target point --------
        Set BB_Distance[BB_Integers[1]] = (Distance between MVC_Point[0] and MVC_Point[1])
        -------- ---------------- --------
        -------- Set below the intervals of the damage --------
        Set BB_Interval[BB_Integers[1]] = 0.08
        -------- ---------------- --------
        -------- Set below the speed of the unit when charging --------
        Set BB_Speed[BB_Integers[1]] = 50.00
        -------- ---------------- --------
        -------- Set below the unit - Flash (BB) --------
        Set MVC_UnitType[7] = Flash (BB)
        -------- ---------------- --------
        -------- END OF SETUP --------
        -------- ---------------- --------
        -------- ---------------- --------
        Set BB_Check[BB_Integers[1]] = True
        Unit - Turn collision for BB_Caster[BB_Integers[1]] Off
        Custom script:   call RemoveLocation (udg_MVC_Point[0])
        Custom script:   call RemoveLocation (udg_MVC_Point[1])
Code:
BB2
    Events
        Time - Every 0.04 seconds of game time
    Conditions
    Actions
        For each (Integer BB_Integers[2]) from 1 to BB_Integers[1], do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        BB_Check[BB_Integers[2]] Equal to True
                    Then - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                BB_Distance[BB_Integers[2]] Greater than 0.00
                            Then - Actions
                                Set BB_Distance[BB_Integers[2]] = (BB_Distance[BB_Integers[2]] - BB_Speed[BB_Integers[2]])
                                Set MVC_Point[0] = (Position of BB_Caster[BB_Integers[2]])
                                Set MVC_Point[1] = (MVC_Point[0] offset by BB_Speed[BB_Integers[2]] towards BB_Angle[BB_Integers[2]] degrees)
                                Unit - Move BB_Caster[BB_Integers[2]] instantly to MVC_Point[1], facing BB_Angle[BB_Integers[2]] degrees
                                Animation - Play BB_Caster[BB_Integers[2]]'s attack animation
                                Unit - Create 1 MVC_UnitType[7] for (Owner of BB_Caster[BB_Integers[2]]) at MVC_Point[1] facing (BB_Angle[BB_Integers[2]] + 45.00) degrees
                                Set RAS_Dummy = (Last created unit)
                                Set RAS_Duration = 0.50
                                Set RAS_HeightInc = False
                                Set RAS_Color = 0.00
                                Trigger - Run RemoveA <gen> (checking conditions)
                                Unit - Create 1 MVC_UnitType[7] for (Owner of BB_Caster[BB_Integers[2]]) at MVC_Point[1] facing (BB_Angle[BB_Integers[2]] - 45.00) degrees
                                Set RAS_Dummy = (Last created unit)
                                Set RAS_Duration = 0.50
                                Set RAS_HeightInc = False
                                Set RAS_Color = 0.00
                                Trigger - Run RemoveA <gen> (checking conditions)
                                Set BB_Timer[BB_Integers[2]] = (BB_Timer[BB_Integers[2]] + 0.04)
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        BB_Timer[BB_Integers[2]] Greater than or equal to BB_Interval[BB_Integers[2]]
                                    Then - Actions
                                        Set BB_Timer[BB_Integers[2]] = 0.00
                                        Set MVC_PickGroup = (Units within 130.00 of MVC_Point[1] matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) belongs to an enemy of (Owner of BB_Caster[BB_Integers[2]])) Equal to True) and ((((Matching unit) is A structure) Equal to False) and (((Matching
                                        Unit Group - Pick every unit in MVC_PickGroup and do (Actions)
                                            Loop - Actions
                                                Unit - Cause BB_Caster[BB_Integers[2]] to damage (Picked unit), dealing BB_Damage[BB_Integers[2]] damage of attack type Spells and damage type Universal
                                                Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
                                                Special Effect - Destroy (Last created special effect)
                                        Custom script:   call DestroyGroup (udg_MVC_PickGroup)
                                    Else - Actions
                                Custom script:   call RemoveLocation (udg_MVC_Point[0])
                                Custom script:   call RemoveLocation (udg_MVC_Point[1])
                            Else - Actions
                                Set BB_Check[BB_Integers[2]] = False
                                Unit - Turn collision for BB_Caster[BB_Integers[2]] On
                                Animation - Reset BB_Caster[BB_Integers[2]]'s animation
                                Set BB_Timer[BB_Integers[2]] = 0.00
                                Set BB_Integers[0] = (BB_Integers[0] - 1)
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        BB_Integers[0] Equal to 0
                                    Then - Actions
                                        Set BB_Integers[1] = 0
                                        Trigger - Turn off (This trigger)
                                    Else - Actions
                    Else - Actions
 
Set SLASHPICKED = (Position of (Picked unit))
^^dat should be inside the group loop as first action, else you will shot the waves from the center of map.

Custom script: call RemoveLocation (udg_SLASHPICKED)
^^This should be done right after spawning the dummy caster, or at least inside the group loop.

sure about that 270.00 degrees thing always spawning them below the units?
you should create a new variable CastPoint = (SLASHPICKED offset by 200.00 towards Angle From SLASHREGION To SLASHPICKED degrees)
create your dummy at CastPoint and remove that CastPoint after spawning.

you can post GUI Triggers with [Trigger]text[/Trigger], will let them be shown like in world editor.
 
Level 6
Joined
Aug 5, 2015
Messages
202
ty very much for help sir
but still not working

  • slash go
    • Events
      • Unit - A unit comes within 700.00 of Troll Chieftain 0244 <gen>
    • Conditions
      • ((Triggering unit) belongs to an enemy of (Owner of Troll Chieftain 0244 <gen>)) Equal to True
    • Actions
      • Set SLASHREGION = (Position of Troll Chieftain 0244 <gen>)
      • Set SLASHGROUP = (Units within 1000.00 of SLASHREGION matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of Troll Chieftain 0244 <gen>)) Equal to True)))
      • Unit Group - Pick every unit in SLASHGROUP and do (Actions)
        • Loop - Actions
          • Set SLASHPICKED = (Position of (Picked unit))
          • Set SLASHCASTPOINT = (SLASHPICKED offset by 200.00 towards (Angle from SLASHREGION to SLASHPICKED) degrees)
          • Unit - Create 1 Dummy Unit for (Owner of Troll Chieftain 0244 <gen>) at SLASHCASTPOINT facing SLASHREGION
          • Unit - Add Troll X Slasher (Neutral Hostile) to (Last created unit)
          • Unit - Order (Last created unit) to Orc Tauren Chieftain - Shockwave SLASHREGION
          • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
          • Custom script: call RemoveLocation (udg_SLASHPICKED)
          • Custom script: call RemoveLocation (udg_SLASHCASTPOINT)
      • Custom script: call RemoveLocation (udg_SLASHREGION)
      • Custom script: call DestroyGroup (udg_SLASHGROUP)
 
The trigger looks fine.
Are you sure about that shockwave thing? Inside the spellpack map it is Carrion Swarm.
Berserker Barrage X

This spell is MUI. Copy the 2 triggers below this trigger comment then
Copy all objects in the object editor with (BB) under Units and Abilities for this spell.

The spell's base is Carrion Swarm so it can't target at the map's boundary.
This spell also requires you to copy triggers under Fading Dummy.

You may delete comment actions if you want.
 
it is hard to fix it, without any information about what does not work.
Try out printing out feedback informations to detect the source of error more accurate.
for example such ones.
  • Game - Display to (All players) for 30.00 seconds the text: (Name of the current trigger)
  • Game - Display to (All players) for 30.00 seconds the text: (Name of (Picked unit))
  • Game - Display to (All players) for 30.00 seconds the text: (Name of (Ability being cast))
I think you have another trigger stopping your dummies from casting that spell, but try out the feedback messages.
 
Level 11
Joined
Jun 2, 2004
Messages
849
Do you use Channel anywhere in your map? If so, make sure none of the Channel based abilities use the shockwave order string. There's a bug with that where it can prevent triggers and AI from using abilities.
 
Level 9
Joined
Dec 12, 2007
Messages
489
  • Unit - Add Troll X Slasher (Neutral Hostile) to (Last created unit)
  • Unit - Order (Last created unit) to Orc Tauren Chieftain - Shockwave SLASHREGION

I don't have access to World Editor right now, but since your Troll X Slasher has a suffix "Neutral Hostile",
you should compare the orderstring from the editor and in the GUI one.

As far as I remember, all non racial (the neutral version) has prefix "creep" in the orderstring
(in this case, shockwave from Neutral Hostile would be something like "creepshockwave" or what)
, while the Orc Tauren version is just "shockwave", hence the reason your dummy didn't cast the spell.

for a checklist, a failing trigger with dummy ability usually because:
1. dummy not created / wrong dummy unit (you can try use peasant as temporary dummy just to check if the dummy is created or not)
2. wrong dummy ability is given / dummy didn't get the proper dummy ability (you can try remove locust just to check if the proper ability is given, use with solution 1 )
3. wrong order is given to the dummy (you can check it on Object Editor)
 
Status
Not open for further replies.
Top