[Solved] Changing Sector Names : Old problem, new question...

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

Post Reply
lostProfitssssArrgh
Posts: 161
Joined: Tue, 22. Aug 17, 13:14

[Solved] Changing Sector Names : Old problem, new question...

Post by lostProfitssssArrgh » Tue, 12. Sep 17, 08:29

I started looking into changing sector names just for the heck of it and found this useful thread :

https://forum.egosoft.com/viewtopic.php ... &view=next
Jack08 wrote: the name id is a concatenation of three parts.

Prefix: 102
X Pos: 01 (Example)
Y Pos: 01 (Example)
Great. I fire up x3ed2, open the 0001-L044 and find the sector names at pages (...)07. Awesome. However, in page 380007, some sectors have string values that go beyond 102-24-20..?

For example : Light of Hope @ string 1023800. So, how do those values get mapped into the game according to Jack08's explanation?

Thx,
-lpa
Last edited by lostProfitssssArrgh on Tue, 12. Sep 17, 17:48, edited 1 time in total.

User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 24949
Joined: Sun, 2. Apr 06, 16:38
x4

Post by X2-Illuminatus » Tue, 12. Sep 17, 09:58

Light of Hope an the names in the text file below are spare names, which were recorded, so that at a time convenient to Egosoft (e.g. within a patch) additional sectors with voiced names can be added. You can use those by putting a text reference to this id {7,1023800} at the desired location specific text id. This is done for the Unknown sector {7,1020000} a couple of times already.
Nun verfügbar! X3: Farnham's Legacy - Ein neues Kapitel für einen alten Favoriten

Die komplette X-Roman-Reihe jetzt als Kindle E-Books! (Farnhams Legende, Nopileos, X3: Yoshiko, X3: Hüter der Tore, X3: Wächter der Erde)

Neuauflage der fünf X-Romane als Taschenbuch

The official X-novels Farnham's Legend, Nopileos, X3: Yoshiko as Kindle e-books!

lostProfitssssArrgh
Posts: 161
Joined: Tue, 22. Aug 17, 13:14

Post by lostProfitssssArrgh » Tue, 12. Sep 17, 11:40

Thank you.


A couple more things:

- for future newb reference, the x and y sector coords are swapped in the t-files and start at 1 instead of 0 (ie Zyarth's Stand at x20 y05 is at string #1020621).

- I have LU 1.7.2 and Mayhem 2.1.3 installed. I'm using 9977-L044.xml to test sector names, specifically Unknown Omega at x20 y0. Litcube uses page 350007 and string 1020121 in 8385-L044 to define that sector (Joubarbe doesn't define sectors in his 9971 to 9973 t-files). So I added the same page and string number to my 9977 thinking that it would override Litcube's, but nothing changes... What am I missing ? :/

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22197
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Tue, 12. Sep 17, 12:05

In AP you should use pages id's starting with 38
So 380007.

The reason it might not have overridden is because of the order in which setup files are loaded. Yours may have been loaded earlier and therefore your text was the was that was overridden

380007 will always override 350007 however

lostProfitssssArrgh
Posts: 161
Joined: Tue, 22. Aug 17, 13:14

Post by lostProfitssssArrgh » Tue, 12. Sep 17, 13:27

Cycrow wrote: In AP you should use pages id's starting with 38
So 380007.
Done.

---

That didn't work at first, but it turns out that Joubarbe has delayed readtext commands in his setup files. I delayed mine for longer, it doesn't work on game load... Forcing the setup script via MSCI brings in the new names but they revert after a bit :headbang:

I'm guessing there are calls to Joubarbe's readtexts and/or monitor scripts running. I'll keep looking in that direction and post the results.

lostProfitssssArrgh
Posts: 161
Joined: Tue, 22. Aug 17, 13:14

Post by lostProfitssssArrgh » Tue, 12. Sep 17, 14:37

Two candidates :

Both Lib.Gen.ErrorCode.GetCodeNumber and Lib.Gen.ErrorCode.Message have this :

Code: Select all

line 1 :: load text: id=8383
The ErrorCode libs are being called from the Cmd.Freighter script (which loops of course).

So the renaming is most likely caused by Litcube's scripts reading 8383 which also contains sector names, not Joubarbe's (sorry!)

---

Gotta run for the time being, if anyone cares to pitch in...

User avatar
Joubarbe
Posts: 4796
Joined: Tue, 31. Oct 06, 12:11
xr

Post by Joubarbe » Tue, 12. Sep 17, 15:34

Pandas are innocent.

lostProfitssssArrgh
Posts: 161
Joined: Tue, 22. Aug 17, 13:14

Post by lostProfitssssArrgh » Tue, 12. Sep 17, 17:46

Fixed by changing

Code: Select all

line 1 :: load text: id=8383 
to

Code: Select all

line 1 :: load text: id=8398
in Lib.Gen.ErrorCode.GetCodeNumber and Lib.Gen.ErrorCode.Message.


Splitting custom text resources into deferred and immediate load files (9977 and 9978) should also help in the future. The sector names should't revert once all the freighters have updated their command sources.

Thanks for the help!

User avatar
Joubarbe
Posts: 4796
Joined: Tue, 31. Oct 06, 12:11
xr

Post by Joubarbe » Tue, 12. Sep 17, 18:38

Now you can have fun with the mov files to allow Betty to say the new sector names... As I did once :)

lostProfitssssArrgh
Posts: 161
Joined: Tue, 22. Aug 17, 13:14

Post by lostProfitssssArrgh » Tue, 12. Sep 17, 19:37

Fortunately, I just need Betty to speak 1 syllable and 1 number. Shouldn't be too hard :D


That's a nice tool-set you linked here, I'll have to mess around with it. But I'm not seeing a Betty tool in there... At first, I was at least hoping for a built-from-the-ground-up Betty-Boop voice synth.


Disappointing, really :P

User avatar
Jack08
Posts: 2993
Joined: Sun, 25. Dec 05, 10:42
x3tc

Post by Jack08 » Tue, 12. Sep 17, 20:14

Are you sure using page id 380007 didn't let the name override stick? i have concerns if you plan to release your mod, because you edited LU base files. Perhaps try 390007? not sure if the special handling will continue to 39 but it might be worth a try if it gets around editing core scripts.
[ external image ]
"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire

lostProfitssssArrgh
Posts: 161
Joined: Tue, 22. Aug 17, 13:14

Post by lostProfitssssArrgh » Tue, 12. Sep 17, 20:22

The sector renaming won't be included if I ever release a mod for LU/Mayhem.

This was an experiment just for the sake of experiment. No worries :)

User avatar
Jack08
Posts: 2993
Joined: Sun, 25. Dec 05, 10:42
x3tc

Post by Jack08 » Tue, 12. Sep 17, 20:43

just throwing this out there because i remembered, if anyone ever wants to do anything "Dynamic" with names, or any strings really, LU has 3 commands that would allow you to write, erase, and rewrite a TextDB file from within MSCI:

Code: Select all

write to addon-t file: %0 value=%1
write to addon-t #%0 append=%1 printf: fmt=%2, %3, %4, %5, %6, %7
write to addon-t #%0 append=%1 printf: pageid=%2 textid=%3, %4, %5, %6, %7, %8
so theoretically you could make a fully in-game sector renamer.

Therese also an hidden "Write file" & "read file" command that can write/read any file within the games directory, or the documents files - I deliberately left it out of the in-game command listing because well, its not safe - but it might be in the X3 Editor syntax file, unless i left it out of there too for the same reason haha.
[ external image ]
"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire

lostProfitssssArrgh
Posts: 161
Joined: Tue, 22. Aug 17, 13:14

Post by lostProfitssssArrgh » Tue, 12. Sep 17, 21:04

Wow! That's good to know, man.

Thanks a lot!

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”