Outerra forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Outerra Tech Demo download. Help with graphics driver issues

Author Topic: console metod - $con.exec(str)  (Read 1901 times)

SteelRat

  • Sr. Member
  • ****
  • Posts: 380
  • newbie
console metod - $con.exec(str)
« on: March 31, 2015, 03:31:14 pm »

The script is invoked from the console
Code: [Select]
/*
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!
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6669
  • Pegs is clever, but tae hain’t a touch sentimental
    • outerra.com
Re: console metod - $con.exec(str)
« Reply #1 on: March 31, 2015, 04:14:35 pm »

I'm not getting any such error, so probably an error in ptm/initPtm.js?
Logged

SteelRat

  • Sr. Member
  • ****
  • Posts: 380
  • newbie
Re: console metod - $con.exec(str)
« Reply #2 on: March 31, 2015, 04:27:22 pm »

Found a bug but did not understand anything.
The error was in the called file.

It works without errors
Code: [Select]
$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
Code: [Select]
var $world = $eview.$query_interface("ot::js::world.get");
var logic = $world.create_instance(obj, #(pos 10), #rot, false);
Logged