How to add my own cheats[Tutorial]

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

Dark_Shadow32
Member
Posts: 57
Joined: February 11th, 2007, 8:31 am
Location: Germany

How to add my own cheats[Tutorial]

Post by Dark_Shadow32 »

How to add my own cheats[Tutorial]

1. Create Triggers

Open the Warcraft3 - World Editor. Then open the Trigger Editor(F4) and create a new Trigger.
To make the Trigger you must know how GUI works, but wheter you know how jass work you don't need this tutorial. Create your Trigger or your Triggers. If you finished your work, select your trigger and click at Edit->Convert in own Text(Or Something like that). Your Trigger is now written in Jass.

2. Open the war3map.j

Download MPQMaster or something like this.
Open the Map you want to cheat with MPQMaster.
Then Extract the war3map.j. (Maybe the war3map.j is in a "Scripts" folder)

3. Edit the war3map.j

Open the war3map.j with notepad or something else.
Search for a line wich looks like that: trigger xy=CreateTrigger()
Now you need your cheat, you created in step 1.
The Trigger could look like this:
function Trig_cheat_Actions takes nothing returns nothing
call AdjustPlayerStateBJ( 1000, GetTriggerPlayer(), PLAYER_STATE_RESOURCE_GOLD )
endfunction

//===========================================================================
function InitTrig_cheat takes nothing returns nothing
set gg_trg_cheat = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_cheat, Player(0), "-cheat", true )
call TriggerRegisterPlayerChatEvent( gg_trg_cheat, Player(1), "-cheat", true )
call TriggerRegisterPlayerChatEvent( gg_trg_cheat, Player(2), "-cheat", true )
call TriggerRegisterPlayerChatEvent( gg_trg_cheat, Player(3), "-cheat", true )
call TriggerRegisterPlayerChatEvent( gg_trg_cheat, Player(4), "-cheat", true )
call TriggerAddAction( gg_trg_cheat, function Trig_cheat_Actions )
endfunction


Add the line "trigger gg_trg_cheat=null" behind the line you searched for. (In my example the trigger has the name gg_trg_cheat. You must replace this with the name of your trigger. It is red marked!)

Now you must search for: endfunction
Add your Trigger behind this.

After that search for a line like that: function main takes nothing returns nothing

Scroll a bit down until you see something like that: call x( y )
Insert "call InitTrig_cheat( )" after this, without the Quotienstion marks. (In my example the trigger has the name InitTrig_cheat. You must replace this with the name of your trigger. It is blue marked!)

Now save the war3map.j

4. Insert the new war3map.j

Open the map you want to cheat in MPQMaster.
Delete the old war3map.j and add the edited one.
Now close MPQMaster and have much fun with your edited map.

TIPP: Clone the Map wich you want to edit, then you still have the originall one.

I'm sorry for my bad english :oops:

greets Dark_Shadow32
Kala-cha
Forum Addict
Posts: 405
Joined: February 17th, 2007, 9:16 pm

Post by Kala-cha »

Could yah make this in GUI instead?
i-want-dota
Newcomer
Posts: 2
Joined: May 4th, 2007, 11:38 am

Post by i-want-dota »

not a chance because war3Map.j is the archive for all triggers for the map that its in (GUI and JASS) but is written in jass. when you make triggers in GUI it automaticaly makes the JASS "behind the sceens" in war3Map.j. All GUI does is make it easier for people to make triggers(and what i said above) so there is no "war3Map.gui"
User avatar
Xantan
Honorary wc3edit.net Traitor
Posts: 2507
Joined: February 1st, 2007, 4:11 pm
Location: NEVADA

Post by Xantan »

i-want-dota wrote:not a chance because war3Map.j is the archive for all triggers for the map that its in (GUI and JASS) but is written in jass. when you make triggers in GUI it automaticaly makes the JASS "behind the sceens" in war3Map.j. All GUI does is make it easier for people to make triggers(and what i said above) so there is no "war3Map.gui"


There is a war3map.wtg... but thats only for the editor, as you said the war3map.j is the only thing that actually means anything.
User avatar
thegreatgaara
Senior Member
Posts: 115
Joined: May 7th, 2007, 10:19 pm
Title: bunshinsaba!
Location: somewere in Canada -_-'

Post by thegreatgaara »

what do we do if there is no war3Map.j
User avatar
Xantan
Honorary wc3edit.net Traitor
Posts: 2507
Joined: February 1st, 2007, 4:11 pm
Location: NEVADA

Post by Xantan »

thegreatgaara wrote:what do we do if there is no war3Map.j


thats impossible unless the map has absolutely nothing in it.

Did you check \scripts? (the folder)
User avatar
Aero
Forum Staff
Posts: 829
Joined: January 28th, 2007, 8:10 pm
Title: JASS Programmer
Location: Canada

Post by Aero »

If there's no war3map.j, then it's not a wc3 map you're editing :)
bojanglemistser
Old Wrinkly Member
Posts: 238
Joined: March 2nd, 2007, 5:52 pm
Location: USA

Post by bojanglemistser »

thegreatgaara wrote:what do we do if there is no war3Map.j


he means if it doesnt show up in MPQMaster ive seen alot of maps like this and have managed to add cheats to em

What you do is u dl XDep from files.wc3edit.net
rename ur map to Mymap
put it in the same folder as XDep
Rename your map to Mymap
open XDep and wait for it to finish
after its done u will have a map called deprotected
it should now have a J file in MPQMaster
But dont open it and save in it or else everything gets deleted
There may be other ways to do this but this is how i do it
when life gives you lemons you use the lemon juice to squirt people in their eyes