Strange Issue - Help requested

kel

New Member
Reaction score
1
Hi,

So I have a strange issue.

I have been working on a map with lots of custom code and units. Until recently everything was fine-ish. Recently, I have run into an issue that is bothering me.

The issue:
Everytime I try to save the map, I get a host of JASS errors. I have traced these errors to a function (that is autogenerated) that is creating an 'empty' trigger and calling its initialization right after the default Melee_Initilization trigger in the InitCustomTriggers function of war3map.j.
This error is preventing the map running.

This is, to my knowledge, the part of the code where things start breaking down:

JASS:
==============
// Trigger: 
//
================================
==============
function Trig__Actions takes nothing returns nothing
endfuntion

//
================================
==============
function InitTrig_ takes nothing returns nothing // *NB* this is the bad function, it is being autogenerated
    set gg_trg_ = CreateTrigger( ) // the function is trying to create a trigger and assign it to gg_trg_, but gg_trg_ doesn't exist!
    call TriggerAddAction( gg_trg_, function Trig__Actions )
endfunction

//
=================================
==============
function InitCustomTriggers takes nothing returns nothing
    ... a whole bunch of valid triggers then right near the end of this function we see...
    call InitTrig_Melee_Initialization( )
    call InitTrig_( ) //*NB* This is where the faulty trig is being called
endfunction


A few key notes:

* the global trigger variable gg_trg_ is not in the globals section of the script.
* I have manually gone into the script and tried the following:
- Manually remove the function call to InitTrig( ) as well as remove the whole InitTrig_ function and its action function. Doing this and injecting the new (edited) war3map.j into the map file allows me to run the map, but as soon as I change something and try to save the map, the bad code reappears!

This leads me to believe that something, somewhere is autogenerating this bad code.

I have even tried to manually add gg_trg_ as a global trigger variable in the global definitions at the top of the map.j file. But that section gets re-written when I save the map. Bringing me back to square one.

Since the problem seems to be one where something is autogenerating this bad trigger (empty trigger by the looks of it since its just gg_trg_ with no name), I tried again after disabling all my triggers except for the melee init (which doesn't do anything on my map).
Even after this, the problem persists, something is creating this random empty trigger, not adding it to the globals and forcing it to be called during the inits of all custom triggers.


I was wondering if anyone had come across a problem like this before, one where empty triggers are being generated from nowhere. If so, how did you solve it?

A quick turnaround would be helpful, I will be watching this thread in case you need more info.

As a side note, I am not using any custom spell/trigger system. Everything is base Jass. Nothing fancy :)

Thanks for the help.
 
export, then reimport all triggers?
 
export, then reimport all triggers?

Tried it.

Crashes. Gives me a "not enough memory issue". Don't know why, but I think its a separate issue (I'm developing on a mac).

I do see a way to fix it, but it involves manually copying over each trigger to a new map (thankfully, object data can get imported just fine).

I am hoping not to have to do that though, it is more of a last resort.
 
It's just a hunch, but the .j file is written by the trigger file inside the MPQ.
I'm not sure about the exact name of the file, but it should be the one of the larger text files.

Perhaps, opening this file would give you more insight about what's happening.
It could be that there is some corruption going on, and that the trigger with no name is actually in there. But the Trigger Editor does not show empty triggers or anything. However on save, it gets loaded into the .j file.

But as I said, it's just a hunch. I guess it's worth taking a look.
 
It's just a hunch, but the .j file is written by the trigger file inside the MPQ.
I'm not sure about the exact name of the file, but it should be the one of the larger text files.

Perhaps, opening this file would give you more insight about what's happening.
It could be that there is some corruption going on, and that the trigger with no name is actually in there. But the Trigger Editor does not show empty triggers or anything. However on save, it gets loaded into the .j file.

But as I said, it's just a hunch. I guess it's worth taking a look.
Aye, this was on my mind too. I was going through the files in the w3x to see if there was something obvious in there.

It makes sense that the auto-genned war3map.j is pulling its custom trigger info from some file that's being piped out by the trigger editor. I will take a look at this in more detail and report back. Unfortunately, there is no good MPQ editor/viewer for the Mac, so anytime I need to mess about with the w3x I need to bootcamp into my windows partition :( If only there was an MPQ Master like program for the Mac (on a side note, if anyone knows of one please let me know :D ).
 
If only there was an MPQ Master like program for the Mac (on a side note, if anyone knows of one please let me know :D ).
I use MPQ Extractor and DropMPQ.

As for your problem, I think I've run into something similar, but I had evidence of a blank, uneditable trigger in the trigger editor, and the program soon crashed. Don't know what causes it.
 
I use MPQ Extractor and DropMPQ.

As for your problem, I think I've run into something similar, but I had evidence of a blank, uneditable trigger in the trigger editor, and the program soon crashed. Don't know what causes it.
I use MPQ Extractor as well, however, from my experience with it, it doesn't handle w3x files. It manages actual .MPQs just fine though. I'll give DropMPQ a try.
MPQ Master for windows can actually handle pretty much any kind of packaged blizzard files, MPQs, W3Xs W3Ms, etc etc.

I have a theory as to what might be causing the creation of the blank trigger. From my experience, I found that (at least in the Mac version) if you create a new trigger in the editor and then try to rename it, and then while renaming it (i.e. typing the text into the name field) click outside of the text box for the name (even by mistake), the world editor crashes completely. This happens consistently. I have a feeling that this bug is somehow related to this behavior. Maybe in an attempt to 'save any data' before crashing, the trigger editor quickly flushes out everything it has into the file that the script generator uses to auto-populate, and in the process, it flushes out a trigger with no name (since you were still renaming it when it crashed).

Then something bad happens and somehow, the trigger editor looses sight of this buggy trigger and it gets locked in the system somehow. Anyway, these are just ideas really.
 
I use MPQ Extractor as well, however, from my experience with it, it doesn't handle w3x files. It manages actual .MPQs just fine though. I'll give DropMPQ a try.
Change the file extension to .mpq. :thup: .w3x files are MPQ compressed.

I've never had anything happen other than the WE crashing when I clicked out of a trigger's name.
 
Change the file extension to .mpq. :thup: .w3x files are MPQ compressed.
Excellent tip! You just saved me a lot of time and hassle :thup:

Strange about the renaming issue. I can make it happen pretty consistently. Click on the trigger name like you want to rename it, let the text box go into edit mode, click away somewhere else in the trigger editor, boom!

Are you using any special third party addition to the default world editor? I am using nothing but the defaults. Either way, strange.

Edit: By the way, know of any good syntax highlighters for Jass on the Mac?
 
Oh, no no, I meant that it doesn't do anything worse than just crash. :p No corrupted maps because of it.

[edit] "Good" is subjective, but you can get the Java-based jEdit and Vexorian's JASS definitions for it.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good
  • The Helper The Helper:
    I would like to see it again like Ghan had it the first time with pagination though - without the pagination that view will not work but with pagination it just might...
  • The Helper The Helper:
    This drink recipe I have had more than a few times back in the day! Mind Eraser https://www.thehelper.net/threads/cocktail-mind-eraser.194720/
  • The Helper The Helper:
    Happy Thursday!
  • Ghan Ghan:
    I'm not so sure, there's still a lot of Thursday left for it to become unhappy.
    +3
  • The Helper The Helper:
    still a few hours
  • The Helper The Helper:
    Its Friday!!!!
    +1
  • Ghan Ghan:
    Thursday 7/10 would Thursday again
    +3
  • The Helper The Helper:
    New forum coming soon going to be for my friend Saylor who is blind and he is doing motivational speaking and has an internet radio show and podcast. I am going to put a forum to promote him and other inspirational speaker stuff going to have some good stuff in it.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top