[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: Moderators for English X Forum, Scripting / Modding Moderators

User avatar
joelR
Posts: 2008
Joined: Mon, 9. Jul 07, 23:33
x3tc

Post by joelR » Sat, 4. Feb 12, 07:42

Medevel im using the beta version. It would be useful to be able to move the caret forward when naming. As it is now I cant put a space between expressions.

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

Post by Medevel » Sat, 4. Feb 12, 15:01

Probe1 wrote:My initial thoughts are the colored menus are fine and you should reverse the order on renaming
>Insert Text
>Insert Expression
>Move Carrat
> Delete
It's only my initial thoughts; I'll check back in later to let you know.
This won't be a problem i just like to have some Feedback before it gets live, if it ever will :)
joelR wrote:Medevel im using the beta version. It would be useful to be able to move the caret forward when naming. As it is now I cant put a space between expressions.
I guess you didn't catch how to move the carret,
since i found no way to make the standard input window accept some text,
i had to write my own little menu.
too move the carret you have 2 menu items

Code: Select all

Move Carret to        <<< Beginning >>>
Move Carret
the first one is a slider you can select via "left" and "right" -keys on your
keyboard the position the Carret should move, if the text is empty you
wont be able to select something different than "Beginning" since there
actual is nothing else.
The custom menus are not that interactive as they may seem and so
you have to use the second menu item to actual move the Carret.
I hope you allready got how to use it, if not i also made a little video here

Greetings Medevel

User avatar
joelR
Posts: 2008
Joined: Mon, 9. Jul 07, 23:33
x3tc

Post by joelR » Sat, 4. Feb 12, 15:05

One more thing. Using the beta version I get an error message on an existing save game. I followed the directions in the error message but this didnt remove the message. After uninstalling the beta and reinstalling 2.6 I still have this error message when I load the save.

Using 3.2 of course.

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

Post by Medevel » Sat, 4. Feb 12, 15:27

I assume you are refering to this

Code: Select all

RSwE: An error occurred, please save and reload the new save!
this error message is send when X3 register one or more of my hokeys
with the same ID.
When you still get the message,
1. save the game right after the message was sent
2. quit X3,
3. deinstall RSwE
4. load the game with out RSwE,
5. look up if there is no longer any RSwE hotkeys.
6. save again,
7. quit
8. reinstall RSwE

if there are still hotkeys left from RSwE, when RSwE is not installed,
i need to write an uninstall script, which deletes the hotkeys.

Normal X3 should be able to give each of the hot keys an own ID,
don't ask me why it can't some times, but i found out about this,
when testing the hotkeys and some where missing.

Greetings Medevel

User avatar
joelR
Posts: 2008
Joined: Mon, 9. Jul 07, 23:33
x3tc

Post by joelR » Sun, 5. Feb 12, 04:52

That didnt work unfortunately.

Everything was fine till I reinstalled. After loading the save I get the same error and there are no hotkeys at all.

I think this may be a bug with AP. I have noticed that hotkeys I have setup will disapear after installing a script that adds hotkeys. (sometimes)

Everything works just fine though.

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

Post by Medevel » Sun, 5. Feb 12, 12:28

This error just affects the Hotkeys, the main functions are untouched
by this error, you can ignore this error msg, in my tests it will be gone after
a few save and reloads.
I also have a savegame with no hotkey of RSwE present, but when i start
this save game, with RSwE i get this error, even if i check for hotkeys
before.
AP has a new command "get id for hotkey with script", but even
this return null, and when RSwE try to register the hotkeys, all 3 gets the
same ID.
But it is not a RSwE specific problem, for example FCC adds
roughly 20 hotkey and with every start 3-8 are missing, so it is
something wrong with X3.
On the other hand if the message won't be sent on load, the hotkeys
are working, and as i said before this error only affects the hotkeys,
all other RSwE functions will still work.

Greetings Medevel

jiunejai
Posts: 56
Joined: Fri, 4. Mar 11, 08:47
x4

Post by jiunejai » Thu, 9. Feb 12, 14:02

Thx for script, that helps a lot.

However, there are 2 functions I hope they will be added in.

1.Just rename select ship/station with RSwe defaults.
2.Edit select ship/station's name.

They will greatly help me to manage and discriminate my commerce fleet.

User avatar
Erenar
Posts: 279
Joined: Sat, 24. Dec 11, 00:24
x4

Post by Erenar » Sat, 11. Feb 12, 12:17

Odd issue.

I installed, started a new game and went to hotkeys. It showed 1 occurrence of the RWSE hotkey options as intended. I enabled script editor for IR, reloaded the save and went to hotkeys... Now there are 2 occurrences of each RWSE hotkey.

I turned off AL, saved and uninstalled the script, reloaded and, instead of no options, I still have the 2 RWSE options per hotkey and no RWSE installed (checked folders and definitely no RWSE scripts there).

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

Post by Medevel » Sat, 11. Feb 12, 12:52

jiunejai wrote:Thx for script, that helps a lot.

However, there are 2 functions I hope they will be added in.

1.Just rename select ship/station with RSwe defaults.
2.Edit select ship/station's name.

They will greatly help me to manage and discriminate my commerce fleet.
Thanks for reply the first option, can be implemented quite
easy, i just need to readout he class of the ship and send it
to renaming with the associated namingsheme.
the second option is more advanced, and has some problems to be solved,
first, i found no way to add some value to the normal "input text"-window
from X3, the one that comes up for example if you rename a ship/station
with X3 commands,
second, that means i have to use my "Edit-Menu" which is currently,
user unfriendly, you can test an imho better version with the beta i posted,
check first post first site for a link :p,
but this still need some work.
Erenar wrote:Odd issue.

I installed, started a new game and went to hotkeys. It showed 1 occurrence of the RWSE hotkey options as intended. I enabled script editor for IR, reloaded the save and went to hotkeys... Now there are 2 occurrences of each RWSE hotkey.

I turned off AL, saved and uninstalled the script, reloaded and, instead of no options, I still have the 2 RWSE options per hotkey and no RWSE installed (checked folders and definitely no RWSE scripts there).
normal you should have 3 hotkeys from RSwE, even "unistalled" there
will be hotkeys left since i wrote no uninstall script to delete them.
But it should not be possible that 2 RSwE hotkeys with the same name
be present, can you send me a screenshot and/or the save game, so
that i can see the problem?
For free and easy upload try http://www.mediafire.com/
Greetings Medevel

User avatar
Erenar
Posts: 279
Joined: Sat, 24. Dec 11, 00:24
x4

Post by Erenar » Sat, 11. Feb 12, 15:46

A little later I will send a ss... you would need to install a ton of mods to get one of my saves to load so ss is a better option. Should be later this afternoon, I'm in the middle of creating an XRM:AP map atm.

Grimshad
Posts: 102
Joined: Wed, 6. May 09, 06:31
x3ap

Post by Grimshad » Sat, 11. Feb 12, 18:19

When you say the color bug was fixed by egosoft, which color bug are you refering to? Because I still get blank messages for ships with colored names from this mod, Although The colored names of sectors and ships from other mods come through fine in messages.

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

Post by Medevel » Sat, 11. Feb 12, 18:38

Grimshad wrote:When you say the color bug was fixed by egosoft, which color bug are you refering to? Because I still get blank messages for ships with colored names from this mod, Although The colored names of sectors and ships from other mods come through fine in messages.
Which X3 version are you playing on?
i am playing on X3:TC 3.2 and X3:AP 1.1 and haven't recieved any
blank messages since X3:TC 3.1, which fixed the color bug.

Greetings Medevel

User avatar
Erenar
Posts: 279
Joined: Sat, 24. Dec 11, 00:24
x4

Post by Erenar » Sat, 11. Feb 12, 19:53

As promised and running on TC btw...

http://img820.imageshack.us/img820/1286 ... 00008m.jpg

Coruskane
Posts: 849
Joined: Fri, 13. Jun 08, 13:14
x4

Post by Coruskane » Thu, 16. Feb 12, 21:17

I have a suggestion. Could you modify the 'show factory ware' bit (the name and quantity) to capture more than one ware? (and likewise for the name)

I would suggest you implement it such that the first time *CS is used just works as usual, but the second and third etc times get the second and third products etc (perhaps according to % of storage currently used).

For example, I have a resource production facility that churns out Ore and Silicon as products. Currently I can just get the ore quantity, but it would be great if I could have both the products somehow show.

EDIT: and a rename lasertowers option would be nice :)

jiunejai
Posts: 56
Joined: Fri, 4. Mar 11, 08:47
x4

Post by jiunejai » Thu, 23. Feb 12, 06:19

Erenar wrote:As promised and running on TC btw...

http://img820.imageshack.us/img820/1286 ... 00008m.jpg
Maybe you need this.

NOTE:Make a save before doing anything!!

jiunejai
Posts: 56
Joined: Fri, 4. Mar 11, 08:47
x4

Post by jiunejai » Thu, 23. Feb 12, 11:47

Medevel wrote: Thanks for reply the first option, can be implemented quite
easy, i just need to readout he class of the ship and send it
to renaming with the associated namingsheme.
the second option is more advanced, and has some problems to be solved,
first, i found no way to add some value to the normal "input text"-window
from X3, the one that comes up for example if you rename a ship/station
with X3 commands,
second, that means i have to use my "Edit-Menu" which is currently,
user unfriendly, you can test an imho better version with the beta i posted,
check first post first site for a link :p,
but this still need some work.
What should I do for updating to Beta version since?
Just overwrite all files from scripts and t folder?

Anyway, here is some more ideas:

1. When edit clipboards, add a option to copy from select ship/station and replace original one.
Spoiler
Show
Just copy letter, so it still needed drawn if wish.
We can easily copy, reedit, and rename by this way.
And this is also convenient to add a special station name within.

The option tree after select clipboard will be like this:
 A:Edit
  Yes-reedit No-write a new one
 B:Copy (letter) from select ship/station in sector
2. Could remove home base sector sign from code *HB?
Spoiler
Show
I have add *SA in each construction for quickly identify from list.
So it's unnecessary to show it again.(And it's too long that showing hole sector name)
Instead, add new code *HS to show home base sector and *HA too show abbreviate one.

3. About *CM, Yeah, I already know it's a missile count, so It's superfluous that tell me again.
Compare with DM, I prefer to see Dra or Dis so that I can really identify what missile I have. :roll:
Spoiler
Show
Gee, I find there is the same abbreviate name "FM" with 4 different missiles!!! :lol:
Maybe we should redesign the abbreviation of missiles used in.
And, XRM adds some new-type missile in the game.
Have we designed the abbreviation of them?
I don't check yet, but, since XRM is a popular Mod, I think we should.

4.
Spoiler
Show
After I familiar with game, I prefer to know remnant quantity of ammo/missile rather than type of ammo/missiles.
Usually, we will set resupply data from weapon control center.
Maybe we can calculate sum of usable ammo/missiles and show the radio between this and sum of resupply data.

For these, I suggest 2 code
*RM : Radio between remnant quantity and resupply quantity of usable missile.(Total sum of different type)
*RA : Radio between remnant quantity and resupply quantity of usable ammo.(Total sum of different type)

Spoiler
Show
For example,
I have 3 poltergeist, 1 delta, and 1 spectre missiles in my Terran Sabre's cargo bay which missiles resupply data are 10 for poltergeist, 5 for delta, and 0 for others.
(within XRM1.7d, Sabre compatible with poltergeist, delta, tau, sigma)
Code "*RM" will shows "3/15 M"
5. *RA for abbreviated *RC
Spoiler
Show
The same as *RC but abbreviated race name.
Terran -> Ter, Argon -> Ar, Boron -> Bo, Goner -> Go, Kha'ak -> Kh,
Paranid -> Pa, Pirates -> Pi, Spilt -> Sp, Teladi -> Tel, Xenon -> Xe,
Yaki -> Ya
6. Redesign Abbreviation of race name in code *SR
Spoiler
Show
P stand for Paranid or Pirates? T stand for Terran or Teladi? and A?
Final,

7. Amount of specific ware.
I affirm that this will be the most Challenging, but Great useful.
Spoiler
Show
Besides the stupid method that design different code for each wares:
*ECELL for e-cell and it's amount
*EMPC for EMPC and it's amount
etc.
It's directly, easily, convenient for user maybe, but KILL the scripter!! :lol:
or,

Maybe we can build a wanted list to wares for pre-load ware ID for use?
Design a form list and define *W01 to *W99 just like the clipboards.
After click *W01 from wanted wares list, the list of all ware in game will appear.
(The list maybe sort by wares' type, as Encyclopaedia?)
Through this list, I can select the ware that I want to "monitor".
And when I select one, script will call out the ware's ID and record in *W01.
Then we design the code "*WA" in order to show Amount of the ware which ID is behind.
So if we give E-cell to *W01 and "EC: *WA*W01" to rename a ship which with 1000 E-cell in it's cargo, it shows "EC: 1000"
Of course we can put *DN in front for monitor, or design this function within *WA.

Second way include some feature,
a. User may easily set needed ware and use to rename different ship without searching, retyping, remembering.
b. Wanted ware list may also work on unofficial ware add by MODs, such as Advance Jumpdrive.
c. Leave the scripter out of scripting great amount of boring argument.(But maybe kill scripter in the other way. :P )

------------------

Wow, such a long reply, I believe that your eyes must some tired.
Thank to who read the whole reply. :D

dizzysoul
Posts: 22
Joined: Wed, 22. Feb 12, 01:34

Post by dizzysoul » Fri, 2. Mar 12, 12:53

I would like to say thank you for this great mod! I love it!

There is one thing that would make this script absolute perfect, but I am having trouble figuring out how to do this:

Is there a way to have "Rename everything with RSwE defaults" exclude specific ships/stations?

For example, I would like to have all my ships and stations use *DN so they can keep updated on their ranks and wares, but then I also have certain ships that I would like to have custom titles and different names that the current expressions cannot build properly (like giving your PHQ a proper name). If I manually rename these ships after using *DN, the custom names get wiped out every update.

I know I can manually rename these ships with a blank *DN to cancel the updating, and then put in my own custom name. But I would have to redo this every single time I use the "rename everything with defaults" command, because there's no way to protect certain ships and stations from getting renamed.

I want 90% of my ships/stations to use the programmed defaults, but there's 10% that I don't want to use defaults. Currently, it's all or nothing.

Any help with this is greatly appreciated!

(p.s if it's not possible to do what I'm asking with this script, please consider adding an expression that protects a particular ship/station from blanket renaming commands, thanks!)

hpsbranco
Posts: 4
Joined: Wed, 7. Mar 12, 19:07
x4

Post by hpsbranco » Wed, 14. Mar 12, 15:18

Thank you a lot for this work! It made my life incredibly easier lol

One problem though: my TP is being renamed as one of the freighters. I mean, I use *DN*CL *TN *ZN *TH and my ships get renamed like this:

TP Ocelot 02
TS Drake 01 UTxx
TS Drake 03 UTxx

Is there a way to fix this?

Also, another question: why the script stop all commands being executed in the ship that runs it? I guess it's some technical limitation, but I am curious :)

Again, great job!

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

Post by Medevel » Wed, 14. Mar 12, 22:04

Hey Guys sorry i answer that late but were some busy times,
so here is some WALL-OF-TEXT if you are willing to read all
if you are quoting from that post please dont quote the complete post :)
jiunejai wrote:1.Just rename select ship/station with RSwe defaults.
2.Edit select ship/station's name.
the first is done in v2.7
the second i still have to fiddle with the Edit menu!
but 2.7 contains my Edit menu and i would like to get
some feedback to make it better
Erenar wrote:Odd issue.I installed, started a new game and went to hotkeys. It showed 1 occurrence of the RWSE hotkey options as intended. I enabled script editor for IR, reloaded the save and went to hotkeys... Now there are 2 occurrences of each RWSE hotkey.
I turned off AL, saved and uninstalled the script, reloaded and, instead of no options, I still have the 2 RWSE options per hotkey and no RWSE installed (checked folders and definitely no RWSE scripts there).
i could only change the script that this problem won't happen again,
but it can't be fixed cause the variable to hold the hotkey id, were overwritten
by the second hotkey set so the ids of the first set are gone. i could write a script,
which deletes every single hotkey by scrolling through all posible ids, but i am not
sure X will survive this.
Also i added an uninstall script. since this might get handy
Coruskane wrote:I have a suggestion. Could you modify the 'show factory ware' bit (the name and quantity) to capture more than one ware? (and likewise for the name)
...
EDIT: and a rename lasertowers option would be nice :)
Revamped *TP to show the product and amount,
if the station has multiple products it shows the 3 most filled.
Also i removed *TC since *TP got that function now too,
this will have the downside that RSwE 2.7 won't recognize
*TC and will add it as string so you will need to remove *TC from
the namesheme.
I also added an option to increase/decrease the amount of products shown.

With an option to rename Lasertowers, i think you meant an option
to the rename all ships/staions in sector/universe lists?
well if so i allready added it in 2.7
i read in the X3:AP 2.0 patch notes that egosoft added some lasertowers
but haven't seen them so i can't be sure if they will work too
jiunejai wrote:1. When edit clipboards, add a option to copy from select ship/station and replace original one.
Just copy letter, so it still needed drawn if wish.
We can easily copy, reedit, and rename by this way.
And this is also convenient to add a special station name within.
The option tree after select clipboard will be like this:
A:Edit
Yes-reedit No-write a new one
B:Copy (letter) from select ship/station in sector
I am not sure i understand that correctly.
first what do you mean with
Copy (letter) from select ship/station in sector
if i understand correctly you want a easy way to copy a namingsheme
from an allready renamed ship/station?
if yes this will need a few new variables, on the ships, but it is possible
on the otherhand this will require a custom Edit Menu since
the X-script commands for user input are extreme limited

Code: Select all

<RetVar/IF><RefObj> get user input: type=<Script Reference Type>, title=<Var/String> 
<RetVar/IF><RefObj> get user input without sector: type=<Script Reference Type>, title=<Var/String>
<RetVar/IF><RefObj> get user input type=<Script Reference Type>, title=<Var/String>, sector=<Var/Sector> 
a few examples

$ship = [THIS]->get user input: type={Var/Ship/Station owned by Player}, title=$text
this will ask the player to select a ship or a station which is owned by
him through out the whole universe and saves the selection in $ship.

$ret.edit = [THIS]->get user input: type={Var/Boolean}, title=$text
this is a simple Yes/No question

$nameScheme = [THIS]->get user input: type={Var/String}, title=$text
this will ask the player to input some text, and saves in in $nameSheme
but it won't allow to add some pre-definied text, like ship names which
the user could change, no this will always start blank, thats why, a
custom Edit menu is required, if you need pre existing values
jiunejai wrote:2. Could remove home base sector sign from code *HB?
I have add *SA in each construction for quickly identify from list.
So it's unnecessary to show it again.(And it's too long that showing hole sector name)
Instead, add new code *HS to show home base sector and *HA too show abbreviate one.
i am also not sure with this one :)
1.if i understand you right, you are using *SA in the name of the homebase
and you are using *HB which reflects the name of the homebase on your TS
and you are complaining that the *SA-tag-resulted-Sectorname is delivered
from the *HB tag?
2.or do you have something like this as *HB out
name-of-thehome-with-Sector-abbreviation (Sector whatever)

if its the first case i only have to tell you, you can't go in the supermarkt
buy an apple and an edding, go out, write on the apple your name,
with the edding. go back in the shop, and complain that your name
is on that apple, that you just bought!
Means if you add *SA to the name of the Homebase, *HB will always
return the name of the Homebase, with what ever the name contains.

if its the second case you are using an old version pre 2.4 cause the
extra (sector whatever) was added by egosoft with the AP release.
With the AP release egosoft change the ->get homebase command,
to return the name and the sector of the homebase.
this i fixed in version 2.4 and fixed a resulting unknown object bug
in version 2.5, the beta was on stand of version 2.6. so please update
RSwE, if you don't know how:
Tutorial - Installing mods and scripts to your game by LV
jiunejai wrote:3. About *CM, Yeah, I already know it's a missile count, so It's superfluous that tell me again.
Compare with DM, I prefer to see Dra or Dis so that I can really identify what missile I have. :roll:
Gee, I find there is the same abbreviate name "FM" with 4 different missiles!!! :lol:
Maybe we should redesign the abbreviation of missiles used in.
And, XRM adds some new-type missile in the game.
Have we designed the abbreviation of them?
I don't check yet, but, since XRM is a popular Mod, I think we should.
Yeah i see your point, i use only one kind of missiles per ship,
so i haven't experienced that.
but i changed the code to cut off 'missile' from the missile name before
shortening.
to the second part, to design a list of abbreviation string for a ever changing
game is one of the most stupid ideas one can have, because you will
invest more time in updating the list than anything else, so no i have no
list for them.
but since i am using a function to abbreviate the names i haven't got any
problems with compatiblety, if the guys from the XRM-team, add their
missiles the proper way, which i guess they do, RSwE will get these
missiles with the ->get compatible missile array function, and everything
is fine.
jiunejai wrote:4. After I familiar with game, I prefer to know remnant quantity of ammo/missile rather than type of ammo/missiles.
Usually, we will set resupply data from weapon control center.
Maybe we can calculate sum of usable ammo/missiles and show the radio between this and sum of resupply data.
For these, I suggest 2 code
*RM : Radio between remnant quantity and resupply quantity of usable missile.(Total sum of different type)
*RA : Radio between remnant quantity and resupply quantity of usable ammo.(Total sum of different type)

For example,
I have 3 poltergeist, 1 delta, and 1 spectre missiles in my Terran Sabre's cargo bay which missiles resupply data are 10 for poltergeist, 5 for delta, and 0 for others.
(within XRM1.7d, Sabre compatible with poltergeist, delta, tau, sigma)
Code "*RM" will shows "3/15 M"
before i can even beginn to think about this, i have one question:
which mod/script you use to set the "missiles resupply data"?
i ask because i am not familar with any X3 vanilla function that does
this, if you have a mod/script for this please share the name with me
sothat i can look if i can read out this informations and process them.
jiunejai wrote:5. *RA for abbreviated *RC
The same as *RC but abbreviated race name.
Terran -> Ter, Argon -> Ar, Boron -> Bo, Goner -> Go, Kha'ak -> Kh,
Paranid -> Pa, Pirates -> Pi, Spilt -> Sp, Teladi -> Tel, Xenon -> Xe,
Yaki -> Ya
6. Redesign Abbreviation of race name in code *SR
P stand for Paranid or Pirates? T stand for Terran or Teladi? and A?
to first i added that but it may look funny since i increased the one word shortening
from the first 2 letters to the first 3 letters, to get some difference between Te(terran)
and te(teladi), which results in ter and tel but for Yaki it will be Yak.
jiunejai wrote:7. Amount of specific ware.
I affirm that this will be the most Challenging, but Great useful.
Besides the stupid method that design different code for each wares:
*ECELL for e-cell and it's amount
*EMPC for EMPC and it's amount
etc.
It's directly, easily, convenient for user maybe, but KILL the scripter!! :lol:
or,
Maybe we can build a wanted list to wares for pre-load ware ID for use?
Design a form list and define *W01 to *W99 just like the clipboards.
After click *W01 from wanted wares list, the list of all ware in game will appear.
(The list maybe sort by wares' type, as Encyclopaedia?)
Through this list, I can select the ware that I want to "monitor".
And when I select one, script will call out the ware's ID and record in *W01.
Then we design the code "*WA" in order to show Amount of the ware which ID is behind.
So if we give E-cell to *W01 and "EC: *WA*W01" to rename a ship which with 1000 E-cell in it's cargo, it shows "EC: 1000"
Of course we can put *DN in front for monitor, or design this function within *WA.
As i read this my though about the first approach was "WTF? No Way!"
but the second approach looks more promising, but instead on double Expression
*WA*Wnn i used *Wnn.
and btw it was not that hard allready had pre existing features which handle things
similar, so this is also added in 2.7.
dizzysoul wrote:I would like to say thank you for this great mod! I love it!
There is one thing that would make this script absolute perfect, but I am having trouble figuring out how to do this:
Is there a way to have "Rename everything with RSwE defaults" exclude specific ships/stations?
For example, I would like to have all my ships and stations use *DN so they can keep updated on their ranks and wares, but then I also have certain ships that I would like to have custom titles and different names that the current expressions cannot build properly (like giving your PHQ a proper name). If I manually rename these ships after using *DN, the custom names get wiped out every update.
I know I can manually rename these ships with a blank *DN to cancel the updating, and then put in my own custom name. But I would have to redo this every single time I use the "rename everything with defaults" command, because there's no way to protect certain ships and stations from getting renamed.
I want 90% of my ships/stations to use the programmed defaults, but there's 10% that I don't want to use defaults. Currently, it's all or nothing.
Any help with this is greatly appreciated!
(p.s if it's not possible to do what I'm asking with this script, please consider adding an expression that protects a particular ship/station from blanket renaming commands, thanks!)
Just a simple blacklist for RSwE Defaults would be a bit short sighted,
so i decided to add a kind of Lock Expression to RSwE( and an UnLock Expression ofcourse)

for expample we have a TS which we only use for personal things,
like trailing your playership with amunition, missiles or EC's, we give this ship
a name easy to recognize, but the rest of the TS's we rename with a common
Namesheme, which fits on every trader.

Before we always had be carefully not to rename our personal TS
when renaming new Trader TS, ofcorse you can always use rename
all ship in sector or docked to whitelist only the ones you like to rename,
But its always the moments you forget your personal TS and zack you
renamed all TS in the whole universe.
To prevent this I added a Lock Expression *LN if this Expression is used,
The next time RSwE renames the ship, it won't change its name,
UNLESS *LN or *UL (UnLock) is present in the new namesheme.
this way the Locked name can still be UPDATED from DN.
IF the new namesheme does not contain *LN or *UL it will not
change the name even if DN is used, and will also change the DN back
to the Locked namesheme.

usage for locking:
*KRMY TS*KW *CU*LN*DN
This will lock the name to "MY TS1509 EC"
but will updatethe EC-count if they increase/reduce
usage for unlocking
*CL *CU*UL*DN
will unlock the name and rename it to "TS 1509 EC"
if you use just *UL when renaming a ship it will
get the standard X name Your whatever, since the name
just be unlocked but no new name set, but it will reset
the name when DN rushes through again, so if you locked
a name with *DN either used *DN and *UL together
or first deactivate *DN and then unlock it with *UL
hpsbranco wrote:Thank you a lot for this work! It made my life incredibly easier lol
One problem though: my TP is being renamed as one of the freighters. I mean, I use *DN*CL *TN *ZN *TH and my ships get renamed like this:
TP Ocelot 02
TS Drake 01 UTxx
TS Drake 03 UTxx
Is there a way to fix this?
Also, another question: why the script stop all commands being executed in the ship that runs it? I guess it's some technical limitation, but I am curious :)
Again, great job!
To the first part i seperated all ship classes in 2.7, so this behavior should not
appear again, except you select one of the "superclasses". So i tested all
and i added the classes they contain to the text, so that it is clear, which
ships are renamed.

To the second part you guessed correctly it has to do with the
AUTOPILOT-System in X. every ship-command in X3 is a
autopilot command, means you select it and the autopilot
powers up.
Since RSwE adds a Ship-Command to the Custom-Selection
of the Command-Menu it is normal that this command overwrites
the current autopilot command and stops the ship. This can
be usefull, if you are inside the RSwE-Menu, and dont see where
you are flying sothat you dont crash into anything.
on the otherhand it is counterproductive if you select your Universe
trader and starts the RSwE-Menu from that ships Command-Control
the universe trader will also stop and wont take on his command
after closing the RSwE-Menu. BTW the hotkey does not trigger
the autopilot, cause they are directly linked to the script and
not to the Ship-Command.
Thats why i searched the forum for a solution for this behavior but
i only found a bypass solution, which is not perfect and also not
very elegant. Every ship-command can load an script before the main
script is called, this is normaly made for some conditional-queries
before you run the main script. if this preload script return TRUE
the autopilot will call the main script, if it returns FALSE the
autopilot ignores the call and remain with its current task.
this way we can run the main script from the preload script,
i made a switch sothat the user can turn it on and off, and
return false if we ran the main script or true if the option was
off sothat the autopilot fires the main script.

So now, as you read i was mentioning a version 2.7,
yes its a wall of text and its gets bigger i know :)
Changes in v2.7
  • fixed the double Hotkeys issue
    sadly i can only prevent it from happening again
  • added unistall script uninstall.plugin.rswe.xml
  • added a new option to select a Station/ship and rename it with Defaults
  • revamped *TP to show the product and amount
    if the station has multiple products it shows the 3 most filled
  • removed *TC, because of the changes to *TP
  • added an option to adjust the maximum products shown in *TP
  • added a new file lib.rswe.sort.arrays.xml
    it handles the sorting of the products and amounts by percentage
    of the max amount
  • added Lasertower to rename all ships/stations in sector/universe
    and to Defaults current Default is *CL *SA
  • changed *SR to use the shortening script for the race instead
    which results in Arg for Argon or Ter for Terran
  • rewritten my Edit Menu to add features and make it easier to use
    this menu will look a bit different in TC, than it looks in AP
    but the functions are the same
    if you can't handle or like this menu there is still
    a "use plain input mode" button, which will exit this menu and
    uses the X3 input mode
  • added an option to deactivate the Edit Menu
    for those who don't like it, can't control it or what ever reason
    This Option is by Default Off
  • replaces every string input windows with my Edit Menu
  • silents the Autopilot
  • added and Option to prevents the Autopilot to become active
    means that RSwE Menu won't override the current Autopilot command
    This Option is by Default Off
  • addedfile lib.rswe.cmd.check.xml to silents the Autopilot
  • added file lib.rswe.cmd.preload.xml to prevents the Autopilot to become active
  • fixed missiles to be renamed without 'Missile' to differ some missiles
    which been shortened to the same abbreviation like DM or FM
  • fixed shields to be renamed correctly like 25MJS and 200MJS instead of
    2MS (yes, before, both shield type got renamed to this, when shortened)
  • added *RA
    Adds the Ships Creator Race Abbreviation - Nova = Arg, Raptor = Ter
  • added *W01 - *W99
    Ware and amount in cargo bay of ship/station (set in Edit Wares List menu)
  • added an Option to edit the Wares List which is used in *Wnn Expression
  • added *LN
    Locks the current name to the ship and only updates it if *LN or *UL is present
  • added *UL
    UnLock the Lock set by *LN
  • Seperated every Ship class
    this affects "rename all ships in Sector/Universe" and the Defaults
    so if your Defaults are messed up reset them
  • cleaned the T-File
have fun and report any bugs,problems or errors you may encounter

Greetings Medevel

jiunejai
Posts: 56
Joined: Fri, 4. Mar 11, 08:47
x4

Post by jiunejai » Thu, 15. Mar 12, 13:55

Great thank for your reply and update.

Medevel wrote:what do you mean with
Copy (letter) from select ship/station in sector
I simply want to copy named ship's name into clipboards.
Since there is some change within 2.7, maybe we can leave it till it need to pay attention.
Medevel wrote:i am also not sure with this one
1.if i understand you right, you are using *SA in the name of the homebase
and you are using *HB which reflects the name of the homebase on your TS
and you are complaining that the *SA-tag-resulted-Sectorname is delivered
from the *HB tag?
2.or do you have something like this as *HB out
name-of-thehome-with-Sector-abbreviation (Sector whatever)
in my case, *HB will show as "your complex (Titan)".
Is there the way to take off "(Sector whatever)" in *HB?
BTW, I'm sure I have correctly install RSwE v2.6.

Medevel wrote:before i can even beginn to think about this, i have one question:
which mod/script you use to set the "missiles resupply data"?
i ask because i am not familar with any X3 vanilla function that does
this, if you have a mod/script for this please share the name with me
sothat i can look if i can read out this informations and process them.
It's vanilla function within "Automatic Missile Resupply" task at ship/advanced/weapons.

----

After all, how to update to 2.7?
cover all files directly?

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