| 12-05-2006, 09:40 PM | #1 |
I've seen various programs do this and I'm wondering what is needed (other than obviously creating the function in JASS) to accomplish this. Could someone please explain to me how this works or link me to a thread discussing this. (I was unable to find a thread about this topic after searching for a few minutes). |
| 12-05-2006, 10:27 PM | #2 | ||
Introduction TriggerStrings.txt and TriggerData.txt contain all the GUI information about the triggers. Common.j, Blizzard.j contain what the triggers actually do. Script JASS:function TriggerA takes unit u returns integer return u return 0 endfunction TriggerData Quote:
Next is the default setting for each. Mostly the same names as the jass names for them, you can use _ to default to the TriggerStrings.txt value. Then it's the category, defined by the list at the top of TriggerData.txt. TriggerStrings Quote:
Trouble Shooting Make sure all your names are correct and that both entries in the TriggerData and TriggerStrings occupy the same section (both immediately after Map Init, for example.) If you do make any mistakes, the world editor will show them at the bottom left of the main screen in big yellow letters when you start up. It might also crash world edit if you select a faulty trigger in the editor (not sure what the exact problem has to be, most of the time I have no problems with it). Be Warned, do not use a GUI trigger in your map, then remove it from the Trigger*.txt section. You will be unable to open your map, like people using normal WE can't open WEU maps (WEU works by importing edited versions of these files into the map). Conclusion That's the basic syntax of a GUI trigger. Some things are special like multiple If/Then statements and Map Initialization (they are added by the editor) but you don't have to worry about those. Edit: I just noticed how much writing I did then and I've decided to make a tutorial of this and how to edit other .mpq files. |
| 12-05-2006, 11:35 PM | #3 |
I'm having some problems and I have some questions. First off, would I add the JASS code to the map script or where? Second, I have the function put into the map correctly, but it messes up some functions that already exist. (Like I'll see many "Unit - " fields in a row when looking through the GUI. I think I'll try this again, but do you know what that is happening? |
| 12-06-2006, 12:26 AM | #4 |
Just put the Jass script in before it's used like you would normally. Selecting the trigger in the GUI simply creates a line of jass like "call TriggerA(unit)". I suspect the Unit - fields are caused by the TriggerString section missing a variable. |
| 12-06-2006, 12:37 AM | #5 |
I think I found some things while experimenting with this that you missed slightly. I posted what I found in your tutorial thread. I will continue to experiment with this and see if I have any more issues. EDIT: I get this error when I start up World Editor (for the custom files, I had them in the UI folder in the Warcraft III folder. Code:
Trigger Database Error [TriggerEvents] - TriggerRegisterGameEvent Data section and text section have differing number of parameters(1, 0) I'd get errors like this for many, many functions. Do you know what is causing this? EDIT 2: I think I figured out the problem, I was using an old version of the TriggerStrings.txt file, I'm going to give it another shot now. |
| 12-06-2006, 02:53 AM | #6 |
Now that I've figured out how to add GUI functions to the editor, I have another question. First off, I've noticed that for extra editors such as WEU include are able to include extra natives without adding them to the UI folder in the Warcraft III folder or importing the files into the map. How is this done? |
| 12-06-2006, 04:10 AM | #7 |
It does import them into the map, but it keep them hidden. I think. |
| 12-06-2006, 10:50 AM | #8 |
It uses a loader that provides the files. Importing into the map is not required. You can use MPQDraft, Grimoire or WEHelper to inject your files. |
| 12-06-2006, 02:20 PM | #9 |
How exactly would I use one of those tools to add in GUI functions? I'm not familiar with any of those programs so I'm not exactly sure. |
| 12-19-2006, 10:18 PM | #10 |
With WE helper I guess you'd have to compile a dll. Copy the sample code of the LikeWEU dll and instead of loading WEU, load your own archive. With grimoire you can use the laodmpq.dll and list the archives you want loaded in a config file. (see grimoire documentation) MPQ draft will make you an executable with embedded archive. It's easy to use, you shouldn't have any trouble with that. |
| 12-19-2006, 10:28 PM | #11 |
By the time you finally responded I had already figured it out using Grimoire. However I'll keep in mind how to do it with the other tools, thanks. |
| 12-27-2006, 11:33 PM | #12 |
Ok, i read this but is it possible to have these files imported into a map and then have it work (rather than placing them in the war3.mpq)? because it would be cool to have GUI functions for only one map but i have had no success with importing, do i need to create a modified blizzard.j and import it? i have added the jass into the header and imported the triggerstrings.txt and the triggerdata.txt, removed the war3mapimported\ yet still i see nothing (i copied Jazradel's example following the instructions the example data is the first on the list for the unit actions section) Help? |
| 12-28-2006, 02:02 PM | #13 |
If you want the file in your map to have a higher priority than that in the Patch MPQ, you'll have to give it the same name. Simply remove the 'test' from the end of each file name. If that doesn't work, try importing them as UI\... Also, try changing TriggerA="Return the handle of "~,unit,"." to TriggerA="Return the handle of",~unit,"." |
| 12-28-2006, 02:47 PM | #14 |
well in the map the test isn't there, i just did that in the folder to prevent WE load errors. but could you upload an example map with additional functions that were created by importing material (not injecting) |
| 12-28-2006, 03:04 PM | #15 |
I haven't tested putting the actual files into the map, only creating the extra UI folder in the Warcraft 3 folder and adding the files to that. |
