Forums Index >> Modding >> TT C++ Tutorial?



Page : <1> :


I was wondering--is there a special C++ tutorial for ThinkTanks? I looked at the one on cplusplus.com, but I couldn't find many similarities between the tutorial and TT scripts. I would like to be able to make scripts for ThinkTanks, but the tutorial hardly helps.

Last edited: Sunday, November 27, 2005 at 12:09:23 PM

Sunday, November 27, 2005 at 12:09:04 PM

That is because TT is made from the Torque Game Engine. Torque is similar to C++ but it is not the same.
I dont have a link to the tutorials cause I never used them but I am sure someone here does...

 

 

 

 

Sunday, November 27, 2005 at 12:40:16 PM

Do a search for "TorqueScript" tutorials.

Or start here:
http://www.garagegames.com/docs/tge/general/ch05s02.php

 

 

 

 

Sunday, November 27, 2005 at 12:58:26 PM

I think my brain exploded. :o However, I managed to retain most of the information I read. I tried a little scripting of my own in Art Crazy's Admin Codes.cs:

 

                                        
function namebotsdefault()
{
$Pref::Server::BotName0 = "Bot0";
$Pref::Server::BotName1 = "Bot1";
$Pref::Server::BotName2 = "Bot2";
$Pref::Server::BotName3 = "Bot3";
$Pref::Server::BotName4 = "Bot4";
$Pref::Server::BotName5 = "Bot5";
}

 


Further down the page:

 

                                        
<more admin codes>
else if(%code $= "/namebots")
{ if(IsDictator(%sender,"You're not a Dictator"))
namebotsdefault();
return;

}
else {
bottomprint(%sender,%code SPC "is not a code",4,4);
return;
}

 


But I get an error report when I launch a server.

 

Compiling game/server/Admin Script/AdminCodes.cs...
game/server/Admin Script/AdminCodes.cs Line: 1202 - Syntax error.
>>> Advanced script error report. Line 2403.
>>> Some error context, with ## on sides of error halt:
bottomprint(%sender,%code SPC "is not a code",4,4);
return;
}##
>>> Error report complete.

Executing game/server/Admin Script/AdminCodes.cs.
game/server/Admin Script/AdminCodes.cs Line: 1202 - Syntax error.
>>> Advanced script error report. Line 2403.
>>> Some error context, with ## on sides of error halt:
bottomprint(%sender,%code SPC "is not a code",4,4);
return;
}##
>>> Error report complete.

 


Does anyone know what the bug is?

Sunday, November 27, 2005 at 2:17:47 PM

You have forgotten the ; at the end of the function. There should be a ; after the }

Note the error report puts ## where the error is.

 

 

 

 

Sunday, November 27, 2005 at 2:44:47 PM

That is good if you want to have all your bots be the same exact name. Try this:

Function namebotsdefault() //list msg arays here
{
$Pref::Server::BotName0 = %msg; //%msg can be identified in the code, just put it together....
$Pref::Server::BotName1 = %msg2;
$Pref::Server::BotName2 = %msg3;
$Pref::Server::BotName3 = %msg4;
$Pref::Server::BotName4 = %msg5;
$Pref::Server::BotName5 = %msg6;
}

Function NameBot1(%msg)
{
//the array for BotrName01. This could be executed in the code stuff

Sunday, November 27, 2005 at 2:45:25 PM

^^ I know, but the console didn't give me an error about the rest of the Art Crazy codes, which don't have semicolons.
^ You can edit the part of my function where it says "Bot0" to change the name of the bot when you enter the code.
I also might make a function somewhat like that ^.
The error is fixed, finally. Thanks guys. ;)
I'll take Warfare's advice and start scripting from the dash codes.
Today...life is good. XD B)

Last edited: Sunday, November 27, 2005 at 3:13:35 PM

Sunday, November 27, 2005 at 2:50:50 PM

Yes, dash codes are very helpful if you wish to learn how to code in torque script...
ACAS is a bit complicated and many things can go wrong if you intend to make functions yourself... Dash's however is set up perfectly for this very purpose...
Then once you get the hang of it, you can use ACAS if you want :)

 

 

 

 

Monday, November 28, 2005 at 8:40:58 AM

BTW:
56k lag man:
"You have forgotten the ; at the end of the function. There should be a ; after the }

Note the error report puts ## where the error is."

Functions do not need semi-colons at the end of them...
the ## is where the computer thinks the problem is... Most likely after the actual error

 

 

 

 

Monday, November 28, 2005 at 8:42:54 AM

One more thing: Could someone teach me the fine points of scripting, such as why there are 2 equal signs in

 

                                        
%client == -1

 

?
I know the basics, but the rest of the commands I have to copy from Art Crazy.

Monday, November 28, 2005 at 9:11:03 AM

That is located in an if statement....

 

                                        
if(%client == -1)
{
//do this junk
}

 


The 2 equals mean "If variable1 is equal to variable2"

I am at school right now, so if you want, I can e-mail you an explination of if statements, how they work, and what you can do with them later...

 

 

 

 

Last edited: Monday, November 28, 2005 at 9:30:02 AM

Monday, November 28, 2005 at 9:29:36 AM

That would be nice, but there are many more things that I am confused about. :o ;)

Monday, November 28, 2005 at 10:02:40 AM

*BUMP* I need someone to help me with this! :(

Tuesday, November 29, 2005 at 4:41:49 AM

Sorry monica, I wish I could
technically I am not allowed on PTT at school but thats the only place I can access it since of my recent internet crisis...
once everything is fixed on my end I will e-mail you a tutorial on this subject

 

 

 

 

Wednesday, November 30, 2005 at 8:42:00 AM

Just look welll... The problem is that theres a } missing dummys :) She forgot the one after the one that closes the else, and yes, my script is good for who already practiced a BIT with dash's (to learn scripting, NOT to use)

PS: Search in the Modding forum for Ish's and Mine's TGE codde explanation. All things you need to know explained :)


Last edited: Tuesday, December 06, 2005 at 2:06:18 PM

Tuesday, December 06, 2005 at 2:04:14 PM

 

 

All things you need to know explained.

 


No, there are still many things I don't know, like why

 

                                        
%sender

 

Doesn't mean sender, and how to centerprint/messageprint/bottomprint stuff to only one person, and how to make tanks respawn without dying. :o

Tuesday, December 06, 2005 at 3:33:44 PM

You didnt read our tuturials... And I'm not talking of the official tuturials, I'm talking about the ones I and Ishbuu made

@All
Dont help her till she reads em :)

Linky Linky:
http://supra.planetthinktanks2.com/archives/comm-thread.asp?thread=9002&forum=2


Last edited: Wednesday, December 07, 2005 at 7:33:17 AM

Wednesday, December 07, 2005 at 7:32:21 AM

^ I read them the first time. X/ Meaning BEFORE you posted that link.

Wednesday, December 07, 2005 at 2:01:44 PM

Uhh... Art? I know you checked the modding forums. Don't just ignore this thread.

Thursday, December 08, 2005 at 5:33:54 PM

Its all explained inside... If you read it well you'd have known the answer to the doubts above...


Friday, December 09, 2005 at 7:30:38 AM

Ok 8o... Since you won't help me, I'll just read your codes and try to figure it out myself.

Friday, December 09, 2005 at 8:49:44 AM

Page : <1> :

insert quote insert url insert email insert image bold italic underline superscript subscript horizontal rule : : Help on using forum codes

Add comment:

HTML is disabled within comments, but ZBB Code is enabled.

Back to the top

Web site designed, maintained and funded by -z- and Dan MacDonald