[Mod] Advanced Renaming (updated 2020-07-11)

The place to discuss scripting and game modifications for X4: Foundations.

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

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Re: [Mod] Advanced Renaming (updated 2019-02-27; compatible with 2.20)

Post by UniTrader » Fri, 5. Apr 19, 11:31

Just for Information:

Mod is compatible with Version 2.21 since the menu_map.lua is unchanged. Also im working on Aforementoined function for serial Numbers (yea, i know im slow), and will update soon ;)
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Re: [Mod] Advanced Renaming (updated 2019-02-27; compatible with 2.20)

Post by UniTrader » Fri, 12. Apr 19, 21:48

ok, just added previously mentoined functionality and some other, minor, changes:

=> Added Check for Game Version in lua and if the version is unknown only use less intrusive changes (improves compatibility, but in unrecognized Versions the Names will be empty on renaming)
-> recognized Versions: 2.00 (334398), 2.20 (339509), 2.21 (341463)
-> This should make it Compatible with the current 2.5 Beta (didnt look into it yet), with minimally reduced functionality
=> Added Sequence Numbers, with the limitation that each object can have only one which will stay until deleted, even if the type is changed.
-> Available Sequence numbers:
/seqall > Counter for all Ships, no seperation between type or class
/seqtype > Counter for each Ship Type (Variations count as seperate Type)
/seqsize > Counter for each Ship Size Class (L, XL etc)
/seqpurp > Counter for Ship Purpose Class (Trade, Fight, Mine, Build)
/seqclass > Counter for Size+Purpose combination

-> Control Codes (will be removed entirely after being performed)
/seqdel > Delete currently assigned Sequence Number to get a new one
/seqresetall
/seqresettype
/seqresetsize . . . > Remove current Sequence Number of that type and start over at 1 (already assigned Numbers will stay)
/seqresetpurp
/seqresetclass


=> NOTE: currently the new Strings/Expressions is Coded into the Script directly. I will externalize it with the following Version (i just wanted to push this to get a look into the 2.5 Beta)
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Re: [Mod] Advanced Renaming (updated 2019-04-12)

Post by UniTrader » Sat, 13. Jul 19, 12:50

Just updated the Mod for same function in 2.50, but for some reason the editable name doesnt work anymore.. still made it based on 2.50 files
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

Daering
Posts: 1
Joined: Fri, 16. Aug 19, 12:58

Re: [Mod] Advanced Renaming (updated 2019-07-13)

Post by Daering » Fri, 16. Aug 19, 13:14

I just make a registration (long time around, just stalking and reading) to say Thank You for bringing one of my favorite XR mod to X:F.

Can't express well enough* how I am thankfull to you and all other moders, for your hard work and efford to make our expirience in X universe better.

*well, I can't express it in a good way too, because my English sux, obviously, so please, don't mind my Engl.

argon_emperor
Posts: 1225
Joined: Mon, 12. Dec 05, 07:41
x4

Re: [Mod] Advanced Renaming (updated 2019-07-13)

Post by argon_emperor » Thu, 19. Sep 19, 12:28

Great mod, makes renaming stuff so much easier (especially with the options for defaults)

However, I use /type+ /seqtype, and sometimes I get a 'null', instead of a number on the first of a type. So far had it on my starting ship (both an Elite Vanguard and Eclipse Vanguard), a Nemesis Sentinel, a Stork Vanguard, and a Mammoth Vanguard. At first I thought maybe it was the Vanguards were being an issue, but the Nemesis Sentinel threw that off, and have gotten several other Vanguards with no issue. Any idea on what's causing that?

EDIT: And the next Eclipse Vanguard I claimed somehow went to 5. After then doing /seqdel and then /seqresettype (which I had already tried several times), suddenly they started going in order. So it went weird for some random reason there
[ external image ]
***modified***
"You can get more of what you want with kind words and a gun, than you can with just kind words" - Al Capone

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Re: [Mod] Advanced Renaming (updated 2019-07-13)

Post by UniTrader » Thu, 19. Sep 19, 16:27

some reproduction steps would be great. Alternatively a logfile is also helpful so I can see what exactly happens.

you can create one by adding '-logfile debuglog.txt' as startup Parameter, and to log a ships Renaming Process add 'DEBUG' Somewhere in the name. All following Naming actions for this ship should be printed in detail to the Log (even if you remove the expression).
You can find the Log next to your Savegame folder in your Documents.

After you are done you can disable the Logging for a ship by putting 'DEBUG OFF' somewhere in the name (it will be removed entirely as confirmation)


Anyway when I'm at home I will try to reproduce myself.
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

argon_emperor
Posts: 1225
Joined: Mon, 12. Dec 05, 07:41
x4

Re: [Mod] Advanced Renaming (updated 2019-07-13)

Post by argon_emperor » Fri, 20. Sep 19, 05:00

Okay, just triggered it again on an Odysseus Sentinel, added the DEBUG and tried again, still gives null instead of a number, tried twice, got the following error in the debug log:

Code: Select all

[=ERROR=] 36065.16 Error in AI script order.trade.perform on entity 0x2080a62: Property lookup failed: $targetobject.isblacklisted
* $targetobject == null
* Expression: $targetobject.isblacklisted.{blacklisttype.objectactivity}.{$blacklistgroup}.{this.assignedcontrolled}
[General] 36065.16 ======================================
[General] 36174.98 ======================================
[=ERROR=] 36174.98 Error in MD cue md.UT_CAC_Object_Name_Managment.NameUpdate_FromLua<inst:48e3b47>: Failed to set null.$current_id to value 3
* Expression: $object.pilot.$current_id
[General] 36174.98 ======================================
[General] 36174.98 ======================================
[=ERROR=] 36174.98 Error in MD cue md.UT_CAC_Object_Name_Managment.NameUpdate_FromLua<inst:48e3b47>: Property lookup failed: $object.pilot.$current_id
* $object.pilot == null
* Expression: $object.pilot.$current_id
[General] 36174.98 ======================================
[General] 36213.08 ======================================
[=ERROR=] 36213.08 Error in MD cue md.UT_CAC_Object_Name_Managment.NameUpdate_FromLua<inst:48edd27>: Failed to set null.$current_id to value 4
* Expression: $object.pilot.$current_id
[General] 36213.08 ======================================
[General] 36213.08 ======================================
[=ERROR=] 36213.08 Error in MD cue md.UT_CAC_Object_Name_Managment.NameUpdate_FromLua<inst:48edd27>: Property lookup failed: $object.pilot.$current_id
* $object.pilot == null
* Expression: $object.pilot.$current_id
[General] 36213.08 ======================================
I have the custom renaming extension in there active as well for default naming, which for all of them are the same, set to "DCSF /type+ /seqtype" (without quotation marks)

After waiting a few minutes, and doing the /seqdel/seqresettype (which I had tried before adding the DEBUG in), it then renamed it with the correct number.
Not sure if that's enough info, and still have no idea why it seems to trigger randomly with some ships and then others work perfectly fine the first go. About the only thing I can maybe think of that's common between the null ones are they were either boarded, or claimed quickly after bailing.
[ external image ]
***modified***
"You can get more of what you want with kind words and a gun, than you can with just kind words" - Al Capone

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Re: [Mod] Advanced Renaming (updated 2019-07-13)

Post by UniTrader » Fri, 20. Sep 19, 11:49

ok, I think I know what's causing this now. I store the sequence number with the pilot and if you rename while there is no pilot in place it can't store the ID and subsequently not read it for putting it in the name. Will change that soon. sadly no way to recover already lost sequence numbers.
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

argon_emperor
Posts: 1225
Joined: Mon, 12. Dec 05, 07:41
x4

Re: [Mod] Advanced Renaming (updated 2019-07-13)

Post by argon_emperor » Fri, 20. Sep 19, 12:16

Ahh, so probably best to wait on the default naming for a bit till you get round to changing that, and just stick with a user defined one to quickly rename after putting a pilot in. Glad I could be of some help finding a situation it didn't quite work as expected... Though not so glad that I've caused you extra work XD

Honestly though, this mod already helps make my life so much easier with renaming ships, such a pain otherwise >.<
[ external image ]
***modified***
"You can get more of what you want with kind words and a gun, than you can with just kind words" - Al Capone

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Re: [Mod] Advanced Renaming (updated 2019-07-13)

Post by UniTrader » Sun, 22. Sep 19, 20:12

i just made the needed changes but for lack of an existing save with this issue i didnt get around to test yet.
You can find the Updated Version on Github for now, will make a package when i tested it.
https://github.com/UniTrader/ut_advanced_renaming => Clone or Download => Download ZIP
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

argon_emperor
Posts: 1225
Joined: Mon, 12. Dec 05, 07:41
x4

Re: [Mod] Advanced Renaming (updated 2019-07-13)

Post by argon_emperor » Mon, 23. Sep 19, 14:46

Been playing for a bit with the updated version, just wanted to let you know I haven't had a null show up again now, so looks like your changes worked as you intended. Cheers :)
[ external image ]
***modified***
"You can get more of what you want with kind words and a gun, than you can with just kind words" - Al Capone

User avatar
TSM
Not a Moderator
Posts: 2947
Joined: Thu, 1. Jul 04, 12:31
x4

Re: [Mod] Advanced Renaming (updated 2019-07-13)

Post by TSM » Wed, 24. Jun 20, 14:18

Not sure what i am doing wrong here

This mod and G_Work_Around are installed

But if for example i rename /yel blahship

Code: Select all

/yel blahship
gets displayed with no colour change

##EDIT##

Fixed after UT updated it :D
Last edited by TSM on Fri, 3. Jul 20, 23:27, edited 1 time in total.
FAQ's Egosoft Interactive FAQ
Egosoft Wiki

Baldamundo
Posts: 99
Joined: Sat, 21. Jun 08, 18:46
x4

Re: [Mod] Advanced Renaming (updated 2019-07-13)

Post by Baldamundo » Fri, 3. Jul 20, 22:12

Is this compatible with the latest versions?

User avatar
TSM
Not a Moderator
Posts: 2947
Joined: Thu, 1. Jul 04, 12:31
x4

Re: [Mod] Advanced Renaming (updated 2019-07-13)

Post by TSM » Fri, 3. Jul 20, 23:26

Baldamundo wrote:
Fri, 3. Jul 20, 22:12
Is this compatible with the latest versions?
Yes works in 3.20 and Beta 3.30 B2 :)

Unitrader recently updated the version on his github
FAQ's Egosoft Interactive FAQ
Egosoft Wiki

Baldamundo
Posts: 99
Joined: Sat, 21. Jun 08, 18:46
x4

Re: [Mod] Advanced Renaming (updated 2019-07-13)

Post by Baldamundo » Tue, 7. Jul 20, 21:14

TSM wrote:
Wed, 24. Jun 20, 14:18
Not sure what i am doing wrong here

This mod and G_Work_Around are installed

But if for example i rename /yel blahship

Code: Select all

/yel blahship
gets displayed with no colour change

##EDIT##

Fixed after UT updated it :D
I've downloaded the version from Github and the version of G_Work_Around from the linked thread, but I'm still getting this problem. Any idea what I'm doing wrong?

EDIT: Tried it with the more recent version of G_Work_Around from Nexus and it's still not working.

EDIT2: Huh. Seem to have accidentally fixed it somehow :?

EDIT3: Ahhh, seems to only work from the ship information menu, not from the right-click menu. Now if I can just get /seqclass to display something other than "null" and also work out how to use the post-dynamic expressions. Am I right in understanding that post-dynamic ones should correlate to something I've put in the regular user defined names to change it after that's been implemented? I.e. if I have "/purpose" in the UD replacement, then put "Mine" in the post-dynamic expression it should rename my Miners to what I've defined in the post-dynamic replacement?
Last edited by Baldamundo on Tue, 7. Jul 20, 23:26, edited 3 times in total.

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Re: [Mod] Advanced Renaming (updated 2019-07-13)

Post by UniTrader » Tue, 7. Jul 20, 22:19

Just a quick heads up:
=> Mod folder Name is important. you have to remove the suffix -master which github attaches to it (otherwise the game wont find the required lua file)
=> while the old _G workaround should still work (i didnt remove the calls for it) i have migrated to SirNukes' Lua Loader as primary lua loading extension
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Re: [Mod] Advanced Renaming (updated 2019-07-13)

Post by UniTrader » Sat, 11. Jul 20, 14:18

Just updated the Version linked in the first Post.
Changes i remember sine the last update (sorry, its been a while):
=> Fully Compatible with latest non-beta Game Version* (slightly reduced functionality in Beta or any unknown game Version)
=> Now Uses SirNukes' Lua Loader if present (old _G Workaround can still work, but is not used if the loader is present)
=> Name Edit Line modified so you edit the Name with the Expressions rather than the coloured resulting name (NOT present untested Game Versions)
=> Also some cleanup was done
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

user1679
Posts: 761
Joined: Fri, 20. Jul 18, 23:20

Re: [Mod] Advanced Renaming (updated 2020-07-11)

Post by user1679 » Sun, 12. Jul 20, 20:58

Is it possible to add functionality to rename NPCs you've hired?

I started a discussion about how directly editing the save file doesn't work. Currently in game there's no option to rename a hired NPC when you right-click them. I would like to rename some of my crew to mimic popular sci-fi heroes.

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Re: [Mod] Advanced Renaming (updated 2020-07-11)

Post by UniTrader » Mon, 13. Jul 20, 17:53

Not really in the Scope of this Project. Also would require more hacking in the UI than i want.
Only compromise i can see is to make an expression to rename the Pilot or Manager of a Ship, but thats it. not any NPC present, which is obviously what you want.
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

user1679
Posts: 761
Joined: Fri, 20. Jul 18, 23:20

Re: [Mod] Advanced Renaming (updated 2020-07-11)

Post by user1679 » Tue, 14. Jul 20, 06:34

UniTrader wrote:
Mon, 13. Jul 20, 17:53
Not really in the Scope of this Project. Also would require more hacking in the UI than i want.
Only compromise i can see is to make an expression to rename the Pilot or Manager of a Ship, but thats it. not any NPC present, which is obviously what you want.
Thanks for the reply. I was afraid of that.

I find it interesting that Ego decided to save the pilot with a name and unique id but not the crew.

Post Reply

Return to “X4: Foundations - Scripts and Modding”