Outerra forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Download Outerra Tech Demo. Unofficial Outerra Discord server, MicroProse Discord server for OWS.

Pages: [1] 2

Author Topic: work on bk117 helicopter  (Read 18250 times)

fly77

  • Outerra Master Modder
  • Hero Member
  • *****
  • Posts: 1761
work on bk117 helicopter
« on: June 09, 2019, 02:37:50 pm »

Finally I have learned to fly the bk117 helicopter by using a lot the trim and setting joystick sensivity to high and a deadzone to narrow.
Then I made some modification to the javascript to set up zoom (see code below for the core of it). Then as I pressed +/- keys on numpad to zoom keys while flying the bk117 heli up came this screen while zoom does not work..
the +/- keys seem associated to something different for the bk117..
What is its purpose ? Could I program similar nice sliders and buttons on my own ..look like java buttons?



Code: [Select]

function update_frame(dt){

  fov_cockpit_zoom = 81.8;
  this.register_axis("air/sensor/fov_zoom", {minval:0, maxval:1, vel:1, center:0}, function(v){
    var dec2int = v*48;
    var integer = Math.floor(dec2int);
    var string = 81.8 - integer.toString();
    fov_cockpit_zoom = string;
  });
 
   if (this.get_camera_mode() == 0){
    ot_world.set_camera_fov(fov_cockpit_zoom);
  }


« Last Edit: June 09, 2019, 02:57:15 pm by fly77 »
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: work on bk117 helicopter
« Reply #1 on: June 09, 2019, 03:03:58 pm »

It's an old window used for initial setup. Otherwise it's a normal html window.

What you can do is make such an html, set the path in config (see T817 script, property config returned from init_chassis).
The window will open when pressing the key bound to the ot/player/open_config action.

$object in the html corresponds to the vehicle interface there, but you should see it in the example.
Logged

fly77

  • Outerra Master Modder
  • Hero Member
  • *****
  • Posts: 1761
Re: work on bk117 helicopter
« Reply #2 on: June 09, 2019, 03:22:53 pm »

Thanks a lot ! Interesting. Will try it.
By the way I found the reason why it came up. I put the register axis command in update frame instead of initialize_reload.
Logged

Revolver

  • Hero Member
  • *****
  • Posts: 672
  • Adlerhorst-Hangar Design Group ©
Re: work on bk117 helicopter
« Reply #3 on: June 09, 2019, 05:13:56 pm »

Hi Marco!

It becomes very interesting and of all worthwhile, if there can save under each flight object its own settings.
If you understand what I mean ... ;)

Gruß,
Stefan
Logged
"Es gibt nur eine Sünde, die gegen die ganze Menschheit mit allen ihren Geschlechtern begangen
werden kann, und dies ist die Verfälschung der Geschichte."(F.Hebbel)


fly77

  • Outerra Master Modder
  • Hero Member
  • *****
  • Posts: 1761
Re: work on bk117 helicopter
« Reply #4 on: June 10, 2019, 01:37:25 pm »

yes I understand well what you mean. Will try if I can get it to work to make something useful
Logged

fly77

  • Outerra Master Modder
  • Hero Member
  • *****
  • Posts: 1761
Re: work on bk117 helicopter
« Reply #5 on: June 10, 2019, 03:04:18 pm »

It's an old window used for initial setup. Otherwise it's a normal html window.

What you can do is make such an html, set the path in config (see T817 script, property config returned from init_chassis).
The window will open when pressing the key bound to the ot/player/open_config action.

$object in the html corresponds to the vehicle interface there, but you should see it in the example.

Sorry how to bring up the config window for the t817 ? which key ?
Logged

KW71

  • Outerra Developer
  • Hero Member
  • *****
  • Posts: 763
  • Love OT!
Re: work on bk117 helicopter
« Reply #6 on: June 10, 2019, 07:21:31 pm »

"t" (to config the suspension parameters).
Logged
"A man who is contented with what he has done, will never become famous for what he will do".

fly77

  • Outerra Master Modder
  • Hero Member
  • *****
  • Posts: 1761
Re: work on bk117 helicopter
« Reply #7 on: June 15, 2019, 12:21:11 pm »

Showing off my fleshly acquired Heli-flying skills doing an aircraft carrier landing. Joystick set to sensitive and low deadzone in outerra + using a lot of trim.
Aircraft carrier and bk117 heli mod are work in progress.

« Last Edit: June 15, 2019, 12:36:40 pm by fly77 »
Logged

aWac9

  • Hero Member
  • *****
  • Posts: 2601
  • newbie
Re: work on bk117 helicopter
« Reply #8 on: June 15, 2019, 05:44:30 pm »

great, fantastic .. great contribution.
waiting for publication .. :)
Logged

Revolver

  • Hero Member
  • *****
  • Posts: 672
  • Adlerhorst-Hangar Design Group ©
Re: work on bk117 helicopter
« Reply #9 on: June 16, 2019, 11:34:22 pm »

oha! :o  cool! Sehr gut gemacht, Marco! :)
Logged
"Es gibt nur eine Sünde, die gegen die ganze Menschheit mit allen ihren Geschlechtern begangen
werden kann, und dies ist die Verfälschung der Geschichte."(F.Hebbel)


fly77

  • Outerra Master Modder
  • Hero Member
  • *****
  • Posts: 1761
Re: work on bk117 helicopter
« Reply #10 on: June 17, 2019, 04:39:10 am »

danke Stefan ! Will publish something in july
Logged

fly77

  • Outerra Master Modder
  • Hero Member
  • *****
  • Posts: 1761
Re: work on bk117 helicopter
« Reply #11 on: June 27, 2019, 04:24:23 pm »

I am trying to set up a "config.html" file where I'd like to set other parameters besides wheel_params. That is I'd like to set some of the variable values used in the javascript...for instance in case of the Heinkel...set the number and type of ammunitions. Is it possible through such a config window or do I need to go another way (for instance I am thinking I could use a canvas based menu and use key events to navigate through the menu and incr/decr individual values).
Using the config window would be much more elegant. Is it possible ?
« Last Edit: June 29, 2019, 09:54:39 am by fly77 »
Logged

fly77

  • Outerra Master Modder
  • Hero Member
  • *****
  • Posts: 1761
Re: work on bk117 helicopter
« Reply #12 on: June 29, 2019, 10:01:01 am »

That window to set initial aircraft parameters looks very interesting... So by following the t817 example I decided I try adding a config folder to the cessna. I found that the necessary files are in outerra /anteworld/www folder

So I created a "config" folder inside the Cessna folder and added inside the "aircraft.html"  +  "ot-slider-raw-css.css" + "outerra-theme.css" files + the "css" and "js" folders copied from www folder as they seem needed.
Then modified the javascript of the Cessna including a  code line   : return {config: "config/aircraft.html"}; to the initialize-reload function.

Then by pressing key "t"  I can open the config window from within the Cessna and set the sliders..also closing the window leaves the plane alive.The only problem is that I do not see any effect on the plane.
Also each time I touch a control in the opened config window  outerra gives me FATAL errors in the eng_log

Code: [Select]
23:09:47.036 FATAL: (c4e) [0630/000947:INFO:aircraft.html?width=400&height=300(31)] onfocus
23:09:47.036 FATAL: (c4e) [0630/000947:INFO:aircraft.html?width=400&height=300(31)] onfocus
23:09:49.929 FATAL: (c4e) [0630/000949:INFO:aircraft.html?width=400&height=300(31)] onfocus
23:09:49.930 FATAL: (c4e) [0630/000949:INFO:aircraft.html?width=400&height=300(31)] onfocus
23:09:51.345 FATAL: (c4e) [0630/000951:INFO:aircraft.html?width=400&height=300(31)] onfocus
23:09:51.345 FATAL: (c4e) [0630/000951:INFO:aircraft.html?width=400&height=300(31)] onfocus
23:09:55.007 FATAL: (c4e) [0630/000955:INFO:aircraft.html?width=400&height=300(35)] onblur
23:09:55.007 WARNING: (c4e) [0630/000955:ERROR:aircraft.html?width=400&height=300(53)] Uncaught TypeError: Object #<Object> has no method 'on_scenario_close'

I guess FATAL is not good  ???

Then I found another way to bring up the config window which is written actually in the outerra help menu..where it says key tilde for initial airplane configuration..on my keyboard this is actually key "@" and it indeed opens the config window of the cessna and now as I touch the sliders indeed they have an effect on the plane position/attitude...BUT as soon as I close the window the Cessna position is frozen into place !!
While some parts of it still seem to react (for instance the joke still reacts to my joystick and flaps values ract to keyboard)..but the position is frozen. The plane can't be reactivated in any way while outerra is still working. Even ctrl+alt+R doesn't  work. By looking at the eng_log I have the following error messages which I don't understand

Code: [Select]
23:07:48.268 FATAL: (c4e) [0630/000748:INFO:aircraft.html?name=Aircraft%20Scenario&width=800&height=222&transparent=true(31)] onfocus
23:07:48.268 FATAL: (c4e) [0630/000748:INFO:aircraft.html?name=Aircraft%20Scenario&width=800&height=222&transparent=true(31)] onfocus
23:07:50.674 FATAL: (c4e) [0630/000750:INFO:aircraft.html?name=Aircraft%20Scenario&width=800&height=222&transparent=true(31)] onfocus
23:07:50.674 FATAL: (c4e) [0630/000750:INFO:aircraft.html?name=Aircraft%20Scenario&width=800&height=222&transparent=true(31)] onfocus
23:07:53.257 FATAL: (c4e) [0630/000753:INFO:aircraft.html?name=Aircraft%20Scenario&width=800&height=222&transparent=true(35)] onblur

So the question is how to "make it react to the sliders" and "keep plane alive"  ? ???  Any hint ?


« Last Edit: June 30, 2019, 12:57:01 am by fly77 »
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: work on bk117 helicopter
« Reply #13 on: June 30, 2019, 02:18:46 am »

Those fatals are actually harmless forgotten logs. It's the TypeError you should be worried about. Any object surely should not be named #<Object> ...
Logged

fly77

  • Outerra Master Modder
  • Hero Member
  • *****
  • Posts: 1761
Re: work on bk117 helicopter
« Reply #14 on: June 30, 2019, 04:27:45 am »

OK I deleted the line "scenario.on_scenario_close()" inside the aircraft.html  that created the type error..now the window closes without giving the type error but still no response from plane when pressing "t" and still position frozen when pressing tilde (or rather @ for me). Is return {config: "config/aircraft.html"} to be placed at the end of initialize_reload or elsewhere and are there some variables that I need to define inside the plane's javascript (like wheelparams for vehicles) so that the return {config: "config/aircraft.html"}  has some effect ?  Like for instance "altitude_asl" that is inside the html ?

Code: [Select]
function close_window() {
                window.close();
                scenario.on_scenario_close()
            }
« Last Edit: June 30, 2019, 04:43:16 am by fly77 »
Logged
Pages: [1] 2