Outerra forum

Anteworld - Outerra Game => Modding: Importer, Tools & Utilities => Topic started by: zzz on June 26, 2014, 07:23:04 pm

Title: extra_force not working with custom models
Post by: zzz 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?
Title: Re: extra_force not working with custom models
Post by: cameni 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.
Title: Re: extra_force not working with custom models
Post by: zzz 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?
Title: Re: extra_force not working with custom models
Post by: PytonPago 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 ...
Title: Re: extra_force not working with custom models
Post by: zzz 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.
Title: Re: extra_force not working with custom models
Post by: PytonPago on June 28, 2014, 01:58:32 am
You're trying to do a nozzle controlled vehicle or a rocket ?
Title: Re: extra_force not working with custom models
Post by: zzz 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.
Title: Re: extra_force not working with custom models
Post by: PytonPago 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 ?