User mods, screenshots & videos > Aircraft

alter flight dynamics from model script ?

(1/2) > >>

fly77:
I'd like to simulate damage or mass changes of a plane through a javascript model file. Is it possible to set the JBSIM parameters programmatically from a script to modify the flight physics during the game ?
Or is it possible in another way to apply extra forces on a plane model ? The this.extra_force  command does not seem to work on planes. Any possible hack ?

cameni:
There's a jsb() method that returns jsb interface. That one only accepts jsbsim property access, see for example ah64.js script.

fly77:
wow ! Thanks ! I managed to shut off the engine through the script ! Will have to study JSBSIM now  ;)

fly77:
I am trying to disable possibility to start the engine inside the script... to model a heavily damaged plane..
In update frame I tried to set to zero everything that seems related with engine and propulsion...and when on ground set wheelspeed to zero....nothing else is there in update frame ...but still when I press "E" key the plane briefly sets on to move. The "b" key for brake works still but how to set "brake" in the script for the plane...there seems to be no "brake" property in the FDM files

   
--- Code: ---jsb['propulsion/engine[0]/set-running']=0;   
    jsb['propulsion/starter_cmd']=0;   
    jsb['fcs/starter-cmd-norm[0]']=0;       
    jsb['fcs/throttle-cmd-norm']=0;   
    jsb['fcs/throttle-pos-norm[0]']=0;   
    jsb['fcs/mixture-cmd-norm']=0;   
    jsb['propulsion/engine[0]/engine-rpm']=0;
    jsb['propulsion/engine[0]/propeller-rpm']=0;
    jsb['propulsion/engine[0]/thrust-lbs']=0;
   
    jsb['gear/unit[0]/wheel-speed-fps']=0;
    jsb['gear/unit[1]/wheel-speed-fps']=0;
    jsb['gear/unit[2]/wheel-speed-fps']=0;
--- End code ---


cameni:
You probably need to handle events like "air/engines/on", otherwise the default handlers will set jsbsim properties on their own.

Navigation

[0] Message Index

[#] Next page

Go to full version