Switching between soundpacks in 1.40

Post Reply
User avatar
Jegue
Posts: 345
Joined: Fri Dec 09, 2011 2:55 pm
Location: Sao Luis, Maranhao, Brazil

Switching between soundpacks in 1.40

Post by Jegue »

How do I make this work in 1.40?

Code: Select all

bindCommand(keyboard0, make, "numpad6", TO, "exec("5150.cs");");
bindCommand(keyboard0, make, "numpad3", TO, "exec("BigMonkey.cs");");
I first tried to switch manually, typing exec("BigMonkey.cs"); in the console, but didn't work. I added the following lines at the beginning of each of the soundpacks .cs file:

Code: Select all

deleteObject(PlayChatMenu, ChatMenu, "Root Menu:");
deleteObject(CommandChatMenu, ChatMenu, "Command Menu");
Now it works when I execute manually, but I still receive "Error adding menu to PlayChatMenu". And why doesn't the bindCommand thing work here?
- <!>Tariq^
Image
perrinoia
Site Admin
Posts: 3732
Joined: Sun Jul 01, 2012 7:18 pm

Re: Switching between soundpacks in 1.40

Post by perrinoia »

DeleteObject() doesn't take multiple arguments:

Code: Select all

function modVoice()
{
    deleteObject(PlayChatMenu);
    deleteObject(CommandChatMenu);
    newObject(PlayChatMenu, ChatMenu, "Root Menu:");
    newObject(CommandChatMenu, ChatMenu, "Command Menu");
}
You need escape strings in your bound commands:

Code: Select all

bindCommand(keyboard0, make, "numpad6", TO, "modVoice(); exec(\"5150.cs\");");
bindCommand(keyboard0, make, "numpad3", TO, "modVoice(); exec(\"BigMonkey.cs\");");
Umm... Yeah... I think that should do it... Try that.
Image
User avatar
Jegue
Posts: 345
Joined: Fri Dec 09, 2011 2:55 pm
Location: Sao Luis, Maranhao, Brazil

Re: Switching between soundpacks in 1.40

Post by Jegue »

Still didn't work :|
- <!>Tariq^
Image
Groove
Posts: 218
Joined: Thu Apr 17, 2014 10:36 pm

Re: Switching between soundpacks in 1.40

Post by Groove »

Jegue wrote:How do I make this work in 1.40?

Code: Select all

bindCommand(keyboard0, make, "numpad6", TO, "exec("5150.cs");");
bindCommand(keyboard0, make, "numpad3", TO, "exec("BigMonkey.cs");");
I first tried to switch manually, typing exec("BigMonkey.cs"); in the console, but didn't work. I added the following lines at the beginning of each of the soundpacks .cs file:

Code: Select all

deleteObject(PlayChatMenu, ChatMenu, "Root Menu:");
deleteObject(CommandChatMenu, ChatMenu, "Command Menu");
Now it works when I execute manually, but I still receive "Error adding menu to PlayChatMenu". And why doesn't the bindCommand thing work here?
the 'error adding menu to playchatmenu' is because the version of 5150.cs that most people use has bad characters and lines that 1.40 doesn't like so it throws that error on those lines but overall still works

wouldn't be surprised if bigmonkey is the same
Post Reply