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]

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

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6581
  • Pegs is clever, but tae hain’t a touch sentimental
    • outerra.com

Try calling .get_geomob(0).get_eid() on the created object.
Logged

fly77

  • Sr. Member
  • ****
  • Posts: 288

Got it working ! The missile gets shot with the tracer. Also the missile gets stuck very nicely in the ground on impact !  :) However I had to shoot a tracer first in init_vehicle using $explosions.launch_combo. Strangely even if I destroy the tracer it still works but if I never create the tracer before it won't work. Don't undertsand it but its fine. Quite nice and it makes a crater and smoke on impact!   :D :D :D
Only thing it makes no splash when hitting water.



Code: [Select]
function init_vehicle(){
  tracer = $explosions.launch_combo( ecef, {x:45*plasmaquat.x, y:45*plasmaquat.y, z:45*plasmaquat.z}, 3, {x:1,y:1, z:0},  {x:0.3,y:0.3, z:0.3}, 1, 0.1, 0.1, 20, true, true, true );
  $explosions.destroy_tracer( tracer );
}


function update_frame(dt, engine, brake, steering) {

  $throw = world.create_instance("outerra/missile/missile", ecef, cannonQuat, false);

  var ent_id = $throw.get_geomob(0).get_eid();

// $explosions.destroy_tracer( tracer );

 $explosions.launch_tracer( ecef, {x:45*plasmaquat.x, y:45*plasmaquat.y, z:45*plasmaquat.z}, 5, {x:1,y:1, z:0},      0.5, 0.2, 0,    0,  tracer , ent_id , 0 );

 $explosions.launch_combo( ecef, {x:45*plasmaquat.x, y:45*plasmaquat.y, z:45*plasmaquat.z}, 3, {x:1,y:1, z:0},  {x:0.3,y:0.3, z:0.3}, 1, 0.1, 0.1, 20, true, true, true );

}

« Last Edit: February 17, 2019, 10:49:27 am by fly77 »
Logged

fly77

  • Sr. Member
  • ****
  • Posts: 288

Strange "flying house bullet" appearing from time to time. My "outerra/tank-ammunition/tank-ammunition" of course looks differently. By the way, while my bullet is removed from the scene after impact, not so the "flying house" that remains stuck in the impact crater. Also the type of "flying house" is not allways the same. Seems to occur only (but not allways) when the tracer is looked at against the backdrop of the sky, especially if zooming in.


Code: [Select]
function update_frame(dt, engine, brake, steering, parking){
.......
$throw = world.create_instance("outerra/tank-ammunition/tank-ammunition", ecef,  bulletquat, false);   
       
entid = $throw.get_geomob(0).get_eid();
           
mdc = {x:0,y:2,z:0};

ecef = this.geometry.get_world_pos_offset(mdc,this.muzzle_id);
           
$explosions.launch_tracer( ecef, {x:450*plasmaquat.x, y:450*plasmaquat.y, z:450*plasmaquat.z}, 1, {x:1,y:1, z:0},      0.5, 0.2, 0,    0,  tracer , entid , 0 );

tracer = $explosions.launch_combo( ecef, {x:450*plasmaquat.x, y:450*plasmaquat.y, z:450*plasmaquat.z}, 1 , {x:1,y:1, z:0},  {x:0.3,y:0.3, z:0.3}, 7, 0.1, 0.1, 20, true, true, true );       
$throw.remove_from_scene();
....
}
« Last Edit: March 04, 2019, 02:54:20 pm by fly77 »
Logged
Pages: 1 [2]