Forums Index >> General >> Hotkeys...Macros....How do you set them up?
Page : <1> :
Hey Freedom,
Just paste the following lines at the bottom of your main.cs file:
if (!$server::dedicated) {
moveMap.bindCmd(keyboard, "1", "", "commandToServer('messageSent', "baaaaaaaa");");
moveMap.bindCmd(keyboard, "2", "", "commandToServer('messageSent', "woot");");
moveMap.bindCmd(keyboard, "3", "", "commandToServer('messageSent', "/ pass");");
moveMap.bindCmd(keyboard, "4", "", "commandToServer('messageSent', "/ kill me");");
}
Then just hit the keys 1-4 during the game!
-Rx
Will this work on Mac too?
Last edited: Saturday, January 15, 2005 at 10:14:34 PM
Hey again,
When I put it in my Main.cs file Nothing Happens...
I don't know what I am doing wrong... :S
Any Clues? :o
Make sure that you cut & paste each line seperately. If you cut & paste everything that RX posted together the lines will wrap in your text editor. The lines should appear exactly as they do in his post. Don't miss the curly bracket at the bottom either.
Last edited: Sunday, January 16, 2005 at 9:52:04 AM
I copied and pasted them all seperate...even the Curly braket...But to no avail... :'(
By any chance could I be putting it in the wrong main file...??
is it the "main.cs.dso"?
or "main.cs"?
and where does the main file go? So I know if its in the right palce...
Last edited: Sunday, January 16, 2005 at 11:27:29 AM
Guess it's Mac only,it ain't working for me,and I know I got it right.
It's missing letters. This forum takes certain letters away.
You don't have to let go of one rope before grabbing the other. But you'll have to let go of one if you want to swing forward.
It should go like this. And this should be on Modding area...
You don't have to let go of one rope before grabbing the other. But you'll have to let go of one if you want to swing forward.
I think it is like others have said, copying code directly from a post can introduce hidden characters.
Here is a text file with the text in it. Hope this works better!
Also, in my example, the 2nd two messages are team chat messages. This is a result of putting a "/ " before the chat text.
The main.cs is located in the Resources folder.
-Rx
Last edited: Sunday, January 16, 2005 at 1:00:51 PM
Awesome it worked, Thank you Rx!
Wow,
For some reason it wont work...
What ami doing wrong...this is my Main file,
// Display an error message for unused arguments
for ($I = 1; $I < $Game::argc; $I++) {
if (!$argUsed[$I])
error("Error: Unkown command line argument: " @ $Game::argv[$I]);
If (!$server::dedicated) {
moveMap.bindCmd(keyboard, "1", "", "commandToServer('messageSent', "Baaaa!");");
moveMap.bindCmd(keyboard, "2", "", "commandToServer('messageSent', "Poison Style!");");
moveMap.bindCmd(keyboard, "3", "", "commandToServer('messageSent', "/ pass");");
moveMap.bindCmd(keyboard, "4", "", "commandToServer('messageSent', "/ kill me");");
}
Is that right? (I changed some of the Messages would that matter?)
An anxious Person, ;)
Freedom
Last edited: Sunday, January 16, 2005 at 2:41:22 PM
Freedom,
You are missing a little close bracket thingy right before the hotkey text:
// Display an error message for unused arguments
for ($I = 1; $I < $Game::argc; $I++) {
if (!$argUsed[$I])
error("Error: Unkown command line argument: " @ $Game::argv[$I]);
}
PASTE HERE
I tried that...i added it...but still no hotkeys... :'(
My main file is in the Product folder is that the right one?
or what am I doing wrong?
Freedom, I forgot if you are on a Mac or PC.
For the Mac, find your TT application. Right-click on it and select "Show Package Contents". Then double-click on the Contents Folder, and then double-click on the Resources folder. Your "main.cs" will be right there!
-Rx
@ Freedom
I got your email addy from your profile & sent you the command lines that I use for hotkeys. I've sent the files to others on both PC and Mac & they work fine if you cut & past them to the bottom of the main.cs file. They're a bit different than what RX posted, but the result is the same. Note that messages preceeded by a / and space will only be seen by team members if you are on a server that supports team chat & messages without the forward slash will be seen by all.
Hope this works!
MP
PS:
Here's what the bottom of my main.cs file looks like:
// Display an error message for unused arguments
for ($I = 1; $I < $Game::argc; $I++) {
if (!$argUsed[$I])
error("Error: Unkown command line argument: " @ $Game::argv[$I]);
}
GlobalActionMap.bindCmd(mouse, button1, "","commandToServer('messageSent',"/ <<PASS!!>>"); ");
Last edited: Sunday, January 16, 2005 at 5:53:58 PM
I think I've discovered what's going on here:
For some reason when you post here if there is a backslash character it gets deleted, which will result in the command line not working. There is supposed to be a backslash ("") after 'messageSent',. If you use the text file that RX linked to, or you copy & paste from the email I sent it should work. If you copy & pasted from the posts here, the backslash character is missing.
@ Rx,
I Have a PC...
@ MP, I shall try yours now... Hope it all works...
@ MP
Hmm...I tried and STILL TO NO AVAIL! :'( :[
I dont know if my Main.cs file is in the right folder... What folder is it supposed to be in...??
Oh, and I bought the Game from Shockwave... If that matters
I searched for it...and I have no Resources file for TT...i have one for other demos from shockwave but thats it...No TT one...
Have I messed something up?
I'm not sure about the directory path for shockwave, but it should be something like:
C:Program FilesShockwaveThinkTanks. There is no Resources folder on PC. That's a Mac thing. The main.cs file will be in the ThinkTanks folder.
From what you posted earlier:
Wow,
For some reason it wont work...
What ami doing wrong...this is my Main file,
// Display an error message for unused arguments
for ($I = 1; $I < $Game::argc; $I++) {
if (!$argUsed[$I])
error("Error: Unkown command line argument: " @ $Game::argv[$I]);
If (!$server::dedicated) {
moveMap.bindCmd(keyboard, "1", "", "commandToServer('messageSent', "Baaaa!");");
moveMap.bindCmd(keyboard, "2", "", "commandToServer('messageSent', "Poison Style!");");
moveMap.bindCmd(keyboard, "3", "", "commandToServer('messageSent', "/ pass");");
moveMap.bindCmd(keyboard, "4", "", "commandToServer('messageSent', "/ kill me");");
}
It looks like you'd found the right file to edit based these lines. I think all you really need to do, whether you're using RX's command line or mine, is to insert a backslash after the comma which follows the 'messageSent' bit. If it still doesn't work maybe you can just email a copy of your main.cs file & I'll have a look-see.
Woot!
Thanks MajorPain...I Got It!!
Alright I got my stuff set up...Yeah!
Now, If only I can remember whats what...Hmmm ;)
DJ Look at my the picture I posted. It shows what working script would look like and fix the parts which are wrong for you.
You don't have to let go of one rope before grabbing the other. But you'll have to let go of one if you want to swing forward.
Page : <1> :
Well the title tells it all...
Freedom