[Mod] UT CaC Advanced Renaming

The place to discuss scripting and game modifications for X Rebirth.

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

Post Reply
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13817
Joined: Sun, 20. Nov 05, 23:45
x4

[Mod] UT CaC Advanced Renaming

Post by UniTrader » Sun, 4. Sep 16, 00:22

Deutsches Thema
steam Workshop

or better currently "Advanced Renaming" only since its not dependent on the other Project and because i just finished it its also not yet Integrated there (but integration is planned ;) )


This Extension allows more Flexibility in Object Names. Especially you can define a Name Template and all Objects will be named according to this Template and it adds Colored Object Names. Its simple to use since you just rename your Properties as usual, but you can simply include expressions which will be replaced by what you really want to write there. Also the Names can be edited easily since the Expression will be displayed in the Rename Menu, not the resulting Name ;)
Also three Mass Renaming Functions have been added to the Renaming Menu. Buttons should be self-explaining.

Colored Names
To color Object Names just put these Expressions before the part intended to be colored:
/blk black
/gr1 gray 1
/blu blue
/cya cyan
/grn green
/mag magenta
/red red
/lbl light blue
/whi white
/yel yellow
/gr2 gray 2
/hex for Hexadecimal (RRGGBB) Color in the format /hexBADA55#

Insert Expressions
these pre-definied Expressions exist:
###> First the ones which dont change for a specific update (or wont cause an update if they should change) - generally perfixed with /
/type = > Typename of the Object Macro (for example Scaldis)
/class = > Object Class (currently XL, L, M, S, XS and ST - please notify me if more pop up)
/purpose = > InGame-Purpose of the Obejct (Trade, Fight, Build, Mine, Scan or Hack)
/freightclass => Compatible Freight Classes ( BCEL ), if its universal its U and if its all Types in seperate bays its M (Scaldis)
/zone \
/sector = > Name of the Zone/Sector/Cluster the Object is currently in (Intended for Stations, No Auto Update)
/cluster /
/sup.zone \
/sup.sec = > Similiar to the 3 before, but refering to the Superior, not the Object itself
/sup.clu /

###> Next the Expressions which will cuase an Update if their Value changes (prefixed with $)
$stageA# => building progess of a Stations build sequence (A for example; works up to I) - will result in nothing if the Station doesnt have the related sequence in its full plan.
$sup.name => Inserting the Name of the Superior ($-Expressions are curt away for this)
$money => current amount of Cash the Pilot/Manager has
=> Skills: Skill Values of certain Control Entities can be inserted with a 3-letter-combo:
$SAB
where the $S is always the same (S for Skill ;) )
A stands for the following options:
B => Boarding NPC
C => Pilot,Captain (both are technically equal)
D => Defense Officer
E => Engineer
M => Manager
and B defines the Skill to be inserted:
A => All(Combined; goes from 0 to 100 instead of the others 0 to 5)
B => Boarding
C => Combat
E => Engineering
L => Leadership
M => Managment
N => Navigation
O => Morale
S => Science

###> And last Mass Renaming Expressions - these are only useable via Mass Renaming:
%sub.id => Serial Number of Subordinate Ship
%sub.total => Total Number of Subordinate Ships


Custom Expressions
There is a seperate Extension available here - it is seperate from the Steam Workshop to not mess up custom expressions.
Additionally you can define Initial Names for Stations, Big Ships and Small Ships when you buy/build them there now. i recommend putting a curstom expression there and define the full name with this Expression, because that way you can change it easily when you change your mind ;)
i have left a short explaination how to use it there. Also all previously explained / and $ Expressions can be used inside there without restrictions ;) (no support for %-Expressions) here a short example which was used to create the Workshop preview:

Code: Select all

  <t id="0">/BShip</t>
  <t id="1">/grn/type /blu$SCP /mag$SDP /yel$SEP /cya/class/purpose/freightclass</t>
  <t id="2">/Station</t>
  <t id="3">/grn/type /blu$SMP /mag$SDP /cya$stageA#$stageB#$stageC#$stageD#$stageE#$stageF#$stageG#$stageH#$stageI#</t>
Example Screen
here.

Download
here.

Script-defined Expressions (for use by other Modders)
You can also provide Additional Expressions via Script by writing to a Blackboard Var of the Captain/Manager of the Ship/Station ( this.$namereplacement.$expression ) and send an Update Signal immediately after writing there ( <signal_objects object="this.container" param="'Object Name Updated'" delay="100ms"/> )
This is currently used by these Mods:
=> My Navigation Scripts
-> $destination
=> My Defense Officer Scripts
-> $utcac_do_state
-> $utcac_do_droneratio

Changelog
Updates (2) on 2016-09-06:
=> fix: mod mow enabled by default
=> fix: removed unnecesary dependencies
=> fix: Updating all Object Names on Game loading now doesnt leave null ships
=> feature: 2 new dynamic expressions: %class and %purpose
=> feature: Additional Post-Processing expresssions (to cut out/change dynamic parts)

update on 2016-09-25:
=> new Function: Mass Renaming Big Ship/Small Ship Subordinates only
=> new expressions:
-> %subnumber - serial number of Subordinate when mass renaming
-> %subtotal - total number of Subordinates
Note: when mass renaming small/big Ships both apply to the specific sub-set of subordinates only.
=> Fixed/Completed German Lang File
=> some preperation work to work togehter with another mod of mine (not functional yet)

update on 2016-09-26:
=> French Language Added (still needs some refinement)
=> Fixed: several Issues with renaming the wrong/no Objects
=> as sideeffect a manual Name Update is now possible by Renaming but leaving the Name unchanged

update on 2016-10-03:
=> Added leading Zeroes to %subnumber (based on total number of renamed subordinates)
=> new Expression %scriptset to indicate the Script Set used by the Objects controlentity (Currently only Vanilla and my Manager Scrit)
=> new Special Expressions DEBUG and DEBUG OFF - first one stays in the Name unchanged, but sets this.$debug on all relevant Entities on the Object (used by my scripts to activate debug output), second one is removed completely from the Name but also deletes the aforementoined Variable
Note: it does not activate the vanila debug output yet - have to find out how to do this best first.
=> (only fot my Manager- and soon-to-be Fleet Command Script) 2 new Expressions:
%ordercount => Length of Command Queue
%currentorder => currently executed Command
=> diverse bugfixes and opimisations

update on 2016-10-12:
=> Added Normal Color Tag at the end of all Names (happens transparently and is not displayed in the Rename menu)
=> Changed Renaming Responsibility on Stations from DO to Manager (transition shouldnt be noticeable - if something doesnt work as expected let me know)
=> New automatically generated Shortname Added (its the Object Name minus all expressions which can change) - it is used for exressions like %superiorobject
=> (forgotten in last changelog): new Expressions %SCP, %SMP, %SDP etc. - displays all primary Skills of Captain/Manager/Defense in order of importance ( like "534" )
=> (forgotten in last changelog): new expressions /rco0 to /rco9 - results in random colors (one for each of the 10 expressions)

update on 2016-10-16:
=> Fixed: Updating Object Names Globally using the Version Number in the Custom Expressions file didnt work
(note: patch forces an update of all Player Object Names)

update on 2016-10-31:
=> Added new Function to use a Name Template for new Ships in the custom file
=> Changed many Expressions to shorter Variants (you may have to check/update your custom file)
-> made obvious distinction between updating expressions and non-updating ones (former is prefixed with $, the latter with / )
Last edited by UniTrader on Sun, 19. Mar 17, 00:39, edited 11 times in total.
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 ;)

JESS 246
Posts: 539
Joined: Mon, 3. Jul 06, 03:24
x3

Post by JESS 246 » Tue, 6. Sep 16, 02:18

Hi UniTrader

I'm trying your renaming mod but i'm not having much luck in changing the names colouring and not fully understanding your info on how to insert the expressions wording.

I know i'm missing something as I'm doing these in the rename window /blu Scaldis or %blu = > Scaldis even blu Scaldis or %blu Scaldis or blu = > Scaldis

Can you explain further in how it should be written please

ianrobo75
Posts: 289
Joined: Mon, 13. Aug 07, 11:47
xr

Post by ianrobo75 » Tue, 6. Sep 16, 03:55

have a look at the example screenshot.

I assume you want /blu%type
Win7 Pro SP1 64-bit, Intel i7-3740QM @ 2.7GHz. NVidia Quadro K4000M (4 GB). 16 GB ram.

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

Post by UniTrader » Tue, 6. Sep 16, 06:08

exactly. Also check if the extension is enabled - just noticed i copied a content.xml as template which is disabled by default, so you have to enable it before use..
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 ;)

JESS 246
Posts: 539
Joined: Mon, 3. Jul 06, 03:24
x3

Post by JESS 246 » Tue, 6. Sep 16, 14:27

Thanks all will try again and ops i didn't look if it was enabled will check

will be awesome once i get it going like the ones we had for the earlier X games.

JESS 246
Posts: 539
Joined: Mon, 3. Jul 06, 03:24
x3

Post by JESS 246 » Tue, 6. Sep 16, 16:46

Hi UniTrader

Yep i didn't have the extension turned on silly me but now it's on it is showing red in the extension list and not working in the game.

Also in my extension list many other mods i use are off as well assuming these are not up to date with 4.0 not all that worried and as yours is new and assuming working with 4.0 i've no idea why its red in my extension and not working ingame.

Though others that were red in my extension in the past had work till updates fixed the red.

UniTrader i know this mod is a great mot to have but i think if it's is possible it needs to be like lets say at the start of a new game or launch start we get a pop-up menu with the colour plus ship list that at this point we pick the colour for the ship we have or get as example below.

On pop-up menu we see this

Colour---Ship
red ---fighter
blu ---freighter
grn ---XL cap fight
yel ---miner
and so on.
we pick a colour then a ship type like this yel---freighter so any colour to any ship at pop-up and that would be how the player ships would show ingame of course the ship name could be used or type code ie M1 - XL in list.

And how about we can colour the ships/stations as well not just the name it's getting dull and boring watching all them gray objects lets have some colour even our real space station is white any thought on this i know there's was something similar ships only with an old Xgame.

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

Post by UniTrader » Tue, 6. Sep 16, 17:45

silly me :oops: obviously it works for me since l also left a few unnecesary dependencies on other WiP Mods by me which are not yet publicaly available.. just fixed that... ;) re-dl or delete the two dependency lines (and maybe also the enabled="false" )

Regarding the other point: i may look into Mass Renaming (already have a vague plan to add a "Rename all Subordinates"-Feature which would include placeholders for a Object counter and another placeholder for total Subordinates, but thats all for now..
I dont want to add a popup to choose a color for new Ships, which could get annoying.. Especially since this Mod can do more than just color the Ship Name in one color (you can in fact make each letter a diffrent color if you want ;) :D )

this Mod is mostly intended to streamline custom renaming Processes. you can define own expressions for this purpose or, if you are lazy, even define Ship Names themselves as Expression ;) then you just have to enter, add some char like space and Exit the Rename Menu to apply the Coloring. (look out for possible infinite loops though - i dont do any valadity checking with the phrases yet)

Example Addition Entries in the t/0001.xml based on your suggestion would be for manual Entry:

Code: Select all

<page id="5554301" title="Object Name Expressions" descr="UT Command and Control" voice="no">
........ (existing lines)
  <t id="10">/fig</t>
  <t id="11">/red%type</t>
  <t id="12">/fre</t>
  <t id="13">/blu%type</t>
  <t id="14">/xlc</t>
  <t id="15">/grn%type</t>
  <t id="16">/xlm</t>
  <t id="17">/yel%type</t>
then you just fave to type "/fig" for any fighter and its type name will be displayed in Red, or /xlc for any xl combat Ship, where the type will be displayed in green. Even have a Feature planned where you can change these and update all Ships when loading a Save making Experimenting easy (partially implemented in a broken way currently - will result in many names changed to null atm :D )

On the other hand you can also Use Ship Names as "Expressions" and just entering the rename menu, adding a space (there is possibly a check in the lua wheter the Ship Name actually has been altered - maybe thats not required) and then color will be applied based on Ship Name:
continuing the example before:

Code: Select all

  <t id="20">Taranis </t>
  <t id="21">/grn%type</t>
  <t id="22">Rahanas </t>
  <t id="23">/bluRahanas </t><!-- this May Freeze and reqiure some workaround - didnt test yet. -->
  <t id="24">Scaldis </t>
  <t id="25">/yel%type</t>
Coloring the Stations or Ships themselves is afaik not possible, but i have somethign roughly in that direction - curretly for Ships only though. Also working on a less intrusive method to apply the Ship Logos (using Effects instead of Upgrades) which i would integrate in this Mod when it works (also with logo selection inside the Rename Menu)




And one more hint: you can also use this Mod to Organize your Property List - Coloring is done internally by adding 2 invisible Letters to the Ship name, and the first of those pecedes all regular Letters (the second is a regular one, just invisible) - since the Property List is sorted Alphabetically you can apply manual Sorting by prefixing a Ship Name with two Color Tags: the first for the Sorting (Ships will be sorted in the Order in which the color Tags are named in the OP) and a second directly after that for the actual color.
for example a
/gr2%type
would usually be last of the colored names (although still preceding non-colored ones) and
/blk/gr2%type
will be on the top of the list even though it looks the same as the previous one (internally its like "#ZTaranis and "#0#ZTaranis")
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 ;)

JESS 246
Posts: 539
Joined: Mon, 3. Jul 06, 03:24
x3

Post by JESS 246 » Tue, 6. Sep 16, 19:25

Thanks UniTrader

Will look into your new info to make mod work for me though not overly worried about using it i just dabble in the game now and again sorry i do use other mods of yours not the faction one though have tried it but to fly around a sip to see a logo seems pointless if factions were in separate colour code ie in map or radar then that be a little clearer.

Mind you i allway change the names of ships to the assigned station like Scaldis to XLF Capyard 1 (XL freighter capital shipyard 1) so as to know what station they are from at a glance.

As for other ideas ie pop-up i understand maybe add similar ideas i mentioned to the new X4 Game i read about.

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

Post by UniTrader » Tue, 6. Sep 16, 21:59

feedback recognized - didnt think anyone would use the Object Class for anything (not specific enough) , but now it has been added (WiP Screen - i did modify it a bit after that! ):
https://www.dropbox.com/s/wg6l2srvdqzwr ... 7.png?dl=0
Also adding Post-Dynamic expressions which will modify the Name after the dynamic part once more to display "XL" instead of "ship_xl" as seen in the Screen (and "Trade" instead of "trade")

Also i fixed the aforementioned problem with the Update of Object Name Templates - when you change them also change the entry in Page id 5554302 / t id 1 to something diffrent than currently (just count up ;) ) to auto-update everything on loading. will write a better explaination when i figured out how to put this custom stuff in a seperate file apart from my own text file..



in short (still too long for a tl;dr): in the next Version (which i just uploaded) you can set your Default Name by writing "/name01" and having these additonal Entries in the t-file in page 5554301:

Code: Select all

<t id="10">/name01</t>
<t id="11">%class%purpose %superiorobject</t>
<t id="10000">%CLASS:ship_xl%PURPOSE:trade</t>
<t id="10001">XLF</t>
<t id="10000">%CLASS:ship_l%PURPOSE:trade</t>
<t id="10001">LF</t>
<t id="10000">%CLASS:ship_xl%PURPOSE:mine</t>
<t id="10001">XLM</t>
<t id="10000">%CLASS:ship_l%PURPOSE:mine</t>
<t id="10001">LM</t>
(assuming yiu named your Station "Capyard 1" and Miners are LM and XLM )
Note: i am using some internal intermediate expressions there which would be replaced by my internal post-processing
i want to put this in a seperate File from my Mod File, but didnt find a good solution for this yet (early approach with t/0002.xml didnt work )
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 ;)

JESS 246
Posts: 539
Joined: Mon, 3. Jul 06, 03:24
x3

Post by JESS 246 » Wed, 7. Sep 16, 09:24

Hi UniTrader

I have reinstalled your retweaked mod and tried again this time the extension was not red but in game when i go to rename in ships info and click the rename button the ships info screen disappear and all control locks up not sure if this is a glitch or some conflict.

As i said earlier not overly worried about using it sorry as i only have a go now and again when new mods are about.

Must say all you other mods i use work fine.

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

Post by UniTrader » Wed, 7. Sep 16, 17:58

*deleted previous post of myself*

Ok, Pacakging Error fixed it seems.. just confirmed that the Downloaded Version works under both Linux and Windows - so please delete old Mod Folder, Re-download and apply again if you want to use this :)
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 ;)

JESS 246
Posts: 539
Joined: Mon, 3. Jul 06, 03:24
x3

Post by JESS 246 » Wed, 7. Sep 16, 20:49

Thanks Uni

Bingo that one works Ok i have colour will be using once i get the hang of it.

Any chance of the mod file going into Workshop for auto updates as you improve this mod.

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

Post by UniTrader » Wed, 7. Sep 16, 20:57

not until i find a way how the users can customize their Text Files without having to mess around with the Cats/Dats or magically kwnoing Mod Internals. (adding some plain files to the Mod which are outside the Cats/Dats would be a solution, but these arent read at all)
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 ;)

JESS 246
Posts: 539
Joined: Mon, 3. Jul 06, 03:24
x3

Post by JESS 246 » Wed, 7. Sep 16, 21:38

Understand i'm sure you'll work it out till then nice work on all your mods.

JESS 246
Posts: 539
Joined: Mon, 3. Jul 06, 03:24
x3

Post by JESS 246 » Fri, 9. Sep 16, 01:00

Hi UniTrader

Just an update to your mod and no i'm not knocking it or complaining.

I've just given all my stations coloured names like green for foods type stations and different colour for station types etc.

So far some colours look dull or different too me as blue looks purple and red/yellow looks too dark as with most others and as for black i get this /0330 Hardware in the name slot and no colouring.

I know the colours look different by the guidance of other ingame colours ie blue ships/stations blue is blue and reds are reds not to sure if the name colours are effected by the background colours what i do know is they don't look anyway close to what they should.

The other thing is i had assumed by your instruction info we had to place the correct name like this /blu Scaldis to get the colour but this is not so on trying out other wording this do work like /blu Trader1 ST1 instead of correct name and not sure if you were aware of that.

My other gripe is not the mod it the name slot i find as we cant scroll the cursor back without deleting the name lettering this in the past has been annoying and now even more so that we have to delete all to place the colour code at start, why the cursor back scroll was not placed in the system beats me so maybe anyway of placing a cursor scroll back in the naming window slot.

Post Reply

Return to “X Rebirth - Scripts and Modding”