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.

Author Topic: extra_force not working with custom models  (Read 8449 times)

zzz

  • Sr. Member
  • ****
  • Posts: 266
  • newbie
extra_force not working with custom models
« on: June 26, 2014, 07:23:04 pm »

Hi, adding the following to the bus that comes with Outerra (weight: 8000kg, CoM: y: 3)

Code: [Select]
this.extra_force({z:0,y:3},{y:0,z:90000});
sends it rising into the air immediately on spawn. However on my own models this line does nothing. Is there something I need to add before it takes effect? Wheels?
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: extra_force not working with custom models
« Reply #1 on: June 27, 2014, 01:00:08 am »

Yes, if you do not have any wheels, the simulation is stopped. This is to avoid models sinking immediately into ground after importing vehicles.
Note there do not have to be any physical wheels, you can create just virtual ones with small radius.
Logged

zzz

  • Sr. Member
  • ****
  • Posts: 266
  • newbie
Re: extra_force not working with custom models
« Reply #2 on: June 27, 2014, 02:53:42 pm »

thanks.

Is there a way in the js file to capture when a key is being pressed? like "this.keypress('W') == 1"? or if a command controlled by keypress is activated?

How do you import the current speed as well?
Logged

PytonPago

  • Hero Member
  • *****
  • Posts: 2284
  • It´s way too complex, dont let me try to explain !
Re: extra_force not working with custom models
« Reply #3 on: June 27, 2014, 03:29:53 pm »

thanks.

Is there a way in the js file to capture when a key is being pressed? like "this.keypress('W') == 1"? or if a command controlled by keypress is activated?

How do you import the current speed as well?

 ... i think the only usable keys are the vehicle ones ... you could add an log-window message to execute after pressing a key. Used that a lot to see if some of my functions work properly ...
Logged
We are still undeveloped as long as we don´t realize, that all our science is still descriptive, and than beyond that description lies a whole new world we just haven´t even started to fully understand.

zzz

  • Sr. Member
  • ****
  • Posts: 266
  • newbie
Re: extra_force not working with custom models
« Reply #4 on: June 27, 2014, 05:09:55 pm »

thanks.

Is there a way in the js file to capture when a key is being pressed? like "this.keypress('W') == 1"? or if a command controlled by keypress is activated?

How do you import the current speed as well?

 ... i think the only usable keys are the vehicle ones ... you could add an log-window message to execute after pressing a key. Used that a lot to see if some of my functions work properly ...

Yeah, I started using the action code functions for vehicles. Not exactly the smoothest control scheme. Now all I need is a way to measure the velocity so I can turn off the extra forces when necessary.
Logged

PytonPago

  • Hero Member
  • *****
  • Posts: 2284
  • It´s way too complex, dont let me try to explain !
Re: extra_force not working with custom models
« Reply #5 on: June 28, 2014, 01:58:32 am »

You're trying to do a nozzle controlled vehicle or a rocket ?
Logged
We are still undeveloped as long as we don´t realize, that all our science is still descriptive, and than beyond that description lies a whole new world we just haven´t even started to fully understand.

zzz

  • Sr. Member
  • ****
  • Posts: 266
  • newbie
Re: extra_force not working with custom models
« Reply #6 on: June 28, 2014, 05:54:19 am »

Arcade space ship. So like in Freespace 2 it runs into "friction" that limits its top speed and stops it from accelerating to infinity. But I still want external forces like going into a freefall dive to push it over its top speed, so my solution is to have the extra_force turn to zero when the speed in the corresponding axis is greater than the pre-selected top speed.

It actually works in both Outerra's atmosphere and space so I'll probably release it soon for other people to play with.
Logged

PytonPago

  • Hero Member
  • *****
  • Posts: 2284
  • It´s way too complex, dont let me try to explain !
Re: extra_force not working with custom models
« Reply #7 on: June 28, 2014, 06:32:40 am »

You mean, there is no Friction putting a limit on the speeds, you could achieve in that way you drive your vehicle ?   ... you script it outside JSBSim purely trough OT script forces then ?
Logged
We are still undeveloped as long as we don´t realize, that all our science is still descriptive, and than beyond that description lies a whole new world we just haven´t even started to fully understand.