Request Gateway transport system

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,724
Reaction score
2,690
Points
203
Location
Dallas, TX
So is there a limit to the number of planet?
Code:
; === Configuration file for solar system ===
Name = SolIntNEW

Star1 = Sun
Planet1 = Mercury
Planet2 = Venus
Planet3 = Earth
Earth:Moon1 = Moon
Planet4 = Mars
Mars:Moon1 = Phobos
Mars:Moon2 = Deimos
Planet5 = Jupiter
Jupiter:Moon1 = Io
Jupiter:Moon2 = Europa
Jupiter:Moon3 = Ganymede
Jupiter:Moon4 = Callisto
Planet6 = Saturn
Saturn:Moon1 = Mimas
Saturn:Moon2 = Enceladus
Saturn:Moon3 = Tethys
Saturn:Moon4 = Dione
Saturn:Moon5 = Rhea
Saturn:Moon6 = Titan
Saturn:Moon7 = Hyperion
Saturn:Moon8 = Iapetus
Saturn:Moon9 = Wormhole
Planet7 = Uranus
Uranus:Moon1 = Miranda
Uranus:Moon2 = Ariel
Uranus:Moon3 = Umbriel
Uranus:Moon4 = Titania
Uranus:Moon5 = Oberon
Planet8 = Neptune
Neptune:Moon1 = Triton
Neptune:Moon2 = Proteus
Neptune:Moon3 = Nereid
Planet9 = Pluto
Pluto:Moon1 = Charon
Pluto:Moon2 = Nix
Pluto:Moon3 = Hydra
Planet10 = Pantagruel
Pantagruel:Moon1 = Miller
Pantagruel:Moon2 = Edmunds
Pantagruel:Moon3 = Mann

I get in the log:
VSOP87(B) Neptune: Precision 1e-006, Terms 391/2024
---------------------------------------------------------------
>>> ERROR: While initialising celestial body:
>>> File not found: .\Config\Pluto.cfg
>>> [CelestialBody::CelestialBody | .\Celbody.cpp | 48]
---------------------------------------------------------------
>>> TERMINATING <<<
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,625
Reaction score
2,343
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
Pretty off-topic... also did you check the obvious and make sure the file exists?
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,724
Reaction score
2,690
Points
203
Location
Dallas, TX
Well back on topic:
Code:
void WORMHOLE::clbkPostStep(double simt, double simdt, double mjd)
{
	
	for (UINT i = 0; i<oapiGetVesselCount(); i++)
	{
		OBJHANDLE hvessel = oapiGetVesselByIndex(i);

		if (hvessel != GetHandle())
		{
			VECTOR3 rpos, rvel;
			oapiGetRelativePos(hvessel, GetHandle(), &rpos);
			double distance = length(rpos);
			oapiGetRelativeVel(hvessel, GetHandle(), &rvel);

			if ((distance<2) && (rpos.z>0) && (rvel.z<0))
			{

				VESSELSTATUS2 vs_vessel, vs_other_gate;
				memset(&vs_vessel, 0, sizeof(vs_vessel));
				memset(&vs_other_gate, 0, sizeof(vs_other_gate));
				vs_vessel.version = 2;
				vs_other_gate.version = 2;

				VESSEL *v;
				v = oapiGetVesselInterface(hvessel);
				v->GetStatusEx(&vs_vessel);
				OBJHANDLE h_other_gate;
				char myname[16];
				char GateA[16];
				sprintf(myname, GetName());
				sprintf(GateA, "Gate_A");
				if (strcmp(myname, GateA) == 0)
				{
					h_other_gate = oapiGetVesselByName("Gate_B");
				}
				else{
					h_other_gate = oapiGetVesselByName("Gate_A");
				}
				VESSEL *v_other_gate;
				v_other_gate = oapiGetVesselInterface(h_other_gate);
				v_other_gate->GetStatusEx(&vs_other_gate);
				vs_vessel.rbody = vs_other_gate.rbody;
				vs_vessel.rpos = vs_other_gate.rpos;
				vs_vessel.vrot = vs_other_gate.vrot;
				vs_vessel.arot = vs_other_gate.arot;

				VECTOR3 outvel = _V(rvel.x, rvel.y, rvel.z);
				VECTOR3 rofs;
				GlobalRot(outvel, rofs);
				vs_vessel.rvel.x = vs_other_gate.rvel.x + rofs.x;
				vs_vessel.rvel.y = vs_other_gate.rvel.y + rofs.y;
				vs_vessel.rvel.z = vs_other_gate.rvel.z + rofs.z;






				v->DefSetStateEx(&vs_vessel);
			}
		}
	}


}

I made 2 vessels.
Code:
Gate A:WORMHOLE
  STATUS Orbiting Earth
  RPOS 6965801.55 -0.00 768913.97
  RVEL -827.456 -0.000 7496.155
  AROT 0.00 0.00 0.00
  AFCMODE 7
  NAVFREQ 0 0
  XPDR 0
END
Gate B:WORMHOLE
  STATUS Orbiting Moon
  RPOS 852850.64 288658.25 -1512616.37
  RVEL -28.968 -11.050 60.802
  AROT 43.19 -52.02 52.93
  AFCMODE 7
  NAVFREQ 0 0
  XPDR 0
END

Then placed in the scn the Endurance at the exact location

Code:
ENDURANCE:ENDURANCENEW
  STATUS Orbiting Earth
  RPOS 6965801.55 -0.00 768913.97
  RVEL -827.456 -0.000 7496.155
  AROT 0.00 0.00 0.00

but nothing happened.
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,625
Reaction score
2,343
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
Did you try flying through it instead of just being at the right position and possibly behind it?
 

Trekkie

Starfleet Head of Ship Design
Addon Developer
Donator
Joined
Feb 6, 2016
Messages
350
Reaction score
89
Points
43
Location
Starfleet Ship Design Bureau
A trick could be to place the other "sun" as a planet orbiting our sun very far away, then make the planets around the second sun as moons of the "sun-planet". Of course no moons will be allowed in thajt system



That is possible, and was also on my mind about this topic, docking or attachments. It will solve some issues (for example arrival and departure recognition).
But it comes at a cost: you'll restrict to vessel with docking ports and if those vessel have special procedure for docking (for example open the nose cone or if the docking port is on top instead that in front of the vessel) the effect will be unrealistic. Maybe attachments fit better since you can identify them via ID. Of course this should mean that the addon will create an attachment point on every vessel in the sim, but that's not hard to do at all, we should give it a try

I am actually busy with a project like that and it is actually possible to put a moon of a moon in the game
 

fred18

Addon Developer
Addon Developer
Donator
Joined
Feb 2, 2012
Messages
1,667
Reaction score
104
Points
78
Well back on topic:
Code:
void WORMHOLE::clbkPostStep(double simt, double simdt, double mjd)
{
	
	for (UINT i = 0; i<oapiGetVesselCount(); i++)
	{
		OBJHANDLE hvessel = oapiGetVesselByIndex(i);

		if (hvessel != GetHandle())
		{
			VECTOR3 rpos, rvel;
			oapiGetRelativePos(hvessel, GetHandle(), &rpos);
			double distance = length(rpos);
			oapiGetRelativeVel(hvessel, GetHandle(), &rvel);

			if ((distance<2) && (rpos.z>0) && (rvel.z<0))
			{

				VESSELSTATUS2 vs_vessel, vs_other_gate;
				memset(&vs_vessel, 0, sizeof(vs_vessel));
				memset(&vs_other_gate, 0, sizeof(vs_other_gate));
				vs_vessel.version = 2;
				vs_other_gate.version = 2;

				VESSEL *v;
				v = oapiGetVesselInterface(hvessel);
				v->GetStatusEx(&vs_vessel);
				OBJHANDLE h_other_gate;
				char myname[16];
				char GateA[16];
				sprintf(myname, GetName());
				sprintf(GateA, "Gate_A");
				if (strcmp(myname, GateA) == 0)
				{
					h_other_gate = oapiGetVesselByName("Gate_B");
				}
				else{
					h_other_gate = oapiGetVesselByName("Gate_A");
				}
				VESSEL *v_other_gate;
				v_other_gate = oapiGetVesselInterface(h_other_gate);
				v_other_gate->GetStatusEx(&vs_other_gate);
				vs_vessel.rbody = vs_other_gate.rbody;
				vs_vessel.rpos = vs_other_gate.rpos;
				vs_vessel.vrot = vs_other_gate.vrot;
				vs_vessel.arot = vs_other_gate.arot;

				VECTOR3 outvel = _V(rvel.x, rvel.y, rvel.z);
				VECTOR3 rofs;
				GlobalRot(outvel, rofs);
				vs_vessel.rvel.x = vs_other_gate.rvel.x + rofs.x;
				vs_vessel.rvel.y = vs_other_gate.rvel.y + rofs.y;
				vs_vessel.rvel.z = vs_other_gate.rvel.z + rofs.z;






				v->DefSetStateEx(&vs_vessel);
			}
		}
	}


}

I made 2 vessels.
Code:
Gate A:WORMHOLE
  STATUS Orbiting Earth
  RPOS 6965801.55 -0.00 768913.97
  RVEL -827.456 -0.000 7496.155
  AROT 0.00 0.00 0.00
  AFCMODE 7
  NAVFREQ 0 0
  XPDR 0
END
Gate B:WORMHOLE
  STATUS Orbiting Moon
  RPOS 852850.64 288658.25 -1512616.37
  RVEL -28.968 -11.050 60.802
  AROT 43.19 -52.02 52.93
  AFCMODE 7
  NAVFREQ 0 0
  XPDR 0
END

Then placed in the scn the Endurance at the exact location

Code:
ENDURANCE:ENDURANCENEW
  STATUS Orbiting Earth
  RPOS 6965801.55 -0.00 768913.97
  RVEL -827.456 -0.000 7496.155
  AROT 0.00 0.00 0.00

but nothing happened.

you code "Gate_A" but you call "Gate A" without the underscore
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,625
Reaction score
2,343
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
Yes. I backed up and now a CTD:(

Sounds like your DLL is getting used, reacts to events, but suffers from bugs or lack of error handling. At least the direction is fine.

One jump gate related idea I have somewhere is to use a generic jump gate as campaign engine. It just orbits somewhere in the solar system and spawns ships with cargo. The player has to navigate the ships around the solar system or back to the jump gate. Goods transported into the solar system and to suitable locations are used for building up outposts and produce goods, transporting goods to the jump gate allows spawning more ships and more interesting cargo. News about what happens outside the solar system arrives with the ships that come (it is assumed the same happens in the opposite direction).

e.g. one of the first ships to arrive could be a team of prospectors desiring to be transported on the surface of a celestial body. After performing their work, a mining resource could be found on the surface of the celestial body, so after the prospecting team leaves the system again, a short time later a ship will arrive desiring to construct a mine at the resource. Once production of the ore exceeds a threshold, a refinery might get constructed in the system to process the ore already in the system, etc...

From the player perspective, this might turn out as some kind of orbital tetris, not sure if this is really interesting. :facepalm:
 

fred18

Addon Developer
Addon Developer
Donator
Joined
Feb 2, 2012
Messages
1,667
Reaction score
104
Points
78
Sounds like your DLL is getting used, reacts to events, but suffers from bugs or lack of error handling. At least the direction is fine.

One jump gate related idea I have somewhere is to use a generic jump gate as campaign engine. It just orbits somewhere in the solar system and spawns ships with cargo. The player has to navigate the ships around the solar system or back to the jump gate. Goods transported into the solar system and to suitable locations are used for building up outposts and produce goods, transporting goods to the jump gate allows spawning more ships and more interesting cargo. News about what happens outside the solar system arrives with the ships that come (it is assumed the same happens in the opposite direction).

e.g. one of the first ships to arrive could be a team of prospectors desiring to be transported on the surface of a celestial body. After performing their work, a mining resource could be found on the surface of the celestial body, so after the prospecting team leaves the system again, a short time later a ship will arrive desiring to construct a mine at the resource. Once production of the ore exceeds a threshold, a refinery might get constructed in the system to process the ore already in the system, etc...

From the player perspective, this might turn out as some kind of orbital tetris, not sure if this is really interesting. :facepalm:

Seems more like cities skylines in orbiter :)
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,625
Reaction score
2,343
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
Seems more like cities skylines in orbiter :)

Well, the Cities series is more about making people come along with each other that actually don't want to. :lol:
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,724
Reaction score
2,690
Points
203
Location
Dallas, TX
Well

Code:
Gate_A:WORMHOLE
  STATUS Orbiting Earth
  RPOS 6965801.55 -0.00 768913.97
  RVEL -827.456 -0.000 7496.155
  AROT 0.00 0.00 0.00
  AFCMODE 7
  NAVFREQ 0 0
  XPDR 0
END
Gate_B:WORMHOLE
  STATUS Orbiting Moon
  RPOS 852850.64 288658.25 -1512616.37
  RVEL -28.968 -11.050 60.802
  AROT 43.19 -52.02 52.93
  AFCMODE 7
  NAVFREQ 0 0
  XPDR 0
END


I finally got it to work.

Now for a wormhole mesh and increase the distance. I am thinking like a cylinder or funnel shape and the ship must enter the mesh and then presto


But not sure how to get the extra planets in
 

jangofett287

Heat shield 'tester'
Joined
Oct 14, 2010
Messages
1,150
Reaction score
13
Points
53
You can put a second sun in, but it won't give off light and you'll run out of numerical precision before you can place it far enough away to be reasonable.
 

Trekkie

Starfleet Head of Ship Design
Addon Developer
Donator
Joined
Feb 6, 2016
Messages
350
Reaction score
89
Points
43
Location
Starfleet Ship Design Bureau
You can put a second sun in, but it won't give off light and you'll run out of numerical precision before you can place it far enough away to be reasonable.

With the Star Trek project im busy with i just use a mesh for a sun so its bright but indeed it does not give off light, so if you would have a planet Orbiting that mesh sun and it would be between the sun and that mesh sun the side pf the sun gets lit up and the mesh sun side would be dark
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,724
Reaction score
2,690
Points
203
Location
Dallas, TX
So how would code the exit and reload a new scenario when the ship enters/ gets close to the gateway.
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,625
Reaction score
2,343
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
So how would code the exit and reload a new scenario when the ship enters/ gets close to the gateway.

Not really possible without the player helping. BUT: You could write a scenario file yourself to resume. The simplest way to do this would be saving a template scenario file and then insert the data of the ship you want to transfer into the new scenario.

The scenario editor might be starting point.
 

Trekkie

Starfleet Head of Ship Design
Addon Developer
Donator
Joined
Feb 6, 2016
Messages
350
Reaction score
89
Points
43
Location
Starfleet Ship Design Bureau
The Multiple Factors we have issues with here is that Orbiter is not Procedural generating stars and is only capable of 1 system. That prevents you from the easy way of entering the gate and coming out without the help of scenario editor and imagination, this raises a question to me, will there be something like that in the future of multiple suns?
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,724
Reaction score
2,690
Points
203
Location
Dallas, TX
So. I made a big circle 45 meters diameter.
And changed
Code:
if ((distance<10) && (rpos.z>0) && (rvel.z<0))
So the distance is now 10. but the ship just passing thru. Sometimes it moves down but not into the other gate.
Code:
Gate_A:WORMHOLE
  STATUS Orbiting Earth
  RPOS 6570309.68 -0.00 2438165.77
  RVEL -2623.799 -0.000 7070.551
  AROT 0.00 0.00 0.00
  AFCMODE 7
  NAVFREQ 0 0
  XPDR 0
END
Gate_B:WORMHOLE
  STATUS Orbiting Moon
  RPOS 851645.79 288213.31 -1510198.55
  RVEL -51.860 -18.798 101.399
  AROT 43.19 -52.02 52.93
  AFCMODE 7
  NAVFREQ 0 0
  XPDR 0
END

JMXdp4r.jpg

wedNuAt.jpg



So if I read the code the vessel must be be less than 10 and in front of and o rel velocity?
 

Trekkie

Starfleet Head of Ship Design
Addon Developer
Donator
Joined
Feb 6, 2016
Messages
350
Reaction score
89
Points
43
Location
Starfleet Ship Design Bureau
So. I made a big circle 45 meters diameter.
And changed
Code:
if ((distance<10) && (rpos.z>0) && (rvel.z<0))
So the distance is now 10. but the ship just passing thru. Sometimes it moves down but not into the other gate.
Code:
Gate_A:WORMHOLE
  STATUS Orbiting Earth
  RPOS 6570309.68 -0.00 2438165.77
  RVEL -2623.799 -0.000 7070.551
  AROT 0.00 0.00 0.00
  AFCMODE 7
  NAVFREQ 0 0
  XPDR 0
END
Gate_B:WORMHOLE
  STATUS Orbiting Moon
  RPOS 851645.79 288213.31 -1510198.55
  RVEL -51.860 -18.798 101.399
  AROT 43.19 -52.02 52.93
  AFCMODE 7
  NAVFREQ 0 0
  XPDR 0
END

JMXdp4r.jpg

wedNuAt.jpg



So if I read the code the vessel must be be less than 10 and in front of and o rel velocity?

How are the Gates linked together?
 
Top