Page 1 of 1

Switching between soundpacks in 1.40

Posted: Fri Dec 30, 2016 5:21 pm
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?

Re: Switching between soundpacks in 1.40

Posted: Fri Dec 30, 2016 9:33 pm
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.

Re: Switching between soundpacks in 1.40

Posted: Wed Jan 18, 2017 2:27 pm
by Jegue
Still didn't work :|

Re: Switching between soundpacks in 1.40

Posted: Mon Feb 13, 2017 2:07 am
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