Page 1 of 1

Macro to alter /emit

Posted: Mon Jul 26, 2010 5:39 pm
by JonathanTheBlack
I'm trying to create a macro to alter the properties of /emit, and use an input box/dialog to enter the text, but is there a way to use a larger text box other than just one line?

Re: Macro to alter /emit

Posted: Mon Jul 26, 2010 6:18 pm
by biodude
Not without using a different approach.
If you use a dialog for input, with a textarea as part of an HTML form, then you can have multi-line input. There are a few examples in the user creations forum. The biggest difference is that dialog doe not interrupt macro execution (unlike the [wfunc]input[/wfunc] function), and you have to have a processing macro to which the html form is submitted, that does something with the input. Different model, but you can accomplish much the same thing.

Keep in mind that /emit and other "slash commands" are tricky to use in macros: they have to be the very first thing in a macro, and that macro can not be called by another macro (so the slash command must be the first thing in a macro chain). Otherwise, they won't work.
Unless, you want to 'fake' the emit function, which shouldn't be too hard and probably safer and even more powerful overall.

Re: Macro to alter /emit

Posted: Mon Jul 26, 2010 6:19 pm
by Raoden
biodude wrote:Unless, you want to 'fake' the emit function, which shouldn't be too hard and probably safer and even more powerful overall.

And you can see an example of how to do it if you look at the code for Rumble's Speak For Me tool.