Page 1 of 1

How to add my own cheats[Tutorial]

Posted: February 15th, 2007, 6:16 pm
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

Posted: March 2nd, 2007, 3:45 am
by Kala-cha
Could yah make this in GUI instead?

Posted: May 12th, 2007, 9:05 am
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"

Posted: May 12th, 2007, 12:40 pm
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.

Posted: May 14th, 2007, 12:41 am
by thegreatgaara
what do we do if there is no war3Map.j

Posted: May 14th, 2007, 1:35 am
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)

Posted: May 14th, 2007, 1:52 am
by Aero
If there's no war3map.j, then it's not a wc3 map you're editing :)

Posted: May 24th, 2007, 11:04 pm
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

Re: How to add my own cheats[Tutorial]

Posted: July 27th, 2024, 4:21 am
by DreadLordXXX
Can someone explain the mongrel language in step 3? It literally makes no sense...

Re: How to add my own cheats[Tutorial]

Posted: September 28th, 2024, 12:48 pm
by devoltz
DreadLordXXX wrote: July 27th, 2024, 4:21 am Can someone explain the mongrel language in step 3? It literally makes no sense...
viewtopic.php?t=34777