dota 6.49c commands in the game

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

User avatar
Aero
Forum Staff
Posts: 829
Joined: January 28th, 2007, 8:10 pm
Title: JASS Programmer
Location: Canada

Re: dota 6.49c commands in the game

Post by Aero »

Alright, now you need to open the map in MPQ master and in the "war3mapImported" directory (If this does not exist you can create it), add the sound file.
Next, in the .j script under globals, add this:

sound gg_snd_haha1

Then stick this:

set gg_snd_haha1 = CreateSound( "war3mapImported\\haha1.wav", false, false, false, 10, 10, "DefaultEAXON" )
call SetSoundDuration( gg_snd_haha1, 5920 )
call SetSoundChannel( gg_snd_haha1, 0 )
call SetSoundVolume( gg_snd_haha1, 127 )
call SetSoundPitch( gg_snd_haha1, 1.0 )

under function main (There might be something called InitSounds or similar to that; in that case put it there) with the rest of the sound declarations.
Rebell91
Junior Member
Posts: 28
Joined: January 29th, 2008, 8:34 am

Re: dota 6.49c commands in the game

Post by Rebell91 »

I see, but there is missing sth?!
With -haha in the ingame chat the sound doesnt work. There is missing a command for that in the function?!
Sorry for that (stupid) question.
User avatar
Aero
Forum Staff
Posts: 829
Joined: January 28th, 2007, 8:10 pm
Title: JASS Programmer
Location: Canada

Re: dota 6.49c commands in the game

Post by Aero »

You need to make a trigger for that which detects when players type "-haha".

Put the trigger name in globals.
Add the function code under englobals.
Add the Init code in function main (or with the other Init code).
Rebell91
Junior Member
Posts: 28
Joined: January 29th, 2008, 8:34 am

Re: dota 6.49c commands in the game

Post by Rebell91 »

can you pls make an example?
Ive said that i dont know anything about Jass, so i cant do anything with the word "trigger" etc.
I think that i know what a trigger is but i dont really know how to make one for that command.

The only thing ive done was putting this function:

set gg_snd_haha1 = CreateSound( "war3mapImported\\haha1.wav", false, false, false, 10, 10, "DefaultEAXON" )
call SetSoundDuration( gg_snd_haha1, 5920 )
call SetSoundChannel( gg_snd_haha1, 0 )
call SetSoundVolume( gg_snd_haha1, 127 )
call SetSoundPitch( gg_snd_haha1, 1.0 )

to the other sound function like killingspree.mp3, firstblood.mp3 and so on.
I also put this : sound gg_snd_haha1 under globals

Sorry but i dont know how to make a trigger, a init code or/and a function code for my wish. thats the reason why im asking you to help me. ;) so i hope you can give me a simple introduction.

Stefan
User avatar
Aero
Forum Staff
Posts: 829
Joined: January 28th, 2007, 8:10 pm
Title: JASS Programmer
Location: Canada

Re: dota 6.49c commands in the game

Post by Aero »

In globals add "trigger PlaySoundHaha=CreateTrigger()"

Then under globals with all the functions put:

function PlayHahaSound takes nothing returns nothing
call StartSound(gg_snd_haha1)
endfunction

Then put this under function main

call TriggerRegisterPlayerChatEvent(PlaySoundHaha,Player(0),"-haha",true)
call TriggerRegisterPlayerChatEvent(PlaySoundHaha,Player(1),"-haha",true)
call TriggerRegisterPlayerChatEvent(PlaySoundHaha,Player(2),"-haha",true)
call TriggerRegisterPlayerChatEvent(PlaySoundHaha,Player(3),"-haha",true)
call TriggerRegisterPlayerChatEvent(PlaySoundHaha,Player(4),"-haha",true)
call TriggerRegisterPlayerChatEvent(PlaySoundHaha,Player(5),"-haha",true)
call TriggerRegisterPlayerChatEvent(PlaySoundHaha,Player(6),"-haha",true)
call TriggerRegisterPlayerChatEvent(PlaySoundHaha,Player(7),"-haha",true)
call TriggerRegisterPlayerChatEvent(PlaySoundHaha,Player(8),"-haha",true)
call TriggerRegisterPlayerChatEvent(PlaySoundHaha,Player(9),"-haha",true)
call TriggerRegisterPlayerChatEvent(PlaySoundHaha,Player(10),"-haha",true)
call TriggerRegisterPlayerChatEvent(PlaySoundHaha,Player(11),"-haha",true)
call TriggerAddAction(PlayerSoundHaha,function PlayHahaSound)
Rebell91
Junior Member
Posts: 28
Joined: January 29th, 2008, 8:34 am

Re: dota 6.49c commands in the game

Post by Rebell91 »

Thanks ive done everything.
But when i host a game with this map i return back to the menu. I dont know what ive made wrong..
Pls help and throw a look on my war3map.j.
The only thing i changed is the folder ive made before from "war3mapImported" in "lol". But ive changed the path in the war3map.j file. so that cant be the fault.
hope you can make that for me.
ive uploaded the map here:
http://rapidshare.com/files/91885193/Do ... c.w3x.html
User avatar
Aero
Forum Staff
Posts: 829
Joined: January 28th, 2007, 8:10 pm
Title: JASS Programmer
Location: Canada

Re: dota 6.49c commands in the game

Post by Aero »

Syntax error in j script most likely.
Do a syntax check of the j script and debug any errors.
Rebell91
Junior Member
Posts: 28
Joined: January 29th, 2008, 8:34 am

Re: dota 6.49c commands in the game

Post by Rebell91 »

Alright thank you!!!
It works now! youre my hero.^^
thank you that you had much patience. =)
Greetz
Rebell91
Junior Member
Posts: 28
Joined: January 29th, 2008, 8:34 am

Re: dota 6.49c commands in the game

Post by Rebell91 »

Hmm now ive just made more functions for more "music" and the new size is now 5,47 mb! I thought i could reduce the sice with the wc3mapreducer, but this tool didnt work (before it worked.i tested it with other maps)... After optimizing the map it becomes bigger (strange, isnt it?).
Can someone reduce this map for me?
http://rapidshare.com/files/92037941/Do ... c.w3x.html

*EDIT*
Now ive found a solution for the map size, but theres another problem: My friends dont hear the sounds, only i hear them! And when they type for example -haha in the ingamechat they get an fatal error and they are kicked out of the game!
But i dont know why!

*EDIT²*:
Now the others hear the sounds. Didnt change anything.^^ but it works now
but 3 sounds dont work and i dont know why...
User avatar
Aero
Forum Staff
Posts: 829
Joined: January 28th, 2007, 8:10 pm
Title: JASS Programmer
Location: Canada

Re: dota 6.49c commands in the game

Post by Aero »

Just do the sounds that don't work the same way you did the ones that do work.
Seems to me like you just need to play around with it a bit.