Outerra forum
Anteworld - Outerra Game => Modding: Importer, Tools & Utilities => JavaScript development => Topic started by: SteelRat on March 31, 2015, 03:31:14 pm
-
The script is invoked from the console
/*
Spawn logic object
*/
// Test block
var obj = "ptm/Logic/Logic";
var initCode = 'this.log_inf("Object logic created");';
$con.exec(".load ptm/initPtm.js"); // error: Unexpected token ILLEGAL
print("createLogic loaded");
//var win = open("ptm/createLogic.html");
I can't understand why the error!
-
I'm not getting any such error, so probably an error in ptm/initPtm.js?
-
Found a bug but did not understand anything.
The error was in the called file.
It works without errors
$con.exec("var $world = $eview.$query_interface('ot::js::world.get')");
$con.exec("var logic = $world.create_instance(obj, #(pos 10), #rot, false)");
And error
var $world = $eview.$query_interface("ot::js::world.get");
var logic = $world.create_instance(obj, #(pos 10), #rot, false);