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

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

langdon

  • Full Member
  • ***
  • Posts: 110
Re: Integrating with another sim
« Reply #150 on: May 17, 2016, 01:25:48 am »

Sweet..downloaded and looking at it now...

Am I wrong or did you just release something that could potentially change Outerra forever?

Objects communicating with the world outside the Outerra engine, which means they can potentially communicate with each other.

So... if that's the case...its just a matter of time before I  can fly the Cessna on vatsim :)
L
« Last Edit: May 17, 2016, 03:31:01 am by langdon »
Logged

langdon

  • Full Member
  • ***
  • Posts: 110
Re: Integrating with another sim
« Reply #151 on: May 17, 2016, 03:44:35 am »

Small problem...

I'm pretty sure I worked out how it functions but I may be getting it wrong so:

t817 code:

function update_frame(dt, engine, brake, steering, parking)
{
    $plugin.set_value(99);

...
}


dll code:

int tVal = 22;
   myfile << "Value a:" << plg.get_value() << "\n";
   myfile << "Value b:" << tVal << "\n";

the output in my dll log file (myfile) is:

Value a:0
Value b:22
Value a:0
Value b:22
Value a:0
Value b:22
Value a:0
Value b:22

....

I didn't change much else in the example dll. Only enough to write the log file.

Also, the dll compiles ok but when I exit Outerra I always get this error: (dialog popup image attached):

The instruction at xxxxxxxxxxxxxxx  referenced memory at xxxxxxxxxxxxxx. The memory could not  be read.

Note.. I get the same error even if I use the example without any modification.
I'm using VS 2013 on Win 10 if it matters


Am I missing something?

L

Logged

cameni

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

The example increments the value from plugin for each new vehicle spawned. That worked fine, so I guess you must be clearing the value somewhere, or talking to a different plugin class instance.

Yep, the latter - the plg member is not actually used, when the script connects, it invokes the creator method (plugin::get), and that creates its own local singleton object. You can change it to access the _M module object instead, and take the plugin class instance from there (but it probably needs to be changed to iref<plugin> plg

The crash is likely because of incorrect cleanup when the plugin unloads and leaves the singleton that destroys late.
Logged

langdon

  • Full Member
  • ***
  • Posts: 110
Re: Integrating with another sim
« Reply #153 on: May 17, 2016, 05:36:52 am »

Ok..I kinda get it.. I didn't notice the code in the script that incremented the value on each vehicle spawn... my bad... but I see that the value can be passed between objects...super cool.

Up front..I just want to apologize for you having to teach me my job but I'm a bit lost with:

You can change it to access the _M module object instead, and take the plugin class instance from there (but it probably needs to be changed to iref<plugin> plg

Are you talking about  changing the script to access the instance of plugin created by the dll?
Logged

cameni

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

No, in the C++ code. When js queries the interface, a special creator method gets called, in this case plugin::get. It should return a plugin object. It's completely in its hands what object gets returned - whether it's a singleton, or a newly created instance of the object, or something obtained from somewhere based on the optional parameters.

I made a mistake of adding plugin plg; into the igc_plugin object, but that instance wasn't the one returned by the creator method.
Logged

langdon

  • Full Member
  • ***
  • Posts: 110
Re: Integrating with another sim
« Reply #155 on: May 17, 2016, 07:32:41 am »

Yay...
Thanks for your patience.

static iref<plugin> _PLG = plugin::get();

gets me the same instance being used by the javascripts and I'm picking up the  vehicle spawn ids as they change.

Thanks heaps.
Logged

langdon

  • Full Member
  • ***
  • Posts: 110
Re: Integrating with another sim
« Reply #156 on: May 18, 2016, 06:33:00 am »

Is there a variable in script that indicates which

var geom = me.get_geomob(0);
geom.get_inst_id()

is currently being inhabited, that is, if I spawn 2 vehicles and I jump out of one and into the other is there some variable somewhere that says 'player is currently controlling object x' ?

Thanks,
L
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: Integrating with another sim
« Reply #157 on: May 18, 2016, 09:29:00 am »

I don't think any such variable is currently available to vehicle scripts or igc.
Logged

langdon

  • Full Member
  • ***
  • Posts: 110
Re: Integrating with another sim
« Reply #158 on: May 18, 2016, 09:41:21 am »

As a temporary measure, I suppose I could add a switch to the cockpit that says.."I'm here" and send the inst_id into the plugin.
Logged

langdon

  • Full Member
  • ***
  • Posts: 110
Re: Integrating with another sim
« Reply #159 on: May 19, 2016, 03:19:22 am »

I just got a whole order of magnitude more respect for those poor guys that code multithreaded servers for MMOs and MOGs.

It's one thing to spam a bunch of coordinates out through a port..
It's a WHOLE other thing to do something meaningful with them,  turn them around and send them back down all the other connected lines :)

Logged

langdon

  • Full Member
  • ***
  • Posts: 110
Re: Integrating with another sim
« Reply #160 on: May 20, 2016, 02:55:40 am »

Has anyone made an open cockpit aircraft for Outerra?
Logged

PytonPago

  • Hero Member
  • *****
  • Posts: 2284
  • It´s way too complex, dont let me try to explain !
Re: Integrating with another sim
« Reply #161 on: May 20, 2016, 03:07:52 am »

Has anyone made an open cockpit aircraft for Outerra?


You mean like the Shavrov Sh-2 ?

http://forum.outerra.com/index.php?topic=1281.0
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.

langdon

  • Full Member
  • ***
  • Posts: 110
Re: Integrating with another sim
« Reply #162 on: May 20, 2016, 03:42:20 am »

Thanks,

I download and installed it but unfortunately something in the script must be broken.
I'll have a poke around and see if I can get it airworthy again :)
Logged

HiFlyer

  • Hero Member
  • *****
  • Posts: 1788
  • newbie
Re: Integrating with another sim
« Reply #163 on: May 20, 2016, 02:43:56 pm »

Thanks,

I download and installed it but unfortunately something in the script must be broken.
I'll have a poke around and see if I can get it airworthy again :)

Yup, that plane has been grounded for quite a while.
Logged
Spex: Intel Core i7 6700K @ 4.6GHz / 32.0GB G.SKILL TridentZ Series Dual-Channel Ram / ASUS STRIX GeForce GTX 1080 / Sound Blaster Z / Oculus Rift VR Headset / Klipsch® Promedia 2.1 Computer Speakers / ASUS ROG SWIFT PG279Q ‑ 27" IPS LED Monitor ‑ QHD / 2x Samsung SSD 850 EVO 500GB / Windows 10 Pro

langdon

  • Full Member
  • ***
  • Posts: 110
Re: Integrating with another sim
« Reply #164 on: May 21, 2016, 05:48:35 am »

@Cameni..

I've got a rudimentary setup now but I have a few questions.

I open Outerra on two machines and spawn two t817 's. on each machine.
t817 A is controlled by me and t817 B is controlled by the 'other' Outerra user.

Q1. Is it possible to run two  instances of Outerra on one machine? My testing says no but maybe you know differently?

Q2. If I run one FULL copy of Outerra (paid for) and one demo copy on another machine the pc running the demo-only copy doesn't seem to run the plugin.dll? Is that correct?

Q3. If I start a FULL version on PC A  and then start a full version on PC B. PC A gets 'logged out' from you guys. It still continues to send my server data so it'll do in a pinch but do I strictly need two full versions of Outerra?

Thanks,
L


Logged
Pages: 1 ... 9 10 [11] 12 13 ... 15