I Keep Hitting the OP Limit!! Map init not working.

colinjames12

Member
Reaction score
0
I've posted this in hiveworkshop, but I'm not getting any good answers yet so I'm gonna try to post this here too.

I've already learned the thing about OP limit. I've shrank my array sizes to just one. I've deleted the variables that are no longer needed(But there still so many of them, when opening my map it says I have 3000 object variables.) I've minimized the actions on the map init.

But when I create a new variable/trigger (not sure which causes it.), I hit the OP limit again then triggers stopped working again.

Currently I have, 1074 triggers and 2660 variables, 123 of them being arrays with initial values of 1. (I'm not even sure if setting them to 1 is right cause there will be a maximum of 10 players.)
according to the object manager.

The only trigger that is not working right now is map initialization.

I've been searching for a more efficient solution. I'm close to finishing my map but I'm stuck with this problem. I've actually seen some solutions like TriggerSleep, TriggerExecute or something like that but we're talking about GUI here not Jass. If anybody can help, I'll be really glad.
 

Solu9

You can change this now in User CP.
Reaction score
216
Don't know any "correct" answer to this. But is it possible for you to have some of the triggers initially off and only run them when necessary? If yes, have you tried that out?
 

thorhunter

You can change this now in User CP.
Reaction score
32
I'm not sure whether your problem is OP limit. I encountered it once in a trigger that wouldn't execute fully because of the OP limit since it had over 4 or 5 quite large loops inside of it. The problem you're facing is familiar to me - what helped in my case was to disable the trigger I recently worked on. For some reason, when I copied it and deleted the old one, everything worked fine.
 

O.A

Quantum physics rules
Reaction score
29
I had this problem too with my map, sometimes adding a trigger caused map ini triggers to stop working, sometimes not. I couldn't fix it, so i had to combine some of my map ini triggers (take stuff from the ones that were not working, and put them in the ones that were), and change the rest to Time elapsed events (1 sec or 2, something like that), that was the only way i could bypass this problem...
 

Imp Midna

Active Member
Reaction score
52
TriggerSleepAction -> Jass name for what is called "Wait" in GUI. Might have some unwanted side effect (which is, your trigger will be waiting for >= 0.25 secs)
TriggerExecute -> Jass name for "run trigger <trigger> (ignore conditions)".

init triggers work this way:
when saving your map, the we creates a few functions, one of which is called "main". Its the function that WC3 executes when the map starts. taken from a lil sample map, it sort of looks like this:
JASS:
function main takes nothing returns nothing
    call SetCameraBounds( -3328.0 + GetCameraMargin(CAMERA_MARGIN_LEFT), -3584.0 + GetCameraMargin(CAMERA_MARGIN_BOTTOM), 3328.0 - GetCameraMargin(CAMERA_MARGIN_RIGHT), 3072.0 - GetCameraMargin(CAMERA_MARGIN_TOP), -3328.0 + GetCameraMargin(CAMERA_MARGIN_LEFT), 3072.0 - GetCameraMargin(CAMERA_MARGIN_TOP), 3328.0 - GetCameraMargin(CAMERA_MARGIN_RIGHT), -3584.0 + GetCameraMargin(CAMERA_MARGIN_BOTTOM) )
    call SetDayNightModels( &quot;Environment\\DNC\\DNCLordaeron\\DNCLordaeronTerrain\\DNCLordaeronTerrain.mdl&quot;, &quot;Environment\\DNC\\DNCLordaeron\\DNCLordaeronUnit\\DNCLordaeronUnit.mdl&quot; )
    call NewSoundEnvironment( &quot;Default&quot; )
    call SetAmbientDaySound( &quot;LordaeronSummerDay&quot; )
    call SetAmbientNightSound( &quot;LordaeronSummerNight&quot; )
    call SetMapMusic( &quot;Music&quot;, true, 0 )
    call CreateRegions(  )
    call CreateAllUnits(  )
    call InitBlizzard(  )
    call InitGlobals(  )
    call InitCustomTriggers(  )
    call RunInitializationTriggers(  )
endfunction


That means:
- the function is setting up basic map stuff
- then the function is, in this order, doing this:
-- it creates your custom regions you set through the WE
-- it creates the units you put onto the map using the WE
-- it initializes variables that many GUI functions need (important)
--> if your trigger hits the OP limit here already, you've got an insanely huge map
-- it initializes your global variables in an automatically created function,
--> for some reasons, he will set every variable in here AGAIN, even if its allready defined correctly in the globals block. The only way to reduce this function without hacking or manually modifying it afterwards is to reduce all your array sizes to their default size (=1)
--> generally spoken, if your trigger hits the OP limit in here, you will also be forced to hack or modify it afterwards
-- it _creates_ every single trigger you have
--> this is where your starting to get controll over it without hacking. It will be extremely tricky at this point though as a wait will make all your triggers that are supposed to run at map initialization run after 0.25 in the game, which may have unwanted side effects. You might get creative at this point, but it will be quite hard to do so.
-- it runs all of your triggers that use the "map initialization event"
--> if you hit the OP limit at this point, you have the highest chances. basically, put all of your triggers using the event "map initialization" in a few eventless triggers, create one single trigger with the "map initialization" event and make it run those eventless triggers manually.

steps you gotta do now:
- dont panic. wherever you hit the OP limit, we will be able to fix it somehow.
- hope that it hits the OP limit at the last point, cause its the easiest one to fix
- find out where you hit the OP limit
- get creative to fix it using a wait or a run trigger action or ask us if you need some inspiration
 

colinjames12

Member
Reaction score
0
I don't want waits to be replace my map init and I only have like 10 actions in my map init.
And I don't know jass, this is gui we're talking about. But I'll try all your suggestions. Thanks especially you imp midna, I now understand op limit more.

But how do I know where I hit my OP limit? I've used mpqmaster before but I'm not sure where should I look or what I should I look at.
 

Dameon

"All the power in the world resides in the eyes"
Reaction score
127
why do you have so many variables and triggers. It seems kinda excessive, maybe there is a way to cut down on some of them.
 

Imp Midna

Active Member
Reaction score
52
But how do I know where I hit my OP limit? I've used mpqmaster before but I'm not sure where should I look or what I should I look at.

Well, how do you know that you hit your OP limit? Do some (unrelated triggers with random events) not fire at all? Then you hit it in the InitCustomTrigger function. Does your init trigger fire, but is not executed to the very end? Is your Init Trigger LONG? Then its propably in the actual trigger. You could try using a "0 seconds game time" trigger instead or capsule it in other triggers as mentioned above in that case.
 

colinjames12

Member
Reaction score
0
No, no, no, no , and no. I only have like 10 actions on my map init and it's the only one that doesn't work. And I don't want time elapsed event. If I remember it right, variables with arrays are "I forgot the word" in map init. So it's probably not in the actual trigger. Don't tell me something about loops, I already know that and I don't have any loops in my map init.
 

colinjames12

Member
Reaction score
0
map init
Events
Map initialization
Conditions
Actions
Cinematic - Apply a filter over 2.00 seconds using Normal blending on texture Black Mask, starting with color (0.00%, 0.00%, 0.00%) and 0.00% transparency and ending with color (100.00%, 100.00%, 100.00%) and 100.00% transparency
Game - Set the time of day to 12.00
Game - Turn the day/night cycle Off
Sound - Set music volume to 0.00%
Environment - Create at Region 000 <gen> the weather effect Rays Of Light
Environment - Turn (Last created weather effect) On
Environment - Create at Region 003 <gen> the weather effect Rays Of Light
Environment - Turn (Last created weather effect) On
Environment - Create at Region 081 <gen> the weather effect Rays Of Light
Environment - Turn (Last created weather effect) On

I'm really sorry I can't seem to post my triggers right. I don't know how to do it right.
 

Solu9

You can change this now in User CP.
Reaction score
216
I have had problems with setting time of day and setting the day/night cycle on/off in the init. Don't know if that what causes the problem. To be honest I think it the "Cinematic - Apply a filter over 2 sec..." the is the real sinner. Have you tried something simple as disabling the actions one-by-one?

About posting triggers.
You click on the trigger name (where you add events, conditions, actions) and copy it as text.
The paste it here and add the WC tags around the text [WC3 ] [/WC3 ] (without the space in the end).

Edit: Oh and why are you creating the regions in the init instead of pre-placing them in the map?
 

colinjames12

Member
Reaction score
0
I'm not creating regions in the init, what are you talking about?

Anyway, I'm actually been asking about this problem in hiveworkshop too and some people also suspect that the problem is from the cinematic but still when I change the event from map init to elapsed game time, it will work. And I've tried this b4 with cinematic in the map init, and it works perfectly fine.

The solution in my head is that I have too many variables(probably the ones with arrays) that are also declared in the map init so I plan to delete all unwanted variables when I finish my map.

If you've read what I've said above, I said that I've did this solution b4 but when I add new variables my map init stops working again so for now, the solution in my head is what I'm planning to do.

But I'll try your suggestion anyway.
 

Dameon

"All the power in the world resides in the eyes"
Reaction score
127
how many triggers do you have with the MI event?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top