• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

WTFH corrupt triggers?

Status
Not open for further replies.
Level 8
Joined
Mar 3, 2009
Messages
327
I swear to god, the thing has already corrupted once today. There was a fatal error on init (Deleting all of the things id changed during the day didnt fix it) so I had to redo hours of work. This time, the triggers arent running. The init message doesn't display, so I dont know how much more screwed this can get.

I've attatched the map with a desperate hope that someone will be able to get it work. If you do I will love you forever :3

Recent changes: modified a few rune related abilities
Added "Rune drop" Trigger in items folder
Added "runedrop" variable array
Set "runedrop" variable array in the init trigger
 

Attachments

  • For The Horde Alpha 1.w3x
    150.3 KB · Views: 46
Level 26
Joined
Aug 18, 2009
Messages
4,097
You crash the main thread that initializes the triggers. There is an execution limit for each thread and you hit it by having set three large variable arrays (8192), the "size" you give in GUI is not the actual amount of fields the variable will possess but rather up to which index the members are initialized with the preset value. So this created loops with 8192 iterations, accumulating a lot of operations.
 
Level 13
Joined
Sep 13, 2010
Messages
550
The soution is too simple. I had this problem too a half year ago. The whole thing is a "block" that prevents that warcraft kill your computer. I see that you put 8192 array sizes and they are allways inneed. Array size is just good for that if you want to have all e.g. 5 or 19 (integer). It looks like in jass:
JASS:
    set i = 0
    loop
        exitwhen ( i > 8192 )
        set udg_AVARIABLE[i]=0
        set i = i + 1
    endloop

It looks like in GUI:
  • GUI
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Do Multiple ActionsFor each (Integer A) from 1 to 8192, do (Actions)
        • Loop - Actions
          • Set ANYVARIABLE[(Integer A)] = 0
So you set the whole variables but warcraft can do LIMITED amount of functions ( variable set ) at a trigger. Just about 10000 of Set function. Others will be skipped.

So why it isn't working?? The whole thing fails at the Initialization at variable set up because:
JASS:
function main takes nothing returns nothing
    call SetCameraBounds(- 8192.0 + GetCameraMargin(CAMERA_MARGIN_LEFT) , - 8192.0 + GetCameraMargin(CAMERA_MARGIN_BOTTOM) , 8192.0 - GetCameraMargin(CAMERA_MARGIN_RIGHT) , 8192.0 - GetCameraMargin(CAMERA_MARGIN_TOP) , - 8192.0 + GetCameraMargin(CAMERA_MARGIN_LEFT) , 8192.0 - GetCameraMargin(CAMERA_MARGIN_TOP) , 8192.0 - GetCameraMargin(CAMERA_MARGIN_RIGHT) , - 8192.0 + GetCameraMargin(CAMERA_MARGIN_BOTTOM))
    call SetDayNightModels("Environment\\DNC\\DNCLordaeron\\DNCLordaeronTerrain\\DNCLordaeronTerrain.mdl" , "Environment\\DNC\\DNCLordaeron\\DNCLordaeronUnit\\DNCLordaeronUnit.mdl")
    call SetTerrainFogEx(0 , 1000.0 , 9000.0 , 0.000 , 0.396 , 0.361 , 0.239)
    call NewSoundEnvironment("Default")
    call SetAmbientDaySound("BarrensDay")
    call SetAmbientNightSound("BarrensNight")
    call SetMapMusic("Music" , true , 0)
    call InitSounds() 
    call CreateRegions()
    call CreateAllDestructables()
    call CreateAllItems()
    call CreateAllUnits()
    call InitBlizzard()

call ExecuteFunc("jasshelper__initstructs8392421")
call ExecuteFunc("Acceleration___Init")  // It still OK here

    call InitGlobals() // Variable setup FAILS!!! Too much action ( About 40000 on your map of maximal 10000 :S ) so the remaining will not be run.
    call InitCustomTriggers() // JASS triggers - It will not be run.
    call RunInitializationTriggers() // GUI triggers - This won't be too
 : (
endfunction


How to prevent that?? Simply. Try not to use Variable Arrays which is bigger than 1.

But how can I use variable arrays bigger than 1?
The same way as 1. All variable types got a base value. ( Almost all null )
  • A simple var calling
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- ANYVARIABLE's size is just 1 --------
      • Game - Display to (All players) the text: (String(ANYVARIABLE[121]))
It will show you 0 but ANYVAR[121] is not edited.

Integer base = 0
Real base = 0.00
Boolean base = true or false I think
Unit = no unit = null
Dialog = new dialog
and others are null


Here's your working map: YOURWORKINGMAP.W3X I hope you can open it.

Greetings
Geries
 

Attachments

  • For The Horde Alpha 1.w3x
    151.2 KB · Views: 39
Level 26
Joined
Aug 18, 2009
Messages
4,097
Yes, jass arrays always range from 0 to 8191 (yet the last index is not saved/loaded when saving/loading the game). The fields are just not initialized with a value, well actually arrays have a null value. You can set the members when you need them or if it's necessary to preallocate the whole array, do it in a separate thread, e.g. in a Map Initialization trigger.
 
Status
Not open for further replies.
Top