Does the scripting support in X Rebirth offer something that would allow
me to retrieve the current player position at regular intervals (as opposed to reading it from the save file game as that's not realtime).
I would like to retrieve and then export the current position while playing
so I can effectively build something that would act as a 'second screen'/'map' on a tablet or whatever. (which is easy to do once I can store the position somewhere)
Is there a way to retrieve the current player position at regular intervals?
Moderators: Scripting / Modding Moderators, Moderators for English X Forum
-
- Posts: 6
- Joined: Sat, 23. Nov 13, 15:33
-
- Posts: 4
- Joined: Mon, 28. Nov 11, 22:24
I'm not a scripting expert but you might want to try to read the memory address directly. It shoudn't be very difficult to do you if know how to program. You might also want to take a look at the ReadProcessMemory function for c++/c#. To find the memory address/the pointers that point to it CheatEngine should work great.
I hope I was able to help
I hope I was able to help

-
- Posts: 299
- Joined: Wed, 9. Apr 08, 05:52
Code: Select all
<set_value name="$LCurrentPos" exact="player.primaryship.position"/>
You don't talks about X:Rebirth...
X4 Mods: Collect Inventory Wares Stations Supply Build Storage Mass Move Marines
X4 Mods: Collect Inventory Wares Stations Supply Build Storage Mass Move Marines
-
- Posts: 259
- Joined: Sat, 23. Nov 13, 09:48
you could use the debug log to get your data (combined with an ai script that you only somehow limit to 1 loop (1 ship using the ai). You could use
<debug_text text="player.primaryship.position" filter="error" />
and launch your game with -debug all -logfile debug.log. Then the file in your "Documents/Egosoft/X Rebirth/<steamIDnumber>/debug.log will contain your data (with all other sort of errors / warning complaints from scripts all around the place)
It also sometime stop working for some reasons, but generally not without a HUGE load of error beforehand.
<debug_text text="player.primaryship.position" filter="error" />
and launch your game with -debug all -logfile debug.log. Then the file in your "Documents/Egosoft/X Rebirth/<steamIDnumber>/debug.log will contain your data (with all other sort of errors / warning complaints from scripts all around the place)
It also sometime stop working for some reasons, but generally not without a HUGE load of error beforehand.
-
- Posts: 6
- Joined: Sat, 23. Nov 13, 15:33
Could you give a little more information on this solution?Tyrant597 wrote:where position is [$x, $y, $z]Code: Select all
<set_value name="$LCurrentPos" exact="player.primaryship.position"/>
I'm not sure how to use this.
-
- Posts: 6
- Joined: Sat, 23. Nov 13, 15:33
-
- Posts: 12
- Joined: Sat, 16. Nov 13, 13:46
Anyone got any new ideas how to do this?
I've tested the readprocessmemory approach throu c++, but it aint looking good. The memory pointers are going nuts, and the few i've located would need updates with every version of the game and possible with every combination of mods.
Is there any livestream or export of data functionality in the scripting, except for -debug?
I've tested the readprocessmemory approach throu c++, but it aint looking good. The memory pointers are going nuts, and the few i've located would need updates with every version of the game and possible with every combination of mods.
Is there any livestream or export of data functionality in the scripting, except for -debug?