Hey there,
like the title says, i am looking for the script that renames NPC owned objects, likes ships, stations etc.
Have tried to find it myself, but i think i went through everything and i am unable to identify this simple thing^^
I have only basic coding knowledge, doesnt help to know what to look for.
I am assuming it is part of the faction logic, must be, as the AI renames stuff actively.
First reason is, i wanna see if i can utilize this for my own little mod that aims to refine ship classification and add prefixes to each ship and add a few new class icons. I cant be bothered anymore with renaming stuff everytime. I have actually already two working mods with different methods, but its static and AI uses its own scheme. So i wanna inject my stuff in that scheme, but i cant find it.
Second reason is, the way i've done it was pretty time consuming. A cool excercise to learn about the references. Now lets automate stuff...
Thanks
[help] which script renames NPC objects
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
[help] which script renames NPC objects
***Never not modified***
Specs: I9 9900k, 32GB DDR4, ASUS RTX2060 12GB, Sys drive: 1TB Nvme SSD, Games drive: 1TB Nvme SSD, Win10 pro 21H2
Specs: I9 9900k, 32GB DDR4, ASUS RTX2060 12GB, Sys drive: 1TB Nvme SSD, Games drive: 1TB Nvme SSD, Win10 pro 21H2
Re: [help] which script renames NPC objects
1) Take a mod that does something like this - one that is as manageable as possible
2) Then search for corresponding lines
2b) (you can also go through ALL the scripts with AstroGrep and search for "name" - but that might give a bit many results)
3) Adapt and use the line accordingly for yourself
As an example, here is a mod that temporarily changes the name of a ship ... depending on use, of course, permanently:
https://www.nexusmods.com/x4foundations/mods/370
The interesting line in it then looks like this:
Of course, the whole thing also depends on the reference system ... in the ai script it is the ship itself (this.ship), in an MD script it can look different again ...
2) Then search for corresponding lines
2b) (you can also go through ALL the scripts with AstroGrep and search for "name" - but that might give a bit many results)
3) Adapt and use the line accordingly for yourself
As an example, here is a mod that temporarily changes the name of a ship ... depending on use, of course, permanently:
https://www.nexusmods.com/x4foundations/mods/370
The interesting line in it then looks like this:
Code: Select all
<do_if value="$ADD_ORDER_TAG">
<set_value name="this.$OldName" exact="this.ship.name"/>
<set_object_name object="this.ship" name="this.ship.name + '\033#FFA2560B# #DVE\033X'"/>
</do_if>
Meine Mods bei NexusMods: RS Loss Report RS Bribe for Scandata RS Colors RS Marine Special Training
Meine Mod-Collection bei NexusMods: X4 VRO Reloaded
Meine Mod-Collection bei NexusMods: X4 VRO Reloaded
Re: [help] which script renames NPC objects
Thanks man, looks like i can make use of that. Yeah i started off by looking into smaller mods and expanded from there.
Good tip, luckily I use Directory Opus which does that by default, would be lost working with win file explorer...
The references... a rabbit hole, as it turns out. I am currently working on a complete overhaul of all kinds of atributes and references i might need. The t file is so powerful, as soon as its cleaned up, expanded and properly structured so that noobs like me can work with it.
***Never not modified***
Specs: I9 9900k, 32GB DDR4, ASUS RTX2060 12GB, Sys drive: 1TB Nvme SSD, Games drive: 1TB Nvme SSD, Win10 pro 21H2
Specs: I9 9900k, 32GB DDR4, ASUS RTX2060 12GB, Sys drive: 1TB Nvme SSD, Games drive: 1TB Nvme SSD, Win10 pro 21H2
Re: [help] which script renames NPC objects
No, try AstroGrep, because we don't search files with content - we also want to see the content immediately (adjustable - e.g. 5 lines before and after the appearance of your search term). Believe me ... try it ... that's when it really started for me (well ... a little bit ... but 1000x better than before when you were aimlessly digging around in files)
And of course a good editor. I recommend Notepad++ here - it also has extensive syntax highlighting etc etc ... very helpful.
And of course a good editor. I recommend Notepad++ here - it also has extensive syntax highlighting etc etc ... very helpful.
Meine Mods bei NexusMods: RS Loss Report RS Bribe for Scandata RS Colors RS Marine Special Training
Meine Mod-Collection bei NexusMods: X4 VRO Reloaded
Meine Mod-Collection bei NexusMods: X4 VRO Reloaded