Page 1 of 2

GUI to Jass?

Posted: March 19th, 2007, 7:07 pm
by Paparas
Is it possible to convert GUI triggers to Jass???

Posted: March 19th, 2007, 7:12 pm
by Xantan
In world editor click your trigger, then hit Edit >> Convert to custom text.

Posted: March 19th, 2007, 8:36 pm
by vosszaa
once u convert to text.. it doesnt show the global declaration and the "call initxx" thingy in function main..

is there anyway to make it display?

Posted: March 19th, 2007, 8:38 pm
by Xantan
vosszaa wrote:once u convert to text.. it doesnt show the global declaration and the "call initxx" thingy in function main..

is there anyway to make it display?


Thats cause being a seperate trigger from the rest it doesn't need it... If you want to add it all to one trigger then you'll need to add that, I think.

Posted: March 19th, 2007, 10:38 pm
by Aero
gg_trg_triggername and InitTrig_triggername() are completely different from the trigger itself.

When you create a trigger, you're really creating a "trigger variable" which must be declared as a trigger in globals (ie: trigger gg_trg_triggername=null)

InitTrig_triggername() is under function main which loads up all the map info and the trigger must be "Initialized"

Only need to worry about gg_trg_triggername and InitTrig_triggername() if you're editing the .j script directly

Posted: March 19th, 2007, 11:16 pm
by vosszaa
Aero wrote:gg_trg_triggername and InitTrig_triggername() are completely different from the trigger itself.

When you create a trigger, you're really creating a "trigger variable" which must be declared as a trigger in globals (ie: trigger gg_trg_triggername=null)

InitTrig_triggername() is under function main which loads up all the map info and the trigger must be "Initialized"

Only need to worry about gg_trg_triggername and InitTrig_triggername() if you're editing the .j script directly


I know but at first i was learning to edit jass from convert GUI to text, then i use that text to put in jass.

But bcoz of when i already done GUI trigger and convert into text it doesnt show the declare part to me.. so i have to make it maslef, and i just worry that i could make mistake.

Posted: March 21st, 2007, 6:12 pm
by Paparas
If I convert my trigger to Custom Text, how will i put it to .j using Jass Craft???

Posted: March 21st, 2007, 8:09 pm
by Xantan
Heres a way to not mess up.

Extract your maps .j with GUI Triggers within it.

Take the global variables, put them along with the others in your other maps .j.

Now, take all the functions, but remove comments and unnecessary blank lines and such.

Now, don't copy the "call custom triggers" thing,.

Manually type out InitTrig_yourtriggername( ) after it sais "InitBlizzard()" under function main.

Do this, and after reimport the .j over the other, flush the map in mpqmaster, delete the attributes, and its a sure with, but, if you aren't confident with yourself, check your syntax on the way or take it slow!

=o

Posted: March 21st, 2007, 8:32 pm
by Aero
It doesn't where you put InitTrig_yourtrig() under function main as long as it's declared after any locals

Also, you could eliminate InitTrig all together by declaring your trigger as =CreateTrigger() in globals and adding the TriggerRegister + Conditions/Actions with the rest of them under function main

Posted: March 25th, 2007, 10:24 am
by Paparas
I have a .j file which Triggers are in Jass. I have created some triggers, I have converted them into Custom Text, but I didn't understand where to copy them in the .j file using Jass Craft :| please help!