Outerra forum

Anteworld - Outerra Game => Modding: Importer, Tools & Utilities => Topic started by: konaone on January 05, 2015, 05:10:50 pm

Title: waterline.
Post by: konaone on January 05, 2015, 05:10:50 pm
waterline.
I imported the model ship Rotterdam.
respond to commands floats, but the waterline is too.
how can I adjust it, whereas I used the script coastguard us?
Title: Re: waterline.
Post by: cameni on January 06, 2015, 03:00:15 am
You will get the correct waterline when you set a correct ship mass, and when the volume approximation (http://xtrac.outerraworld.com/wiki/vehicle_params#Watercraftparameters) is set right as well. The waterline is where the hydrostatic force balances the gravity.
Title: Re: waterline.
Post by: konaone on January 06, 2015, 10:35:45 am
Sorry Cameni unfortunately are poorly trained, ..... which folder I can change these parameters? :-[
Title: Re: waterline.
Post by: PytonPago on January 06, 2015, 10:45:05 am
Sorry Cameni unfortunately are poorly trained, ..... which folder I can change these parameters? :-[

Those should be in the .js file of the model you imported. It should be together with the vehicle mass and gravity-center parameters in the "function init. chasis" :

Code: [Select]
    return {com:{y:0.3, z:0.1}, mass:14710, steering:2.0, steering_ecf:60, centering: 2.6, centering_ecf:20, hydro_l:7.2, hydro_w:2.35, hydro_h1:0.0, hydro_h2:1.6, hydro_uplift:400, hydro_volcoef:0.8, Cx:{x:1.2, y:0.3, z:1.2, w:0.8}};

Title: Re: waterline.
Post by: Uriah on January 06, 2015, 11:47:31 pm
I am assuming this is exclusive to Bullet, and JSBSim does not interact with water using the same script. Is there an example of an aircraft that takes off and lands on water?

Regards,
Uriah
Title: Re: waterline.
Post by: M7 on January 07, 2015, 12:53:53 am
I am assuming this is exclusive to Bullet, and JSBSim does not interact with water using the same script. Is there an example of an aircraft that takes off and lands on water?

Regards,
Uriah

As far as i know, it's not possible yet.
Title: Re: waterline.
Post by: konaone on January 14, 2015, 06:11:18 pm

Ok, PytonPago, I modified the .js file as tur indications, the ship is properly positioned on the water, but by pressing the arrow keys will not move it veers.
the model has propellers, rudders and radar that can move with the pivot positioned in 3ds max.
appointed:
radar_id
radar2_id
rudderL_id
rudderLoo1_id
EnvironmentAmbientLight [vehicle script = "EnvironmentAmbientLight.js" EnvironmentAmbientLight]
smit_rotterdam_id [vehicle script = "smit_rotterdam_id.js" smit_rotterdam_id]
   glassr_id [glassr_id]
   glassr_id [glassr_id]
   radar_id [radar_id]
   rudder_L [rudder_L]
     rudder_L_PIVOT
   left_propeller_id [left_propeller_id]
     part_63_LOD_101
       part_63_LOD_101_PIVOT
   right_propeller_id [right_propeller_id]
     part_63_LOD_100
       part_63_LOD_100_PIVOT
   rudder_L001 [rudder_L001]
     rudder_L001_PIVOT
   radar2_id [radar2_id]
     part_113_LOD_100
   timone_id
.I Would like to modify the scripts to make them work, there are also different audio files, engine, horn, ignition that could be used ............. suggestions?
Title: Re: waterline.
Post by: PytonPago on January 14, 2015, 08:42:57 pm
Well, movement in water is defined by an extra force :

Code: [Select]
function update_frame(dt, engine, brake, steering){
  this.extra_force({z:-0.05,y:-10},{x:9000*steering,y:15000*engine});
}

... the position, force used to turn the vessel around and the force for forward movement (mind the position of the force being applied should be somewhere, where the turning force can rotate the vessel (not close to the vehicles center of mass) )

Not sure how to define an engine and its RPM for an boat, doe, you can look at the WindTurbine-model script (the model is on the forum somewhere at static objects - the animated one) and try that for the stuff ya need turning, some more can be trough some math-thought ... otherwise, you can use some lightweight car-script for the engine and bind the forces to them (also, for the turning, see the "steering" script parts for vehicles) -

if ya can make a little sense of scripts, you can go trough the script of the BTR-80 and use the switch to turn on and off some rotations bounding that to some of the vehicle-usage keys (look for the part where AOpen AFire and such are) ... if ya like details about some, just paste them in my PM and i try to explain some of the stuff in proper detail for ya.

P.S.: If ya like some more optionous tool to go trought scripts, i use this one -
http://www.yaldex.com/Free_JavaScript_Editor.htm
... it can help ya find certain parts of the script fastly and highlight some stuff so ya can see some evident miss-spellings.