wc3edit.net

United Warcraft 3 map hacking!
It is currently April 25th, 2024, 7:19 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: inserting jass commands
PostPosted: July 17th, 2009, 10:02 pm 
Offline
Super Moderator
User avatar

Joined: February 24th, 2009, 1:31 pm
Posts: 3815
Location: JEW LAND
dunno if im the right section. if not move please.

if i have a map. say example a footmen of somekind.
i open the war3map.j file with jass craft. and i want to ADD a few triggers.

lets say player 4 (purple) will get 200% XP rate if he will write "-more xp please!" (real command is in spoiler)
Spoiler:
function Trig_more_xp_command_Actions takes nothing returns nothing
call SetPlayerHandicapXPBJ( Player(3), 200.00 )
endfunction

//===========================================================================
function InitTrig_more_xp_command takes nothing returns nothing
set gg_trg_more_xp_command = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_more_xp_command, Player(3), "-more xp please!", true )
call TriggerAddAction( gg_trg_more_xp_command, function Trig_more_xp_command_Actions )
endfunction


so where do i put this command? i open jasscraft. and i have no idea where to place it... after globals? after the "endglobals"

and stuff like that.

thanks in advance
haxorico

_________________
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: July 20th, 2009, 3:22 am 
Offline
Some Honorary Title

Joined: June 8th, 2007, 5:08 am
Posts: 1781
Title: Angry Bird
//under globals
trigger gg_trg_more_xp_command=null
[line][/line]
//under endglobal
function Trig_more_xp_command_Actions takes nothing returns nothing
call SetPlayerHandicapXPBJ( Player(3), 200.00 )
endfunction
function InitTrig_more_xp_command takes nothing returns nothing
set gg_trg_more_xp_command = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_more_xp_command, Player(3), "-more xp please!", true )
call TriggerAddAction( gg_trg_more_xp_command, function Trig_more_xp_command_Actions )
endfunction
[line][/line]
//under function main, after locals
call InitTrig_more_xp_command()


Top
 Profile  
 
PostPosted: July 21st, 2009, 9:53 pm 
Offline
Super Moderator
User avatar

Joined: February 24th, 2009, 1:31 pm
Posts: 3815
Location: JEW LAND
initialD wrote:
//under globals
trigger gg_trg_more_xp_command=null
[line][/line]
//under endglobal
function Trig_more_xp_command_Actions takes nothing returns nothing
call SetPlayerHandicapXPBJ( Player(3), 200.00 )
endfunction
function InitTrig_more_xp_command takes nothing returns nothing
set gg_trg_more_xp_command = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_more_xp_command, Player(3), "-more xp please!", true )
call TriggerAddAction( gg_trg_more_xp_command, function Trig_more_xp_command_Actions )
endfunction
[line][/line]
//under function main, after locals
call InitTrig_more_xp_command()


wow great! thanks!

1 more question tho.

but i have a new problem now :<
i tried making the function above for all players. not only for player 3. (i did it in GUI and converted it to jass)
but it takes a trigger for each player.. how can i make this trigger avilable for all players. and only the triggering unit's heroes will be effected.

_________________
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: July 22nd, 2009, 1:01 am 
Offline
Spice Pirate
User avatar

Joined: January 29th, 2009, 5:35 pm
Posts: 949
Location: Canada
Title: LHC
//under globals
trigger gg_trg_more_xp_command=null
[line][/line]
//under endglobal
function Trig_more_xp_command_Actions takes nothing returns nothing
call SetPlayerHandicapXPBJ( GetTriggerPlayer(), 200.00 )
endfunction
function InitTrig_more_xp_command takes nothing returns nothing
local integer ii = 0
set gg_trg_more_xp_command = CreateTrigger( )
loop
exitwhen ii > 11
call TriggerRegisterPlayerChatEvent( gg_trg_more_xp_command, Player(ii), "-more xp please!", true )
set ii = ii + 1
endloop
call TriggerAddAction( gg_trg_more_xp_command, function Trig_more_xp_command_Actions )
endfunction
[line][/line]
//under function main, after locals
call InitTrig_more_xp_command()

That, or just copy the line inside of the loop (removing the integer and loop), replacing "ii" with the numbers 0 through 11.

As InitialD said elsewhere, what I've done is less coding, but slower.

_________________
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.
Quote:
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?
Quote:
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??
Quote:
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?
Quote:
UndeadxAssassin: If I thought of a random one...
UndeadxAssassin: Like....
UndeadxAssassin: I'll get back to you on that


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 25 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)