Forums Index >> Modding >> TT C++ Tutorial?
Page : <1> :
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...
Do a search for "TorqueScript" tutorials.
Or start here:
http://www.garagegames.com/docs/tge/general/ch05s02.php
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?
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.
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
^^ 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
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 :)
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
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
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
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
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
Its all explained inside... If you read it well you'd have known the answer to the doubts above...
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