• 🏆 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 - partly working, partly not working properly

Status
Not open for further replies.
Level 8
Joined
Jan 8, 2010
Messages
493
is something wrong with this trigger?

  • Riddle 23
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Dungeon Ridd23 <gen> contains (Triggering unit)) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Down
          • (Dungeon Ridd24 <gen> contains Riddle Statue Blue 0031 <gen>) Equal to False
          • (Dungeon Ridd24 <gen> contains Riddle Statue Green 0032 <gen>) Equal to False
          • (Dungeon Ridd24 <gen> contains Riddle Statue Red 0033 <gen>) Equal to False
          • (Dungeon Ridd24 <gen> contains Riddle Statue White 0034 <gen>) Equal to False
          • (Dungeon Ridd24 <gen> contains Riddle Statue Yellow 0035 <gen>) Equal to False
        • Then - Actions
          • Set R1_Index = (R1_Index + 1)
          • Set R1_Point[R1_Index] = (Center of Dungeon Ridd24 <gen>)
          • Special Effect - Create a special effect at R1_Point[R1_Index] using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
          • Special Effect - Destroy (Last created special effect)
          • Unit - Move (Triggering unit) instantly to R1_Point[R1_Index]
          • Custom script: call RemoveLocation(udg_R1_Point[udg_R1_Index])
          • Set R1_Index = (R1_Index - 1)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Ability being cast) Equal to Right
              • (Dungeon Ridd33 <gen> contains Riddle Statue Blue 0031 <gen>) Equal to False
              • (Dungeon Ridd33 <gen> contains Riddle Statue Green 0032 <gen>) Equal to False
              • (Dungeon Ridd33 <gen> contains Riddle Statue Red 0033 <gen>) Equal to False
              • (Dungeon Ridd33 <gen> contains Riddle Statue White 0034 <gen>) Equal to False
              • (Dungeon Ridd33 <gen> contains Riddle Statue Yellow 0035 <gen>) Equal to False
            • Then - Actions
              • Set R1_Index = (R1_Index + 1)
              • Set R1_Point[R1_Index] = (Center of Dungeon Ridd33 <gen>)
              • Special Effect - Create a special effect at R1_Point[R1_Index] using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
              • Special Effect - Destroy (Last created special effect)
              • Unit - Move (Triggering unit) instantly to R1_Point[R1_Index]
              • Custom script: call RemoveLocation(udg_R1_Point[udg_R1_Index])
              • Set R1_Index = (R1_Index - 1)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Ability being cast) Equal to Left
                  • (Dungeon Ridd13 <gen> contains Riddle Statue Blue 0031 <gen>) Equal to False
                  • (Dungeon Ridd13 <gen> contains Riddle Statue Green 0032 <gen>) Equal to False
                  • (Dungeon Ridd13 <gen> contains Riddle Statue Red 0033 <gen>) Equal to False
                  • (Dungeon Ridd13 <gen> contains Riddle Statue White 0034 <gen>) Equal to False
                  • (Dungeon Ridd13 <gen> contains Riddle Statue Yellow 0035 <gen>) Equal to False
                • Then - Actions
                  • Set R1_Index = (R1_Index + 1)
                  • Set R1_Point[R1_Index] = (Center of Dungeon Ridd13 <gen>)
                  • Special Effect - Create a special effect at R1_Point[R1_Index] using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • Unit - Move (Triggering unit) instantly to R1_Point[R1_Index]
                  • Custom script: call RemoveLocation(udg_R1_Point[udg_R1_Index])
                  • Set R1_Index = (R1_Index - 1)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Ability being cast) Equal to Up
                      • (Dungeon Ridd22 <gen> contains Riddle Statue Blue 0031 <gen>) Equal to False
                      • (Dungeon Ridd22 <gen> contains Riddle Statue Green 0032 <gen>) Equal to False
                      • (Dungeon Ridd22 <gen> contains Riddle Statue Red 0033 <gen>) Equal to False
                      • (Dungeon Ridd22 <gen> contains Riddle Statue White 0034 <gen>) Equal to False
                      • (Dungeon Ridd22 <gen> contains Riddle Statue Yellow 0035 <gen>) Equal to False
                    • Then - Actions
                      • Set R1_Index = (R1_Index + 1)
                      • Set R1_Point[R1_Index] = (Center of Dungeon Ridd22 <gen>)
                      • Special Effect - Create a special effect at R1_Point[R1_Index] using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Unit - Move (Triggering unit) instantly to R1_Point[R1_Index]
                      • Custom script: call RemoveLocation(udg_R1_Point[udg_R1_Index])
                      • Set R1_Index = (R1_Index - 1)
                    • Else - Actions
it's suppose to make a statue move one space(region) with every use of the ability. at first i thought changing the event from "Starts the effect of an ability" to "Finishes casting the ability" already fixed it, but after changing every trigger event, it starts to not properly work again.

here's the problem.
when i use "Up" or "Left", the statue moves one region up or left, but when i use "Right" or "Down", it moves to the very right end or down end.

-0---
-----
-----

Press "Right", it's not

--0--
-----
-----

but

----0
-----
-----
 
Level 8
Joined
Jan 8, 2010
Messages
493
i didn't.. really know that. really? it's a multiplayer map, so i was often thinking that if two or more players simultaneously press the same ability button that requires a point it will do something terrible. if that's the case, i'll reedit every point variable i have in my map XD

and here's the map:
Map

type "-ri1" (without the quotations) to go the first riddle where the said problem trigger is. it's the statues.

EDIT: BTW, there are like 20 triggers like that. it's because i check if the triggering unit is in a certain region, and there are 20 different regions. i could place all of them in one trigger but.. well placing 15 if-then-else in a single trigger greatly lags my WE, and probably my WC too if that trigger is used.
 
Last edited:
Level 26
Joined
Mar 19, 2008
Messages
3,140
Okey here is the problem: you got too many regions/trigges refering to each other. Go try disabling most of them, leaving just few - you will notice that everything moves correctly.

Solution is to get rid of all the regions - you don't need 6x6 = 36 regions just for one riddle..
Create one trigger which instead of checking every circumstances (like bunch of your triggers do) just moves unit for contant value towards contant angle (one of: 90, 180, 270, 360). For ensuring your statue doesn't leave the area, leave one big region in it.
Distance you will have to calculated via testing script in-game.
 
Level 8
Joined
Jan 8, 2010
Messages
493
i see. so there's really nothing wrong in the trigger? just that it has so many regions and/or triggers in it? X|
~also tried using a hashtable to have only one trigger, thought of saving the region's handle since you would have noticed the regions are named regarding with its position, but my JNGP (even my normal WE) crashes every time i click the Save Handle of "Region". so i dumped the idea.
~would probably also check if the point to any of those four locations is of a certain tile so that the statue will not go out of the area. i think i found a function while browsing the site. if not i'll follow your suggestion and place a big region for it :)

thanks Spinnaker. hive said you helped me a little while ago (the 2 questions) that's why i can't rep you now :D
 
Status
Not open for further replies.
Top