Movable Planets?
- GrandpaTrout
- Offline
- King of Space
18 years 9 months ago #14843
by GrandpaTrout
Replied by GrandpaTrout on topic Movable Planets?
It sounds like something is going wrong in the player ship creation code. Check to make sure that you the player pilot are getting put into a real ship sim. And not just the cockpit. Try looking at your ship from an outside view.
The player fleet save and restore code uses the map entities to replace themselves. That should not be a problem because it finds the sim at time of restore. If you have moved it, then it should just restore the player near your newly moved object (just as one would hope it would work).
The player fleet save and restore code uses the map entities to replace themselves. That should not be a problem because it finds the sim at time of restore. If you have moved it, then it should just restore the player near your newly moved object (just as one would hope it would work).
Please Log in or Create an account to join the conversation.
18 years 9 months ago #14844
by mdvalley
Replied by mdvalley on topic Movable Planets?
I do start in the right ship (the prefitted patcom I’ve been testing with). It can move forwards, backwards, strafe, and even LDS, just not turn.
When I load a saved game, everything works as it should. So it’s only new games that have this bug.
When I load a saved game, everything works as it should. So it’s only new games that have this bug.
Please Log in or Create an account to join the conversation.
- GrandpaTrout
- Offline
- King of Space
18 years 9 months ago #14845
by GrandpaTrout
Replied by GrandpaTrout on topic Movable Planets?
I don't have a clue. I don't remember ever having that problem. It looks like you have found a work around however. That may hold you over until more of us can look into the code itself. We are kind of bending flux way past what it was meant to accomplish...
Please Log in or Create an account to join the conversation.
18 years 9 months ago #14846
by mdvalley
Replied by mdvalley on topic Movable Planets?
But pushing Flux past its limits is FUN!
All the code really does is a lot (a LOT) of math and move the planets around (actually, at t=0, nothing changes from the original ‘cept the L-Points). It makes a few waypoints for triangulation, but I kill them (I think) at the end of the function.
What code runs on a new game but not a saved one, why does it not like moved planets, and what happens in tEpicMain.FinalSetup that makes it OK with it again?
On another note, Megatrucking v3 is on the website now, and I'll get tOrbit up there soon so you can play with it.
All the code really does is a lot (a LOT) of math and move the planets around (actually, at t=0, nothing changes from the original ‘cept the L-Points). It makes a few waypoints for triangulation, but I kill them (I think) at the end of the function.
What code runs on a new game but not a saved one, why does it not like moved planets, and what happens in tEpicMain.FinalSetup that makes it OK with it again?
On another note, Megatrucking v3 is on the website now, and I'll get tOrbit up there soon so you can play with it.
Please Log in or Create an account to join the conversation.
- GrandpaTrout
- Offline
- King of Space
18 years 9 months ago #14847
by GrandpaTrout
Replied by GrandpaTrout on topic Movable Planets?
A new game is special because it skips the base and drops the player straight into a ship in space. The games loadout code runs at final setup time. I expect that whatever is going wrong has to do with that loadout code. Somehow the keybinds or something pilot related is not getting connected correctly. Which is why you cannot turn.
Torn stars itself is not really different from new game to save game. Actually, what the new game code does is write a set of globals to fake a prior save game. So they should really be exactly alike.
Torn stars itself is not really different from new game to save game. Actually, what the new game code does is write a set of globals to fake a prior save game. So they should really be exactly alike.
Please Log in or Create an account to join the conversation.
18 years 9 months ago #14848
by mdvalley
Replied by mdvalley on topic Movable Planets?
I’ve isolated the line it has problems with. In tEpicFleet.RestoreFleet, in the big loop, the line:
Sim.PlaceRelativeTo(ship, reference, x, y, z);
Moving the planets before that line triggers the bug, moving them after doesn’t. But why only on a new game? The new-game globals seem fine.
I could add a line that makes it not move on a new game. That would prevent the bug, but also wouldn’t adjust ellipses, L-Points, etc. in the starting system until the player left and came back. Maybe if I made a task that slept for a second, and then triggered it.
P.S. It let me update Megatrucking on the web site, but it didn’t let me upload a new entry. Probably just as well, it needs a little more tinkering.
Sim.PlaceRelativeTo(ship, reference, x, y, z);
Moving the planets before that line triggers the bug, moving them after doesn’t. But why only on a new game? The new-game globals seem fine.
I could add a line that makes it not move on a new game. That would prevent the bug, but also wouldn’t adjust ellipses, L-Points, etc. in the starting system until the player left and came back. Maybe if I made a task that slept for a second, and then triggered it.
P.S. It let me update Megatrucking on the web site, but it didn’t let me upload a new entry. Probably just as well, it needs a little more tinkering.
Please Log in or Create an account to join the conversation.