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 ... 8 9 [10] 11 12 ... 15

Author Topic: Integrating with another sim  (Read 154877 times)

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: Integrating with another sim
« Reply #135 on: May 13, 2016, 04:52:25 am »

For lights you can use this.solar_time function in aircraft script, that returns {time, sun_coef} object, defined as:
Code: [Select]
//@param time [out] solar time at vehicle location, in miliseconds
//@param sun_coef sun position relative to horizon: 0 sun at horizon, 1 sun at zenith, -1 sun at anti-zenith

T817 script has an example of automatic lights using the sun_coef value.

Even though you can access the env interface from javascript (var env = this.$query_interface("ot::js::environment.get")), it will likely go away soon, because it would allow aircraft to mess with global settings which is not desirable. There should be some kind of sensors api for environment sensing instead.
Logged

langdon

  • Full Member
  • ***
  • Posts: 110
Re: Integrating with another sim
« Reply #136 on: May 13, 2016, 04:57:55 am »

Thanks,

Actually.. turning lights on and off was an after thought..
What I was thinking is that I could ride position information into a model via an environment variable :)

ie  rain_intensity=0.00123476009876543

L
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: Integrating with another sim
« Reply #137 on: May 13, 2016, 05:16:20 am »

I'm not sure I understand, what you want to achieve?
Logged

langdon

  • Full Member
  • ***
  • Posts: 110
Re: Integrating with another sim
« Reply #138 on: May 13, 2016, 05:30:14 am »

A way to communicate with an ingame vehicle from the outside world.

A really POOR version of multiplayer :)
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: Integrating with another sim
« Reply #139 on: May 13, 2016, 05:52:34 am »

Messages encrypted in the rain ... now that would be some matrixesque movie :D

Hmm, not easily in the current version, but in the next one there will be something accessible at the global game level.
Logged

langdon

  • Full Member
  • ***
  • Posts: 110
Re: Integrating with another sim
« Reply #140 on: May 13, 2016, 05:58:58 am »

Ya see how desperate we are now :)
We'll (I'll) literally try anything!
Logged

langdon

  • Full Member
  • ***
  • Posts: 110
Re: Integrating with another sim
« Reply #141 on: May 13, 2016, 07:46:07 am »

Hmm...forgot about rotation....
So position in the rain and rotation in the clouds :)

Anyone know of a FlightAware type service with a FREE live data feed?

So pointless, but a good laugh on a wet Friday night.
Logged

langdon

  • Full Member
  • ***
  • Posts: 110
Re: Integrating with another sim
« Reply #142 on: May 14, 2016, 12:00:11 am »

Many will ask, "what's the point"...

Sorry..I couldn't figure out how to get the correct object rotation. My dll just kept sending through zeroes.

But for a laugh.. here's the proof of concept.
I can control the position of an in game object by passing position info via the weather system.

I am flying a helo in P3D and transferring it's position info to the object in Outerra.


Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: Integrating with another sim
« Reply #143 on: May 14, 2016, 01:39:49 am »

In glm_ext.h there's quat_from_hpr function, if hpr angles are what you got.
Logged

langdon

  • Full Member
  • ***
  • Posts: 110
Re: Integrating with another sim
« Reply #144 on: May 14, 2016, 06:28:59 am »

Hi,
Yeh been using that function for a while now.
My problem was much more stupid :)
First I tried to stick a number in a float that was way to large and then I forgot to cast some doubles to floats anyway... basically moron errors .. but that's what happens when you spend 90% of your life coding web apps :|

Anyway..that's sorted.

I ended up passing 7 variables one at a time via "auto_weather_period" and using "rain_density" to  indicate which variable was being passed. If I set rain density down to 0.00007 and less , it doesn't have much impact on the environment.

So one more video...

Logged

langdon

  • Full Member
  • ***
  • Posts: 110
Re: Integrating with another sim
« Reply #145 on: May 16, 2016, 03:36:54 am »

How long do you think before you give us a multiplayer(ish) api?

I've put some client/server code into the igc dll and I can send position data etc to the server but it's actually very tricky to get all that data reliably thru the 'rain' :)

A month or 2 or do I push on with my madness? :|

L
Logged

langdon

  • Full Member
  • ***
  • Posts: 110
Re: Integrating with another sim
« Reply #146 on: May 16, 2016, 05:03:46 am »

Hmm.... a small glitch in my plan...

It would seem that an object (aircraft) can control the weather but as soon as I spawn another aircraft the first aircraft is no longer able to manipulate the weather variables?

OR, is it because object A is setting eg. the rain_density and then object B is setting the rain_density (overwriting object A's setting) and then you update the frame and call the plugin.dll?

It would seem I can inject positions into multiple ingame objects but I can't get the positions back out.

I suppose I could put eng.log on a ram disk and monitor it for changes and write the positions out thru there...

But there's nuts  and then there's REALLY NUTS :)
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: Integrating with another sim
« Reply #147 on: May 16, 2016, 02:25:39 pm »

Yea, only one vehicle can be the last to set the rain :)

Technically you could expose an interface from your dll that would be accessible from aircraft scripts, just like the env interface is. However, even though it's almost automatic, the initial setup might be a bit problematic for you. Hmm, maybe I could expand the example with it ...
Logged

langdon

  • Full Member
  • ***
  • Posts: 110
Re: Integrating with another sim
« Reply #148 on: May 16, 2016, 11:31:11 pm »

Any help and examples are always greatly appreciated!

A nudge in the right direction is always better than spending  hours poking around in something that is quite complicated to grasp.

Thanks,
L
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: Integrating with another sim
« Reply #149 on: May 17, 2016, 01:14:16 am »

Ok, new ot-api.zip uploaded, added interface example. T817 script that uses it attached here.
Logged
Pages: 1 ... 8 9 [10] 11 12 ... 15