[SCRIPT] Rename ships with Expression 3.4.1 (RSwE) X3:TC/AP Compatible [11/01/2015]

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

Larxyz
Posts: 262
Joined: Tue, 16. Nov 04, 08:46
x3tc

colors

Post by Larxyz »

Hias!

Must say I love this mod :) Makes managing alot of ships infinitly easier!

Would you mind adding the brighter varients of red and green to the color selection though?
Not shure if there is a brighter/darker for each color, but would make multi-colored ship names look nicer :)

thankies!
Medevel
Posts: 106
Joined: Thu, 17. Jun 04, 14:40
x3tc

Post by Medevel »

Hey Guys
Sorry for keep you waiting but i had some hard time to deal with the wings

Wings are the Incarnation of Chaos

First wings can have from zero to unlimited leaders
if that isn't enough they can change the leadership on the fly
without interaction from the user
example:

Blue Wing:
Ships 7 M3
Command: Patrol Sector

situation one: No enemys in sector
everything fine 1 leader 6 follower ships

situation two: now 3 pirate join the sector and the Blue wing
sets intercept course
now there are 3 formations on the wings each for every pirate
3 leader with each 2 follower + one leader and follower less ship
or 2 leaders with each 2 followers and 1 leader with 3 followers

RSwE searchs for leaders and followers cause its the easiest
way to find formations,but in my example there are in
situation one 1 formation.
but in situation two we got up to 3 formations in one fleet.

it may look good for the user since you cant see that in vanilla
but on script-site it looks horrible,
there is also a get-wing-leader command but
it always returned null in my tests, may i used it wrong,
may if that works there might be a chance to order the chaos.

BUT nevertheless i added an option to seperate the wings
so that each wing has 1 simulated formation with one member
as leader and the rest as follower. this is just a workaround but
is working fine, in my tests, one little side-affect this all can have
if the wing has now realleader for example protecting the playership
wich is outside the wing, it happens that *FN only shows "W" for the
simulated leader and "W1" - "Wn" for the rest of the fleet.
Or when there are multiple leaders the can be Leader with "L03" or
"L18" due to the chaotic formation management inside wings
Larxyz wrote:Would you mind adding the brighter varients of red
and green to the color selection though?
not sure they exist but i will test which color is avaible in X3
the only thing is that i need to use the system colors which
means i cant definine custom color, but i will look into that,
if i remember right there were some orange color, but not
sure at the moment.

there is a new version
Changes in v.2.2:
  • fixed the problem that the space for the playership
    to sort it on top was not set to the right position when
    the ship name starts with a color code
  • fixed a problem in my null protection
    one dispensable space was not deleted whenthe name
    starts with a color code and follows with a space
  • added a switch for staying menu to the menu
    this option is per Default Off
  • changed *FN to use the Formation index of the ship
    not the overall ship count and added the zeros
    dymanic if needed
  • changed *ZN to use dynamic zeros
    not sure if added this version or v.2.1 but its there :)
  • changed dynamic zeros from 3 digit-range to
    to 4 digit-range just in case you have more then 1k ships
    but be aware if a counting number reaches 10k there
    will be no more leading zeros, for ships with 1k+,
    so the ships will be disorderly.
  • seperated M1,TL and TM from "Carrier" Default
    these 3 have now there own entry in the Defaults
    i wrote a conversation scipt but if your Defaults are
    messed up, reset them, sorry for any inconvenience
  • added a option to seperate Wings from normal formations
    wings wil now act like loners they fly in their own little
    universe and will ignore other formations
    on the otherhand if activated the other formation will
    also on theirself ignore the lunatic-wings
    this option is per Default OFF
    just for naming ofcourse RSwE changes no command behavior :)
  • fixed *FN and *FI to count also wings again
    but still wings need decend commands like attack,patrol, defend
    to build a formation if Seperate Wings is active wings will get
    their Formation ID even without decent commands
Hope you like it and as always let me know if you encounter any Bugs,error or problems
Greetings Medevel
Probe1
Posts: 701
Joined: Sat, 7. Jan 12, 01:37
x3ap

Post by Probe1 »

Two things that I've said to myself I would love.

Name all stations in a sector;
*G01+*NN (Greek letters ascending in order on a set of ships!)
Medevel
Posts: 106
Joined: Thu, 17. Jun 04, 14:40
x3tc

Post by Medevel »

Hey Guys
Probe1 wrote:Name all stations in a sector;
*G01+*NN (Greek letters ascending in order on a set of ships!)
First renaming Stations in Sector wouldn't be a problem
Second if i understand you right you want something like
first ship α
second ship β
but then when we got to ω how to go on?
ship α1 or ship 1α or start again with ship α

Greetings Medevel
Probe1
Posts: 701
Joined: Sat, 7. Jan 12, 01:37
x3ap

Post by Probe1 »

Perhaps
α through ω then
αβ, αγ, [...], αω
βα, βγ, [...], βω

or αα, αβ and so on.

I don't know how difficult any of this would be. If I'm making a big request then I apologize. :)

EDIT I didn't realize you could rename all stations in a sector under Sector(all) Factories. I uh :oops: Thanks for all your great work haha, that's what I was looking for in my previous post.
wga
Posts: 34
Joined: Thu, 19. Feb 09, 15:04

Post by wga »

1. Player ship on top: Place a space after color code is not enough, since *KC will always before *KG, if player is in ship namming begin with *KG, then it still not in the first place.

I think the following code prefix for player ship will fix it

Code: Select all

*KB *KX
*KB will sort first any other color, and follow a space and then set color back to normal.

2. Add new hot key for simply 'Rename all ships with RSwE defaults': I'd like to rename all when new ships or after rearrangement. one hotkey will be much better to open menu first, scroll down, press enter ......

Thanks ... :)
Medevel
Posts: 106
Joined: Thu, 17. Jun 04, 14:40
x3tc

Post by Medevel »

Probe1 wrote:Perhaps
α through ω then
αβ, αγ, [...], αω
βα, βγ, [...], βω

or αα, αβ and so on.
this is no big request i just need to find a numbering system
with greek letters that will also not disorder the ships, cause
mostly numbering is for sorting :)
wga wrote:1. Player ship on top: Place a space after color code is not enough, since *KC will always before *KG, if player is in ship namming begin with *KG, then it still not in the first place.

I think the following code prefix for player ship will fix it
Code:

*KB *KX


*KB will sort first any other color, and follow a space and then set color back to normal.

2. Add new hot key for simply 'Rename all ships with RSwE defaults': I'd like to rename all when new ships or after rearrangement. one hotkey will be much better to open menu first, scroll down, press enter ......
ahh now i see sometimes i can't read :)
well i will look into that when i test the color codes
i might have an idea for an invisible token,
but this need testing :)
second a hotkey for rename all with defaults
hmm shouldn't be a problem i will see may i have to
add a small script file to launch the default naming
since hotkeys, the last time i checked, can't input script values
but will look into that :)
Greetings Medevel
Theutus
Posts: 15
Joined: Sat, 14. Mar 09, 22:27
x3tc

Post by Theutus »

I'm trying to use *DN, but it keeps showing in the name once it's applied... help!

[edit] NM It's working now, not sure what I did...
Medevel
Posts: 106
Joined: Thu, 17. Jun 04, 14:40
x3tc

Post by Medevel »

Theutus wrote:I'm trying to use *DN, but it keeps showing in the name once it's applied... help!

[edit] NM It's working now, not sure what I did...
hey theutus, i am also not quite sure what did this but i suspect
you had some other signs before "*DN", in example some space or so,
"*DN" only works if in the beginning of the expression,
example "*DN*CL *TH *CS *ZN",
that brings me on an idea why not change that, shouldn't be too hard

Greetings Medevel
Theutus
Posts: 15
Joined: Sat, 14. Mar 09, 22:27
x3tc

Post by Theutus »

Medevel wrote:
Theutus wrote:I'm trying to use *DN, but it keeps showing in the name once it's applied... help!

[edit] NM It's working now, not sure what I did...
hey theutus, i am also not quite sure what did this but i suspect
you had some other signs before "*DN", in example some space or so,
"*DN" only works if in the beginning of the expression,
example "*DN*CL *TH *CS *ZN",
that brings me on an idea why not change that, shouldn't be too hard

Greetings Medevel
Ok it's not doing right... My UT is rank 8 btw

This is what I have typed:

*DN*KB*CL *TS *KW*ZN *TH

This is what's coming out:

*DNTS Mercury MSF 1
Medevel
Posts: 106
Joined: Thu, 17. Jun 04, 14:40
x3tc

Post by Medevel »

hmm theutus this is strange, cant reproduce the error

Edit: Tested it on both X3:TC 3.2 and X3:AP 1.1 with my
SPK installation of version 2.2 and everything works fine

so some standard questions

1. which version of RSwE do you use?
2. which version of X3:TC/AP do you use?
3. which install form did you use SPK or manual(7Z/ZIP)?
4. are you sure "*DN*KB*CL *TS *KW*ZN *TH" is the expresion you used?
5. are you sure your freighter was on a trade mission and not on standby?
(on standby or not universe/local/sector trader command the "*TH"
expression will be empty this is normal)

i am sure you will think, that i think you are stupid, but thats not the
fact, since i can't see what went wrong, i tested it on X3:AP 1.1
and it did allright will test it on X3:TC 3.2 also but i am positive the
result wont differ.

Greetings Medevel
Theutus
Posts: 15
Joined: Sat, 14. Mar 09, 22:27
x3tc

Post by Theutus »

Medevel wrote:hmm theutus this is strange, cant reproduce the error

Edit: Tested it on both X3:TC 3.2 and X3:AP 1.1 with my
SPK installation of version 2.2 and everything works fine

so some standard questions

1. which version of RSwE do you use?
2. which version of X3:TC/AP do you use?
3. which install form did you use SPK or manual(7Z/ZIP)?
4. are you sure "*DN*KB*CL *TS *KW*ZN *TH" is the expresion you used?
5. are you sure your freighter was on a trade mission and not on standby?
(on standby or not universe/local/sector trader command the "*TH"
expression will be empty this is normal)

i am sure you will think, that i think you are stupid, but thats not the
fact, since i can't see what went wrong, i tested it on X3:AP 1.1
and it did allright will test it on X3:TC 3.2 also but i am positive the
result wont differ.

Greetings Medevel
1. SPK v2.2
2. X3:AP 1.1
4. Yes that's the expression, I'm applying it from the clipboard *Y01, There is no space in front of the *DN. I have also manually typed it with the same result.
5. I have been stopping UT before applying the command. I just tried applying with UT running... RSwE halted the UT command.

I appreciate the help you're giving me.

ok I just started RSwE with my hotkey instead of the ship commands menu, I applied the saved clipboard command to "select ship in sector" with the following result:

UT command was not stopped by RSwE.
*DNTS Mercury MSF 1 UT 10
Medevel
Posts: 106
Joined: Thu, 17. Jun 04, 14:40
x3tc

Post by Medevel »

Theutus wrote: 1. SPK v2.2
2. X3:AP 1.1
4. Yes that's the expression, I'm applying it from the clipboard *Y01, There is no space in front of the *DN. I have also manually typed it with the same result.
5. I have been stopping UT before applying the command. I just tried applying with UT running... RSwE halted the UT command.

I appreciate the help you're giving me.

ok I just started RSwE with my hotkey instead of the ship commands menu, I applied the saved clipboard command to "select ship in sector" with the following result:

*DNTS Mercury MSF 1 UT 10
ahh now i see the problem
there is nohing wrong with the code
BUT
you used the expression a bit wrong
*DN should be at the beginning of each expression
so rather than using "*DN*KB*CL...." in the clipboard *Y01 use
"*KB*CL ....." in the clipboard and use "*DN*Y01" to rename your
ship, that way it should work properly, may take a bit since
the default cycle for Dynamic renaming is 60 seconds.

maybe i should add this to the readme

the problem with RSwE halting the UT command is normal,
just use RSwE from your ship and select the ship to rename
and this should not happen again
Edit: using the hotkey is equivalent
to using the RSwE command on your ship

i am positive this will solve the problem,
but in any case reply if it doesn't

Greetings Medevel
Theutus
Posts: 15
Joined: Sat, 14. Mar 09, 22:27
x3tc

Post by Theutus »

That worked!

Thank you for helping me understand where I was wrong!
Medevel
Posts: 106
Joined: Thu, 17. Jun 04, 14:40
x3tc

Update to 2.3

Post by Medevel »

Hey Guys
finaly i got the "playership sort first"-option working properly
it still has some "glitch" in X3TC, since TC is sorting the ships in
the sector list first per class and then per name, so the playership
is in X3TC always the first in its class, but in X3AP, the ships are
sorted per name so there it is working flawless.

next i added a new color, which is orange.
there are still 2 more colors avaible but the one is grey, which i
don't think it will be used much, and black, which is really really
bad to read:)

then i added a new numbering expression, we allready have *FN,*ZN
and *NN, but i was asked by Probe1 to add some ascending
greek letters, after some problems where to begin, i found
some ideas and got a expression running it has only
728 numbers and anything above that will just not processed.
but it is expandable.

Changes in v.2.3
  • added Orange Color
    now you will also color your ship names orange
  • fixed the sort playership first option
    now it should move the playership in sortings always
    to the top and without a space
  • changed *DN handling
    *DN does not require to be the first of the string anymore
    it is now processed like the other expression
    with the side effect that the first rename process
    with *DN is no longer skiped and you can use *DN
    now also in clipboards
    STILL deactivating *DN for a ship is renaming the
    ship with "*DN" without quotes :)
  • added hotkey for RSwE Default renaming
    when the hotkey is pressed it will rename all
    ships and stations with the current defaults
  • added *GN greek numbering system
    numbers the ship with greek letters
    these "number" have a base of 9
    which was needed cause i could not
    implement the last three missing greek letters
    digamma, qoppa and sampi, which would be needed
    for a dezimalsystem (base of 10), which needs
    27 signs, but i got only 24, so i had to convert
    to a base of 9(or nonary), with a side effect that
    the highest possible number is 728
  • added a new file lib.rswe.number.greek.xml
    which converts a dezimal number to a
    nonary number composed of greek letters
    any number bigger than 728 will be returned
    as it is.
  • added an option to use the new greek numbering system
    for the formation ids used in *FP
    which has a limit of 728 ids so if you have more formations
    turn this option off, and post in my thread
    that you have more than 728 formations :)
    this option is per Default Off
Hope you like it and as always let me know if you encounter any Bugs,error or problems
Greetings Medevel
Probe1
Posts: 701
Joined: Sat, 7. Jan 12, 01:37
x3ap

Post by Probe1 »

Siiiiick update! I wanted orange too but I didn't want to ask a bunch of things ^_^

Thank you!

Edit: It's absolutely perfect. My hubs are all cleanly named Hub(ware) (*GN) now. Just sick :D And the orange shows up great.
wga
Posts: 34
Joined: Thu, 19. Feb 09, 15:04

Post by wga »

Some additional suggestion ... :)

*HB will add both station name and its sector, however, only station name will be much better

*TA will rename HQ to 'He' .... huh, how about 'HQ' ? also, since HQ is more important than other station, maybe also able to sort on top ? or add another format for not factory type (single factory, complex hub) station like EQD, HQ ?
Medevel
Posts: 106
Joined: Thu, 17. Jun 04, 14:40
x3tc

Post by Medevel »

wga wrote:*HB will add both station name and its sector, however, only station name will be much better
this is new in AP, back in X3TC
the command -> get Homebase just returned the name
in AP it also return the sector, i wasn't aware of that change,
but will be fixed in the next version
wga wrote:*TA will rename HQ to 'He' .... huh, how about 'HQ' ? also, since HQ is more important than other station, maybe also able to sort on top ? or add another format for not factory type (single factory, complex hub) station like EQD, HQ ?
This is due to the abbreviation process,
example if a string contains multiple words the script will use the first letters
each word, example Mercury Super Freighter gets MSF, on the other
hand if the string does not contains multiple words, it will use the first 2
letters, example Buster gets Bu.
but with the next version i changed the script to rename 'Headquarters'
to 'Head Quarters' so it will be renamed to HQ.

second what is EQD? EQuipment Dock? these stations are in vanilla
basicly just warehouses, so it never bothered how they are renamed.

Also why does this needs to be in the code, just rename some
stations/ships individual, and not just everything with the same batch.
RSwE is more than just a 'fast automated renaming tool'.
If put some work into the features like clipboards, and such, you can
do much more than you do now with Defaults-Hotkey-Smashing.

There was in the old thread also someone who liked to have
everything done by the code.
But RSwE is a tool, no KI, it should help you with organising
your property names, but not do all the work for you.
If i continue adding more and more defined cases, to the code,
RSwE will degenerate to OBNT "One Button Naming Tool", which
is in no way what i disire, i love RSwE in all it features, and i put a lot
of work into them, so some times, i must remind the users:
"Hey YOU are playing the game, not some KI!".
I am open for suggestions and i have gone far to make RSwE more
comfortable and user friendly, but i have to reduce the pace,
before it gets out of hand. Hope you can understand that.

To come back to the EQD's which are basicly warehouses, if not
used with some scripts, which i don't know if they work.
It is not a work of 5 mins to generate a clipboard, and rename every
single warehouse with this clipboard.
1. edit clipboard -> put in some code
2. select Station in sector
3. rename it with "*Ynn"
this are simple steps, and step 2 and 3 never takes longer than
15 seconds for finding the target and 10 second to type the code.
You can even use multiple clipboards with makes name unique,
individual.
Won't you be bored if everything is the same?
Sure its easier to handle, but isn't it the individuality, which makes
things interresting?

Greetings Medevel
wga
Posts: 34
Joined: Thu, 19. Feb 09, 15:04

Post by wga »

OK, get it, simply rename by using clipboard.

Huh, I must use 'rename all' too much. As playing the game, there are too many things change when time going. Capture 2 M7 ships, Buying additional 3 TS and lost one UT ship, rearrange some TS's job from CAG to CLS or change there homebase. Then, huh, rename all, and check each ship's name to know next step.

It will be much simple when capture 2 M7 ships and 'rename all M7 ships in current sector' at that time, do the same when get 3 TS ... etc.

About Headquarters and Equipment Dock (Trading station is also a warehouse). I've place *TC (Number of units of your factory) in station's name and each time check it by rename all, and it also rename Headquarters to He, huh, a little strange for me to see TS ships have a 'He' homebase. Then I think maybe we can seperate it with two forms. Just like thinking seperate TL/M1 to different form.

Actually, I am playing the game, don't build a self-supplying complex. my complex need lots of resource to buy from NPC's station. Need to check the complex and its CAG, CLS status to rearrange jobs, that's why using rename all so offen.

I like RSwE can do for users. By rename with additional info, player can have overview of all ships, station, and make job assignment.

I am sorry to let you think trying to get RSwE be a OBNT.
I just give some thoughts when playing the game.
Medevel
Posts: 106
Joined: Thu, 17. Jun 04, 14:40
x3tc

Post by Medevel »

wga wrote:OK, get it, simply rename by using clipboard.

Huh, I must use 'rename all' too much. As playing the game, there are too many things change when time going. Capture 2 M7 ships, Buying additional 3 TS and lost one UT ship, rearrange some TS's job from CAG to CLS or change there homebase. Then, huh, rename all, and check each ship's name to know next step.

It will be much simple when capture 2 M7 ships and 'rename all M7 ships in current sector' at that time, do the same when get 3 TS ... etc.

About Headquarters and Equipment Dock (Trading station is also a warehouse). I've place *TC (Number of units of your factory) in station's name and each time check it by rename all, and it also rename Headquarters to He, huh, a little strange for me to see TS ships have a 'He' homebase. Then I think maybe we can seperate it with two forms. Just like thinking seperate TL/M1 to different form.

Actually, I am playing the game, don't build a self-supplying complex. my complex need lots of resource to buy from NPC's station. Need to check the complex and its CAG, CLS status to rearrange jobs, that's why using rename all so offen.

I like RSwE can do for users. By rename with additional info, player can have overview of all ships, station, and make job assignment.

I am sorry to let you think trying to get RSwE be a OBNT.
I just give some thoughts when playing the game.
Hehe you see now we can have some real discussion, i never said,
you got nothing to do in X it is one of the most awesome feature,
that you can do soo much, but sometimes you need to push the
people, to see what they are after.

It seems you missed one of the most usefull features in RSwE:
Dynamic Renaming short DN,
it has per default a 60 seconds cycle, and you can give each ship
a Dynamic Name.
As examples are the best TS-ships,
you need a lot and they are easily destroyed.
so lets have a little complex with some lack of teladium,
CLS or GAC, will help you to get the teladium.

Now lets rename the ship like i use for most of my traders
*DN*CL *TH *CU *HB

for my UT's it will be something like
TS UT 23 700 EC MY HQ

for the teladium provider it would be
TS GAC5 500 Te MY COMPLEX

Now the UT gots destroyed so the teladium provider must
fill the gap, of cause he lacks at experience so i have to send
him on Sector trader duty.

So i set the new homebase an give him his new commands
now thanks to DN one moment his name was still
TS GAC5 500 Te MY COMPLEX

the next it will be ( no cargo now )
TS ST 1 MY HQ

after a few hours i check the TS again so he will be called
TS ST 8 600 Or MY HQ

i see that he has enough experience to be local trade so
i give him the new command and short time later some
TS LT 9 400 Si MY HQ
will greet me.

This example is hypothetic but still it can happen this time,
and without renaming him more than once!

So there is no "i must use 'rename all' too much", there is no
reason i must rename a TS via 'rename all' functions, like
the 'rename all via Defaults'-function, even if his commands
change, especially not when from one trader to another trader.

You can't tell me that it is difficult or time consuming to rename
a few ships, and even more there is no reason to rename a station,
especially a warehouse, more than once when using *DN + *TC,
since DN will keep the name up2date.

I didn't say you should stop giving suggestions, but i feared, with
your requests, that you are using RSwE wrong, and with your answer
it seems i was right.
It was never my intention to offend you in any way, but i learned
the hard way, that questions like "why do you want this", are useless
cause you mostly won't get an honest answer, and never get the
informations you need, so radical methods must be used.

Greetings Medevel

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