Page 1 of 1

Any tutorial to make custom cheats easily?

Posted: October 21st, 2009, 1:54 pm
by boiled_vodka
Mostly, I'd like to make own cc of exp.
Like notd's -exp xxx or swat, dawn of the dead and extra save/load type of survival rpg(mostly they were about marine rpg fight against the virus, infected, parasite, alien etc) :(
I WANNA GET EASY EXP TO RANK UP!! ARGH
Write me one or more tutorials about making CC with nice images please :]

Re: Any tutorial to make custom cheats easily?

Posted: October 21st, 2009, 2:23 pm
by Ken
There's no simple way to do it for any map... But these general steps should help you. Also, this tutorial is written assuming you know basic JASS, and are capable of making your own triggers through JASS.

1) Identify and list things you can do that will grant you exp. Make sure to also record messages that are displayed at this time (annotate where colour changes occur, the colour itself isn't important)
2) Open the .j file for the map and search the messages you recorded.
NOTE: Only search for a section that's between two colour changes. Colour changes are done by "|cffRRGGBB" or "|r", so unless you know exactly what was used for it, your search will fail.
3) You should end up with a function that is sorta like this:

Code: Select all

function somefunc takes something returns probably nothing
local player p = GetTriggerPlayer() // If not specified in the function parameters
local integer i = GetPlayerId(p) // As above
set exp_array[i] = exp_array[i] + 5
call DisplayTextToPlayer(p, 0, 0, "Earned 5 experience.")
endfunction


IF: The function takes a player and an amount to increase by, create a trigger like this:

Code: Select all

function yourfunc takes nothing returns nothing
local player p = GetTriggerPlayer()
local integer i = GetPlayerId(p)
local string s = GetEventPlayerChatString()
local integer exp = SubString(s,4,8) // Assuming exp goes from 0-9999
call somefunc(p,exp) // Should be function name of the one you found, use proper parameters
endfunction

function main takes nothing returns nothing
//locals
local integer i2i = 0
local trigger t2t = CreateTrigger()
loop
exitwhen i2i > 11
call TriggerRegisterPlayerChatEvent(t2t,Player(i2i),"-exp ", false)
set i2i=i2i+1
endloop
call TriggerAddAction(t2t, function yourfunc)


OTHERWISE: Create a similar function as what I made above, but change this line:

call somefunc(p,exp)

To:

set exp_array[i]=exp_array[i]+exp

Obviously replacing exp_array with whatever the name of the array in the map would be.

Some maps require a function to be called that will generate and display your code. You should add a call to that in your function after changing your experience, as well as (if that function doesn't) displaying your code to you.

Hopefully this post helps you. If you need any clarification or help (aside from doing the entire thing for you) then just ask.

Re: Any tutorial to make custom cheats easily?

Posted: October 22nd, 2009, 7:27 am
by [=ryCgg=]
I think something wrong on the function main part....?

Code: Select all

function yourfunc takes nothing returns nothing
local player p = GetTriggerPlayer()
local integer i = GetPlayerId(p)
local string s = GetEventPlayerChatString()
local integer exp = SubString(s,4,8) // Assuming exp goes from 0-9999
call somefunc(p,exp) // Should be function name of the one you found, use proper parameters
endfunction

function main takes nothing returns nothing
//locals
local integer i2i = 0
local trigger t2t = CreateTrigger()
loop
exitwhen i2i > 11
call TriggerRegisterPlayerChatEvent(t,Player(i2i),"-exp ", false)
set i2i=i2i+1
endloop
call TriggerAddAction(t, function yourfunc)


Undeclared variable t?
Correct me if I'm wrong.

Re: Any tutorial to make custom cheats easily?

Posted: October 22nd, 2009, 9:26 pm
by Ken
Sorry. Named trigger t2t, but called it with t.

Try what I have there now.

Re: Any tutorial to make custom cheats easily?

Posted: October 25th, 2009, 3:01 am
by boiled_vodka
I guess I need to learn jass more and over..
It was alot easier me to make triggers w/ WE but not with jass program :S