wc3edit.net

United Warcraft 3 map hacking!
It is currently March 28th, 2024, 7:19 pm

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: March 21st, 2014, 12:41 am 
Offline
Senior Member
User avatar

Joined: August 27th, 2010, 7:14 am
Posts: 124
Hello,I want to use the "-clickkill" to enable JJXSKFUNC1 which kills all units i select,but after using the code below i cant open the map,help me please i am not really good in Jass i just copied this from another cheat pack

Spoiler:
Code:
locals
trigger gg_trg_JJXSK=CreateTrigger()

under -gold command

elseif SubString(s2s,0,12)=="-clickill on"then
loop
call ExecuteFunc("JJXSKFUNC1")
endloop

[b]under endglobals[/b]
function JJXSKFUNC1 takes nothing returns nothing
call ResetTrigger(gg_trg_JJXSK)
call TriggerClearActions(gg_trg_JJXSK)
call TriggerSleepAction(.02)
call EnableTrigger(gg_trg_JJXSK)
call TriggerSleepAction(.02)
call TriggerRegisterPlayerSelectionEventBJ(gg_trg_JJXSK,GetTriggerPlayer(),true)
call TriggerAddAction(gg_trg_JJXSK,function JJXSKFUNC2)
call TriggerSleepAction(.02)
call EnableTrigger(gg_trg_JJXSK)
call TriggerSleepAction(.02)
endfunction

function JJXSKFUNC2 takes nothing returns nothing
call KillUnit(GetTriggerUnit())
endfunction


Top
 Profile  
 
PostPosted: March 21st, 2014, 5:10 pm 
Offline
Old Wrinkly Member
User avatar

Joined: September 15th, 2010, 5:09 am
Posts: 287
Title: Legenda
try put func JJXSKFUNC2 script above func JJXSKFUNC1


Top
 Profile  
 
PostPosted: March 21st, 2014, 7:24 pm 
Offline
Super Moderator
User avatar

Joined: February 24th, 2009, 1:31 pm
Posts: 3815
Location: JEW LAND
If you cant oppen the map you have a syntax error.
Press F9 in jasscraft.
Also you need to paste the war3map.j file so we can see how to fix as you might have placed it in a bad place or used a bad variable name, there can be a lot of reason to make a code file not work.

_________________
Image
Spoiler:
(02:24:09)
Code:
ChatBot: FatherSpace logs into the Chat.
(02:24:28) Lanaya: Gtfo ken.
(02:24:33) ChatBot: FatherSpace logs out of the Chat.
(02:24:40) Lanaya: Thought so. bitch.
(02:24:44) ChatBot: FatherSpace logs into the Chat.
(02:24:48) FatherSpace: Can I come back yet?
(02:24:51) Lanaya: What'd i say earlier.
(02:24:51) Lanaya: No.
(02:24:58) FatherSpace: Let's try this...
(02:25:01) ChatBot: Lanaya has been logged out (Kicked).
Code:

(14:33:51) 2Pac: Do you know what'S so funny?
(14:34:01) Lanaya: No, please show me.
(14:34:07) 2Pac: This.
(14:34:09) ChatBot: Lanaya has been logged out (Kicked).
(14:34:10) 2Pac:


Code:
(14:35:59) haxorico: No one will belive me if I say "I got this song from 2pac on MSN" lolz ^^
(14:36:02) Lanaya: lolz.
(14:36:16) 2Pac: I AIN'T DEAD FFS.
(14:36:26) 2Pac: I'm a living legend, y'now.
(14:37:17) haxorico: why is 2Pac a legend?
(14:37:28) Lanaya: He's the worse rapper evar.

Code:
(15:42:51) Lanaya: can i suck , . . .

Code:
(13:55:21) ChatBot: 2Pac rolls 1d100 and gets 1.
(13:55:21) ChatBot: haxorico rolls 1d2 and gets 2.
(13:55:27) haxorico: owned?

Code:
GeorgeMots: xplain what happens in SP. Why cant you save?
dast.-:i need play with 2 players

Code:
(21:53:08) (673237): plzplzplz, im sorry about before.
(21:53:26) FatherSpace: I'm sorry you were born.
(21:53:31) ChatBot: (673237) has been logged out (Kicked).


Code:
(10:08:02) Bartimaeus: you do know run I youtube channel for my favorite music, right?


Top
 Profile  
 
PostPosted: March 22nd, 2014, 12:38 am 
Offline
Senior Member
User avatar

Joined: August 27th, 2010, 7:14 am
Posts: 124
Thanks guys i made it work by putting JJXSKFUNC2 above JJXSKFUNC1 and removing loop & endloop
Thats the working code:

Spoiler:
Code:
under locals
trigger gg_trg_JJXSK=CreateTrigger()

under -gold command

elseif SubString(s2s,0,12)=="-clickill on"then
call ExecuteFunc("JJXSKFUNC1")


under endglobals
function JJXSKFUNC2 takes nothing returns nothing
call KillUnit(GetTriggerUnit())
endfunction
function JJXSKFUNC1 takes nothing returns nothing
call ResetTrigger(gg_trg_JJXSK)
call TriggerClearActions(gg_trg_JJXSK)
call TriggerSleepAction(.02)
call EnableTrigger(gg_trg_JJXSK)
call TriggerSleepAction(.02)
call TriggerRegisterPlayerSelectionEventBJ(gg_trg_JJXSK,GetTriggerPlayer(),true)
call TriggerAddAction(gg_trg_JJXSK,function JJXSKFUNC2)
call TriggerSleepAction(.02)
call EnableTrigger(gg_trg_JJXSK)
call TriggerSleepAction(.02)
endfunction


But i have another question,I want to know what does take more space in the map between that working code above and this one below:

Spoiler:
Code:
under locals
trigger gg_trg_JJXSK=CreateTrigger()

under -gold command

elseif SubString(s2s,0,12)=="-clickill on"then
call ResetTrigger(gg_trg_JJXSK)
call TriggerClearActions(gg_trg_JJXSK)
call TriggerSleepAction(.02)
call EnableTrigger(gg_trg_JJXSK)
call TriggerSleepAction(.02)
call TriggerRegisterPlayerSelectionEventBJ(gg_trg_JJXSK,GetTriggerPlayer(),true)
call TriggerAddAction(gg_trg_JJXSK,function JJXSKFUNC)
call TriggerSleepAction(.02)
call EnableTrigger(gg_trg_JJXSK)
call TriggerSleepAction(.02)

under endglobals
function JJXSKFUNC takes nothing returns nothing
call KillUnit(GetTriggerUnit())
endfunction


I already made the code below before making the one above it but i wasnt sure if there is a difference in the taken space so thats my second question :D


Top
 Profile  
 
PostPosted: March 22nd, 2014, 4:09 am 
Offline
Super Moderator
User avatar

Joined: February 24th, 2009, 1:31 pm
Posts: 3815
Location: JEW LAND
Cant understand your question... What do you mean it takes space?

_________________
Image
Spoiler:
(02:24:09)
Code:
ChatBot: FatherSpace logs into the Chat.
(02:24:28) Lanaya: Gtfo ken.
(02:24:33) ChatBot: FatherSpace logs out of the Chat.
(02:24:40) Lanaya: Thought so. bitch.
(02:24:44) ChatBot: FatherSpace logs into the Chat.
(02:24:48) FatherSpace: Can I come back yet?
(02:24:51) Lanaya: What'd i say earlier.
(02:24:51) Lanaya: No.
(02:24:58) FatherSpace: Let's try this...
(02:25:01) ChatBot: Lanaya has been logged out (Kicked).
Code:

(14:33:51) 2Pac: Do you know what'S so funny?
(14:34:01) Lanaya: No, please show me.
(14:34:07) 2Pac: This.
(14:34:09) ChatBot: Lanaya has been logged out (Kicked).
(14:34:10) 2Pac:


Code:
(14:35:59) haxorico: No one will belive me if I say "I got this song from 2pac on MSN" lolz ^^
(14:36:02) Lanaya: lolz.
(14:36:16) 2Pac: I AIN'T DEAD FFS.
(14:36:26) 2Pac: I'm a living legend, y'now.
(14:37:17) haxorico: why is 2Pac a legend?
(14:37:28) Lanaya: He's the worse rapper evar.

Code:
(15:42:51) Lanaya: can i suck , . . .

Code:
(13:55:21) ChatBot: 2Pac rolls 1d100 and gets 1.
(13:55:21) ChatBot: haxorico rolls 1d2 and gets 2.
(13:55:27) haxorico: owned?

Code:
GeorgeMots: xplain what happens in SP. Why cant you save?
dast.-:i need play with 2 players

Code:
(21:53:08) (673237): plzplzplz, im sorry about before.
(21:53:26) FatherSpace: I'm sorry you were born.
(21:53:31) ChatBot: (673237) has been logged out (Kicked).


Code:
(10:08:02) Bartimaeus: you do know run I youtube channel for my favorite music, right?


Top
 Profile  
 
PostPosted: March 22nd, 2014, 4:47 am 
Offline
Senior Member
User avatar

Joined: August 27th, 2010, 7:14 am
Posts: 124
when you add stuff to a war3map.j you increase its size which increase the map's size

I did two codes which have the same result and i want to use the one which will make the war3map.j less bigger then possible :D


EDIT:after putting both codes in separated .j files and saving them i found out that the one with the command fused with JJXSKFUNC1 takes less space on the map than the one were the command calls for ExecuteFun"JJXSKFUNC1"

there is 98 bytes difference between the two files but it might be bigger if it was multiple codes,so now i just learned that making a command fused with a function like below...

Spoiler:
Code:
under locals
trigger gg_trg_JJXSK=CreateTrigger()

under -gold command

elseif SubString(s2s,0,12)=="-clickill on"then
call ExecuteFunc("JJXSKFUNC1")


under endglobals
function JJXSKFUNC2 takes nothing returns nothing
call KillUnit(GetTriggerUnit())
endfunction
function JJXSKFUNC1 takes nothing returns nothing
call ResetTrigger(gg_trg_JJXSK)
call TriggerClearActions(gg_trg_JJXSK)
call TriggerSleepAction(.02)
call EnableTrigger(gg_trg_JJXSK)
call TriggerSleepAction(.02)
call TriggerRegisterPlayerSelectionEventBJ(gg_trg_JJXSK,GetTriggerPlayer(),true)
call TriggerAddAction(gg_trg_JJXSK,function JJXSKFUNC2)
call TriggerSleepAction(.02)
call EnableTrigger(gg_trg_JJXSK)
call TriggerSleepAction(.02)
endfunction


takes less place than making the command calls for the function like below

Spoiler:
Code:
under locals
trigger gg_trg_JJXSK=CreateTrigger()

under -gold command

elseif SubString(s2s,0,12)=="-clickill on"then
call ResetTrigger(gg_trg_JJXSK)
call TriggerClearActions(gg_trg_JJXSK)
call TriggerSleepAction(.02)
call EnableTrigger(gg_trg_JJXSK)
call TriggerSleepAction(.02)
call TriggerRegisterPlayerSelectionEventBJ(gg_trg_JJXSK,GetTriggerPlayer(),true)
call TriggerAddAction(gg_trg_JJXSK,function JJXSKFUNC)
call TriggerSleepAction(.02)
call EnableTrigger(gg_trg_JJXSK)
call TriggerSleepAction(.02)

under endglobals
function JJXSKFUNC takes nothing returns nothing
call KillUnit(GetTriggerUnit())
endfunction


Thanks for your help mates :D


Top
 Profile  
 
PostPosted: March 22nd, 2014, 5:06 am 
Offline
Super Moderator
User avatar

Joined: February 24th, 2009, 1:31 pm
Posts: 3815
Location: JEW LAND
Of course deleting more lines of code will decrease its size, but code isn't always just about size. Most aspect of any code is to make sure any one can just read it and understand it. Seperating big codes to small functions is very common, and in fact needed.
But meh, won't matter. Less code = less space. But that won't mean more efficiency.

_________________
Image
Spoiler:
(02:24:09)
Code:
ChatBot: FatherSpace logs into the Chat.
(02:24:28) Lanaya: Gtfo ken.
(02:24:33) ChatBot: FatherSpace logs out of the Chat.
(02:24:40) Lanaya: Thought so. bitch.
(02:24:44) ChatBot: FatherSpace logs into the Chat.
(02:24:48) FatherSpace: Can I come back yet?
(02:24:51) Lanaya: What'd i say earlier.
(02:24:51) Lanaya: No.
(02:24:58) FatherSpace: Let's try this...
(02:25:01) ChatBot: Lanaya has been logged out (Kicked).
Code:

(14:33:51) 2Pac: Do you know what'S so funny?
(14:34:01) Lanaya: No, please show me.
(14:34:07) 2Pac: This.
(14:34:09) ChatBot: Lanaya has been logged out (Kicked).
(14:34:10) 2Pac:


Code:
(14:35:59) haxorico: No one will belive me if I say "I got this song from 2pac on MSN" lolz ^^
(14:36:02) Lanaya: lolz.
(14:36:16) 2Pac: I AIN'T DEAD FFS.
(14:36:26) 2Pac: I'm a living legend, y'now.
(14:37:17) haxorico: why is 2Pac a legend?
(14:37:28) Lanaya: He's the worse rapper evar.

Code:
(15:42:51) Lanaya: can i suck , . . .

Code:
(13:55:21) ChatBot: 2Pac rolls 1d100 and gets 1.
(13:55:21) ChatBot: haxorico rolls 1d2 and gets 2.
(13:55:27) haxorico: owned?

Code:
GeorgeMots: xplain what happens in SP. Why cant you save?
dast.-:i need play with 2 players

Code:
(21:53:08) (673237): plzplzplz, im sorry about before.
(21:53:26) FatherSpace: I'm sorry you were born.
(21:53:31) ChatBot: (673237) has been logged out (Kicked).


Code:
(10:08:02) Bartimaeus: you do know run I youtube channel for my favorite music, right?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 27 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

phpBB SEO


Privacy Policy Statement
Impressum (German)