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

Pages: 1 2 3 [4]

Author Topic: can we create, place or throw custom made objects that have physics in outerra ?  (Read 2398 times)

andfly

  • Sr. Member
  • ****
  • Posts: 259

It does not work with different vehicles.

If you set a variable on the t817, share the variable with all the other instances of t817 (and only t817) that you call from the Outerra menu or even from a script that uses the world_create_instance.

Apparently the plugin does not suffer from repeated calls to its interface made by different vehicles ...
Perhaps the problem is precisely the repetition of calls made by different instances of the same vehicle ??

:(  =| =|
Logged
I do not know the English language. I use Google Translate. I hope it's all understandable.

fly77

  • Hero Member
  • *****
  • Posts: 765

About shared JS context for vehicles , yes I now checked that variables are indeed shared by the SAME type of vehicle..great !!   

A check for planes shows that plane JS context does not share variables among planes, not even of the same type. Will live with it.

So I modified the missiles to get the reference to the plugin interface just in the init_chassis for "vehicle type missiles" to avoid repeated calls to get it.
 
For "JSBSIM-aricraft-type missiles" while there is just initialize_reload apparently there is also no need to do the check as it seems plane JS context does not share variables with anything and so there is no risk of repeated calls.

... Works fine and  i can still create as many instances as I want from the jet's or the tank's scripts.


regarding the question wether the created objects can use simultaneously also the outerra normal interfaces the answer is yes. In my missile code I already request the world and explosions interface.

finally also I can spawn different jets which all can launch missiles using the same plugin, so not only a script can create objects which reference the plugin but different scripts of any kind (same vehicle or different vehicle or plane or boat) all can reference the plugin and create objects that reference the plugin...no limitation at all in no direction !

So finally everything is fine and we have lots of working new possibilities to share info among vehicles/planes etc.. !!  Its now time to exploit all these possibilities !

Code: [Select]
function init_chassis(){   
  $plugin = this.$query_interface('xt::js::global_variables.get');
}


function initialize(reload){
    if (! $plugin) {
         $plugin = this.$query_interface('xt::js::global_variables.get');
     }
}

« Last Edit: February 25, 2020, 09:46:40 am by fly77 »
Logged

andfly

  • Sr. Member
  • ****
  • Posts: 259

Bravo, very good!

Big work !!   :D :D :D
Logged
I do not know the English language. I use Google Translate. I hope it's all understandable.

fly77

  • Hero Member
  • *****
  • Posts: 765

well..its your interest in the issue that helped to solve everything very quickly ...so bravo to you !   :) :) :)
Wish you could return active in creating new mods
Logged
Pages: 1 2 3 [4]