Game Development Community

<input> (0): Unable to find function

by Zeph · in Torque 3D Beginner · 03/16/2013 (7:05 am) · 4 replies

Im making a login Menu Gui that connects to a Mysql database on a separate server. I keep getting the error <input> (0): Unable to find function

I made a function and attached it to a Gui control button command = "Logintest();";
I made a scripts file, and exec it via main.cs exec("./scripts/server/login.cs");
I made a function named Logintest()

I double checked all files they are .cs files, which was working before when I had an error, after correcting the error the engine ctd, on relaunch this happen.. I made a new function also, same issue.

Any Idea as to why a function wont show up in T3D engine by a Gui control button with an error of:<input> (0): Unable to find function

#1
03/16/2013 (7:52 am)
You're missing a ; somewhere, or you have an extra open parenthesis or close parenthesis - many times this will simply cause the script file to fail to compile silently.
#2
03/16/2013 (2:34 pm)
Yea, it was $MYSQL::MYSQL_DB; I got it from another code somewhere off google. When I commented it out T3D ran.. I dont know why it was there tho unless it was a reference.. Just weird cuz it ran with it in the code several times before crashing...

$MYSQL::MYSQL_DB;

function Logintest()
{
%mysql=new MySQL();
%mysql.host="sandboxgames.x10.mx";
}
#3
05/21/2013 (8:25 pm)
Sigh.. Still working on trying to connect to an external database with Mysql through Torque MIT ver.

without any ODBC scripts the function cannot be found for connect to db
When I write an ODBC script I get the following error:
core/scripts/client/client_commands.cs (8) cannot re-declare object [My TCPconnection].

Anyone know of any working OBDC or Mysql scripts that actually work, with Torque MIT version.


function dbconnect()
{

echo("We are attempting to connect to account database");

%host = "www.zeph2.0fees.net"; //DO NOT USE HTTP://
%this = new TCPObject("MyTCPConnection");

%this.v1 = %var1;
%this.v2 = %var2;

%this.connect(%host @ ":80"); //make the connection
%this.schedule(5000, "disconnect"); //disconnect after 5 seconds

%server = "www.zeph2.0fees.net:80";
//%mysql.port=3306;
%mysql.user="fees_xx00xx00xxxxx";
%mysql.pwd="xxxxx";
%username = $playername;
%password = $password;
%mysql.db="fees_xx00xx00xx00xx_connectinfo";
%path = "game world/";
//%script = "login.php";
%query = "username="@%username@"==="@%password;
%hto = new HTTPObject(CharLogin);
%hto.get(%server,%path @ %script,%query);
%mysql.Connect();
%mysql.flag_compress=false; // default: false
%mysql.flag_ssl=false;
%mysql.ValidateSettings(); // optional
%mysql.Connect();
%mysql.Query ("SELECT * FROM tblmembersinfo");
%mysql.Query ("SELECT * FROM membersinfo");
%result=%mysql.StoreResult();

}