Imported .j getting errors.

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

Manstie
Newcomer
Posts: 9
Joined: December 6th, 2009, 5:35 am

Imported .j getting errors.

Post by Manstie »

Hi,

I am currently trying to hack the map: Terrania v0.32

I extract the .j file from the map with a mpq editor.
I open it with JassCraft.
I add a trigger (the cheats activation trigger).
This is what I add:
Spoiler:
function Trig_Enable_Actions takes nothing returns nothing
set udg_CheatsEnabled[GetConvertedPlayerId(GetTriggerPlayer())] = true
call DisplayTextToPlayer((GetTriggerPlayer()), 0, 0, "Cheats Activated!")
endfunction
function InitTrig_Enable takes nothing returns nothing
set gg_trg_Enable = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable, Player(0), "-clearly hacked ", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable, Player(1), "-clearly hacked ", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable, Player(2), "-clearly hacked ", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable, Player(3), "-clearly hacked ", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable, Player(4), "-clearly hacked ", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable, Player(5), "-clearly hacked ", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable, Player(6), "-clearly hacked ", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable, Player(7), "-clearly hacked ", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable, Player(8), "-clearly hacked ", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable, Player(9), "-clearly hacked ", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable, Player(10), "-clearly hacked ", true )
call TriggerAddAction( gg_trg_Enable, function Trig_Enable_Actions )
endfunction

I add the globals.
This is what I add:
Spoiler:
trigger Enable=CreateTrigger()
boolean CheatsEnabled=false

I save the .j file.
I import the .j back into the file.
I go test.
I get .j file error.

I'm thinking it's something to do with "CheatsEnabled" being an array. I don't know much about using globals, but is there a way in globals to show that it is an array?

Or is there any other thing that makes it crash?

Thanks in advance.
User avatar
Bushido
Not an Admin, and Not Unique
Posts: 1880
Joined: March 1st, 2009, 12:30 pm
Title: Der Boss :D
Location: Germany

Re: Imported .j getting errors.

Post by Bushido »

That's not really a cheatpack, xD.
The commands are missing, nothing is triggered.
It's useless.
Download Senethior's tool package here!
[spoiler=Funny shit]
Kryptonyte wrote:Pew-pew, together, 2pac and I can take over the world. Muhahahahahaha.

Kryptonyte wrote:@2Pac, You're a G. Keep your pimp hand strong.

Kryptonyte wrote:anyways i gtg, PEACE, MR. ZOMG O SO PRO U RAWKZ0RZ SUM BoXZ()RZ


Code: Select all

(23:22:14) FatherSpace: BWAHAHA
(23:22:21) FatherSpace: I am 1337, you must fear my coolness.
(23:22:51) FatherSpace: I got bored, so I made a Python script so now whenever I open Terminal, I get a random haiku from here: http://www.smalltime.com/Haiku
(23:24:12) FatherSpace: afk... Killing myself. :(

Code: Select all

(03:52:56) ChatBot: (673237) logs into the Chat.
 (03:53:08) (673237): plzplzplz, im sorry about before.
 (03:53:26) FatherSpace: I'm sorry you were born.
(03:53:31) ChatBot: (673237) has been logged out (Kicked).

Code: Select all

(21:39:14) GeorgeMots: Jen are you there?
(21:39:44) 2Pac: ...lol?
(21:39:49) 2Pac: (21:22:22) ChatBot: UndeadxAssassin has been logged out (Timeout).
(21:39:52) GeorgeMots: w00t
(21:39:54) GeorgeMots: rofl
(21:39:58) GeorgeMots: *facepalm*
(21:39:59) 2Pac: you definetly fail
[/spoiler]
Get to know Bushido alias 2Pac alias King-Bushido!
User avatar
Ken
Spice Pirate
Posts: 862
Joined: January 29th, 2009, 5:35 pm
Title: LHC
Location: Canada

Re: Imported .j getting errors.

Post by Ken »

Both problems are in your globals. CheatsEnabled should be declared as "boolean array CheatsEnabled", and have a function that runs on map initialization to set all indexes (1-12) to false.

And also, Enabled should be declared as "trigger gg_trg_Enabled=null".
Spoiler:
xkiska wrote:BARTIMEAUS is more understandable then u
Senethior459 wrote:Wow, Dream Theatre reminds me of Dragonforce, but with real skill.
Ozzapoo wrote:We laughed, we cried. Trashed.
FatherSpace: You don't find smart chicks hawt?
GeorgeMots: not anymore, im fed up with that kind of girls
FatherSpace: lol
FatherSpace: What happened?
GeorgeMots: most smart girls find out that i date/do/see other girls....
FatherSpace: ...
FatherSpace: So monogamy is your enemy?
Bartimaeus: Hmm, well, I hope my sister hasn't been kidnapped.
FatherSpace: What happened, Bart?
Bartimaeus: She walked out of the house saying that she was going over to some friends, and it's been like two hours, and my mom is trying to get a hold of her, which she's been unable to.
Bartimaeus: I can also hear three car alarms going off.
GeorgeMots: how old is she?
Bartimaeus: I haven't a clue. Probably 17.
UndeadxAssassin: wut
AbusivePie: You don't know how old your sister is?
Bartimaeus: Nope.
UndeadxAssassin: Epic fail
GeorgeMots: is she cute??
Bartimaeus: So, uh, how about you get into the Christmas spirit and put that avatar on before I do it myself and take away your bloody avatar-changin' rights?
UndeadxAssassin: If I thought of a random one...
UndeadxAssassin: Like....
UndeadxAssassin: I'll get back to you on that
Manstie
Newcomer
Posts: 9
Joined: December 6th, 2009, 5:35 am

Re: Imported .j getting errors.

Post by Manstie »

FatherSpace wrote:Both problems are in your globals. CheatsEnabled should be declared as "boolean array CheatsEnabled", and have a function that runs on map initialization to set all indexes (1-12) to false.

And also, Enabled should be declared as "trigger gg_trg_Enabled=null".


Okay. Thank you! By the way, aren't boolean always false until set otherwise?
FFS! Not working... I give up...
Can you look over the triggers again to see whats wrong?
Yes, I did change the globals.
I'm using the MPQ editor from http://deprotect.nathanmx.com/ , will it make a difference?

Here's what I've done, with the changed globals.

Spoiler:
boolean array CheatsEnabled
trigger gg_trg_Enable=null
endglobals
//startcheats
function Trig_Enable_Actions takes nothing returns nothing
set udg_CheatsEnabled[GetConvertedPlayerId(GetTriggerPlayer())] = true
call DisplayTextToPlayer((GetTriggerPlayer()), 0, 0, "Cheats Activated!")
endfunction

function InitTrig_Enable takes nothing returns nothing
set gg_trg_Enable = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable, Player(0), "-clearly hacked ", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable, Player(1), "-clearly hacked ", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable, Player(2), "-clearly hacked ", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable, Player(3), "-clearly hacked ", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable, Player(4), "-clearly hacked ", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable, Player(5), "-clearly hacked ", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable, Player(6), "-clearly hacked ", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable, Player(7), "-clearly hacked ", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable, Player(8), "-clearly hacked ", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable, Player(9), "-clearly hacked ", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable, Player(10), "-clearly hacked ", true )
call TriggerAddAction( gg_trg_Enable, function Trig_Enable_Actions )
endfunction
//endcheats


Tupac Shakur wrote:That's not really a cheatpack, xD.
The commands are missing, nothing is triggered.
It's useless.


It's not meant to be a cheat pack SO FAR. I was just posting my activation string as an example of what I place into the .j file to cheat the map. The cheats will be added later. ;)
User avatar
Ken
Spice Pirate
Posts: 862
Joined: January 29th, 2009, 5:35 pm
Title: LHC
Location: Canada

Re: Imported .j getting errors.

Post by Ken »

Oh, I think I may have forgotten to mention... In the trigger actions, you're trying to set udg_CheatsEnabled, when it's declared without the udg_ prefix.

Also, do you have a call to the init from function main, or somewhere that runs on map initialization?
Spoiler:
xkiska wrote:BARTIMEAUS is more understandable then u
Senethior459 wrote:Wow, Dream Theatre reminds me of Dragonforce, but with real skill.
Ozzapoo wrote:We laughed, we cried. Trashed.
FatherSpace: You don't find smart chicks hawt?
GeorgeMots: not anymore, im fed up with that kind of girls
FatherSpace: lol
FatherSpace: What happened?
GeorgeMots: most smart girls find out that i date/do/see other girls....
FatherSpace: ...
FatherSpace: So monogamy is your enemy?
Bartimaeus: Hmm, well, I hope my sister hasn't been kidnapped.
FatherSpace: What happened, Bart?
Bartimaeus: She walked out of the house saying that she was going over to some friends, and it's been like two hours, and my mom is trying to get a hold of her, which she's been unable to.
Bartimaeus: I can also hear three car alarms going off.
GeorgeMots: how old is she?
Bartimaeus: I haven't a clue. Probably 17.
UndeadxAssassin: wut
AbusivePie: You don't know how old your sister is?
Bartimaeus: Nope.
UndeadxAssassin: Epic fail
GeorgeMots: is she cute??
Bartimaeus: So, uh, how about you get into the Christmas spirit and put that avatar on before I do it myself and take away your bloody avatar-changin' rights?
UndeadxAssassin: If I thought of a random one...
UndeadxAssassin: Like....
UndeadxAssassin: I'll get back to you on that
Manstie
Newcomer
Posts: 9
Joined: December 6th, 2009, 5:35 am

Re: Imported .j getting errors.

Post by Manstie »

What do I need to do on map initialization?