• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Bugged Triggers

Status
Not open for further replies.
Level 21
Joined
Feb 23, 2015
Messages
243
Hi,
I have weird problem with my world editor. I searched internet, and I didn't find any information about sth like that. When I make the spell via triggers everything works correctly 'till I make it MUI. After that, cast trigger doesn't launch, even if it's perfectly correct. After I copy all triggers to the new map, they work as they should without any changes, but when I copy them back to the old map, they're bugged again. When I have workin' spell in the map, I still can't make next one, 'cause it's broken and doesn't run. I have no idea what's goin' on :goblin_jawdrop:.
I would be grateful for help.

PS: cast trigger is bugged both in 'test map' option and when I open map from the game. I have the latest version of the original Warcraft.
 
Level 11
Joined
Jan 23, 2015
Messages
788
There's a problem outside of the trigger, since it works on other map, try searching something in object editor or other things that may affect the spell, I can't help you more cause I'm limited with information, I also recommend you sharing your trigger with us.
 
Level 21
Joined
Feb 23, 2015
Messages
243
Triggers and data in object editor are exacly the same. Here is the bugged map:
View attachment ShadowImageTest.w3x
And here is workin' one:
View attachment ShadowImageCorrect.w3x
I copied all object data and all spell triggers. Additional trigger in first map doesn't affect the spell, and it's bugged even when I delete it. As for cast trigger, here it is:
  • SICast
    • Events
      • Unit - A unit starts an effect of an ability
    • Conditions
      • (Ability being cast) Equals to SI_Spell
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SI_Index[0] Equals to 0
        • Then - Actions
          • Trigger - Turn on SILoop <gen>
        • Else - Actions
          • Do nothing
      • Set SI_Index[0] = (SI_Index[0] + 1)
      • Set SI_Index[1] = (SI_Index[1] + 1)
      • Set SI_Caster[SI_Index[1]] = (Triggering unit)
      • Set SI_Duration[SI_Index[1]] = SI_Time
      • Set SI_CasterLocation = (Position of SI_Caster[SI_Index[1]])
      • Unit - Create 1 (Unit-type of SI_Caster[SI_Index[1]]) for (Owner of SI_Caster[SI_Index[1]]) at SI_CasterLocation facing Default building orientation degrees
      • Set SI_Unit[SI_Index[1]] = (Last created unit)
      • Unit - Turn off supply usage for SI_Unit[SI_Index[1]]
      • Unit - Set SI_Unit[SI_Index[1]] movement speed to ((Default movement speed of SI_Unit[SI_Index[1]]) x SI_UnitSpeedMultiplier)
      • -------- Removes Attack --------
      • Unit - Add NoAttack(SI) to SI_Unit[SI_Index[1]]
      • -------- Custom Value for turning off abilities --------
      • Unit - Set the custom value of SI_Unit[SI_Index[1]] to 2
      • Animtion - Change SI_Unit[SI_Index[1]]'s vertex coloring to (SI_Red%, SI_Green%, SI_Blue%) with SI_Transparency% transparency
      • Unit - Turn collision for SI_Unit[SI_Index[1]] WyĹ‚.
      • Unit - Remove SI_Spell from SI_Unit[SI_Index[1]]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • IfInvisible Equals to 1
        • Then - Actions
          • Unit - Add Ghost to SI_Unit[SI_Index[2]]
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • IfImmortal Equals to 1
        • Then - Actions
          • Unit - Make SI_Unit[SI_Index[2]] Indestructible
        • Else - Actions
      • Custom script: call RemoveLocation(udg_SI_CasterLocation)
Trigger doesn't run in the first map even after I delete conditions. I hope I translated it correctly.
 
Level 21
Joined
Nov 4, 2013
Messages
2,017
I had similar problems with dynamic indexing. When I copied the trigger exactly as the tutorial said, all trigges would not work. I had even put "Map Initialization" and in the actions "Display Message" but it didn't work X_X
Such a simple trigger that refuses to work because I did the dynamic indexing in another one...
 
Level 24
Joined
Aug 1, 2013
Messages
4,658
Does the trigger not run at all?
I mean there is no response from the event without conditions nor actions (except a display text)?
In that case, your map initialization has an OP limit.
You probably have some systems in JASS that have a lot of registration on map init which breaks your entire operation number.
You have to remove or replace that registry.
 
Level 12
Joined
May 22, 2015
Messages
1,051
The issue is most likely what Wietlol has mentioned.

Too much stuff happens during the map initialisation and it hits a limit for operations. This means it literally just stops doing anything. What isn't as obvious with GUI triggers is that they also add extra work at map initialisation. The code to build the triggers is run. They are always run at the end of the main map initialisation function, so if it hits an operation limit, your triggers will not be created and appear to not work at all.

The fix could be as easy as shrinking how big your arrays are. Are there large arrays in your variable list? Something like in the thousands for a few variables and I broke my whole map. Shrunk them to 100s and it fixed it (turns out you don't need to set the size, though, but that is not important here).

Do you have big arrays like this?
 
Level 24
Joined
Aug 1, 2013
Messages
4,658
It only sets the default values to the stuff in the array.
So if you want to start with all values be set to 12345 (for example), then you have to set the default value to 12345 and the size to whatever size you want that has that as default value.

If you dont care about the default value, you just set the size to 0 or 1 because it doesnt actually affect the size of the array.
JASS arrays are always 8191 big.
 
Level 17
Joined
Dec 11, 2014
Messages
2,004
TO said:
PS: What does array size do at all?

ONLY 1 USE:

If you have either Timer or Dialog arrays, it DOES something. Let me explain.

In WC 3 we don't have a function to "Create" a timer or a Dialog, they initialize in Variable Manager. WE doesn't know However how many Timers/Dialogs will be used; so it looks at the Array size and Creates those Many + 1 Timers/Dialogs.
 
Status
Not open for further replies.
Top