GUI to Jass?

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

User avatar
Paparas
Newcomer
Posts: 9
Joined: March 14th, 2007, 7:14 pm

GUI to Jass?

Post by Paparas »

Is it possible to convert GUI triggers to Jass???
User avatar
Xantan
Honorary wc3edit.net Traitor
Posts: 2507
Joined: February 1st, 2007, 4:11 pm
Location: NEVADA

Post by Xantan »

In world editor click your trigger, then hit Edit >> Convert to custom text.
User avatar
vosszaa
Old Wrinkly Member
Posts: 247
Joined: March 7th, 2007, 7:04 am

Post 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?
Image

The tallest tower.. begins from the ground
Today, you are novice..
Tomorrow, you might be The Master..
And when you are..
Vosszaa will hunt you down..
User avatar
Xantan
Honorary wc3edit.net Traitor
Posts: 2507
Joined: February 1st, 2007, 4:11 pm
Location: NEVADA

Post 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.
User avatar
Aero
Forum Staff
Posts: 829
Joined: January 28th, 2007, 8:10 pm
Title: JASS Programmer
Location: Canada

Post 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
User avatar
vosszaa
Old Wrinkly Member
Posts: 247
Joined: March 7th, 2007, 7:04 am

Post 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.
Image

The tallest tower.. begins from the ground
Today, you are novice..
Tomorrow, you might be The Master..
And when you are..
Vosszaa will hunt you down..
User avatar
Paparas
Newcomer
Posts: 9
Joined: March 14th, 2007, 7:14 pm

Post by Paparas »

If I convert my trigger to Custom Text, how will i put it to .j using Jass Craft???
User avatar
Xantan
Honorary wc3edit.net Traitor
Posts: 2507
Joined: February 1st, 2007, 4:11 pm
Location: NEVADA

Post 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
User avatar
Aero
Forum Staff
Posts: 829
Joined: January 28th, 2007, 8:10 pm
Title: JASS Programmer
Location: Canada

Post 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
User avatar
Paparas
Newcomer
Posts: 9
Joined: March 14th, 2007, 7:14 pm

Post 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!