[SCRIPT: Upd 09/02] Rename ships with Expression 1.7 (RSwE) New links
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
-
- Posts: 6
- Joined: Wed, 6. Jan 10, 18:12
-
- Posts: 2
- Joined: Wed, 26. May 04, 09:58
this puts the full sector race owner and sector name in format Race.Sector, useful for automatically keeping satellites up to date with *DN*NV *SQ when using conflicts or other sector takeover mods
the automatic incrementing numbers *FN *NN *ZN aren't working as of X3TC v2.7. *NN sets all ships to "1" every time, *FN sets all to " 001", *ZN sets all to "null001". not sure why just yet. here's a quick hack to just get the last number off the ship's ID code instead:
also I can confirm using expressions stored in clipboards isn't working as of X3TCv2.7. eg setting clipboard 1 as "*CL *TS *NN", then setting ship name to *Y1, has the effect of actually naming the ship with the string "*CL *TS *NN".
Code: Select all
else if $part == '*SQ'
$sector = $currentship->get sector
$sector.race = $sector->get owner race
$addstring = sprintf: fmt='%s.%s', $sector.race, $sector, null, null, null
Code: Select all
else if $part == '*IS'
$temp = $currentship->get ID code
$addvar = get substring of $temp offset=6 length=2
from what i understand so far, dynamic names appears to work like thiscorbosman wrote:im having a bit of a problem with this plugin. It seems some ships are now stuck with their name. No matter what expression I use, it doesnt change. All I can do is change the name manually in game.
Last expression I used was:
*DN*TN - *CL (*SC)
1. if the script picks up *DN at the start, the name doesn't change immediately; instead the script saves the string and adds a property 'RSWe.DN' = 'string' to the ship object
2. every time the AL script fires it grabs all of your ships, sorts through the ones that have 'RSWe.DN' = something, and then sends them to the rename tool script to rename them
so if you set a dynamic name on a ship, you can't remove it, and it'll keep renaming the script no matter what you do unless you kill the AL plugin.
i made a quick fix for this by just adding some lines to recognise *RN instead of *DN at the start of the string, this nulls the ship 'RSWe.DN' property and appears to work.
added the below to plugin.loky.rswe.tool:36 as an elseif to the if $prefix == '*DN' condition
Code: Select all
* delete dynamic values
else if $prefix == '*RN'
$currentship->set local variable: name='RSWe.DN' value=null
$suffix.length = $length - 3
$namestring = get substring of $namestring offset=3 length=$suffix.length
after this is done you can name it manually or with rswe again and the AL will leave it alone
Edit2: I'm just going to include some things that I would really like to see. I hope it's possible
1. *PN - Pilot Name
2. Name by specific class when doing universe/sector-wide rename (TS/TL/TP, etc) - I don't want my TSes named the same as my TPs
3. Issuing the 'rename' command does not interrupt the order of the ship giving the command
4. Some sort of menu that lets you set up saved name schemes, so I can just do *S1 for example and it will recall the saved scheme
5. Saved increments based on the number of ships with the same increment. Example: *N1 would count up all the ships with the *N1 parameter, add 1 to it, then assign it to my ship. Usage: If I get a new transport, I could just hit *N1 instead of having to rename all of them to use *NN. This would be really neat so I could have my TSes share numbers with my M6s, for example (separate numbering schemes if I wanted). You'd have to "unallocate" all ships currently applying this scheme first so that it wouldn't increment forever
6. Fix "unknown ship" announcements
7. Autonaming schemes - primarily for satellites
I really like the options that are already here, too.
1. *PN - Pilot Name
2. Name by specific class when doing universe/sector-wide rename (TS/TL/TP, etc) - I don't want my TSes named the same as my TPs
3. Issuing the 'rename' command does not interrupt the order of the ship giving the command
4. Some sort of menu that lets you set up saved name schemes, so I can just do *S1 for example and it will recall the saved scheme
5. Saved increments based on the number of ships with the same increment. Example: *N1 would count up all the ships with the *N1 parameter, add 1 to it, then assign it to my ship. Usage: If I get a new transport, I could just hit *N1 instead of having to rename all of them to use *NN. This would be really neat so I could have my TSes share numbers with my M6s, for example (separate numbering schemes if I wanted). You'd have to "unallocate" all ships currently applying this scheme first so that it wouldn't increment forever
6. Fix "unknown ship" announcements
7. Autonaming schemes - primarily for satellites
I really like the options that are already here, too.
-
- Posts: 6
- Joined: Thu, 18. Nov 10, 08:01
Sorry Guys wasnt here for a long time.
Now I came back for X3TC 3.0 and still Loky didnt update his Scripts since ... well long ago .
So i looked into the Scripts and fixed some Bugs you can read them in the new Readme:
Readme: Link
Mirror: Link
With X3TC patch 3.1 the color bug was fixed so i recommend to upgrade to 3.1 from
http://www.egosoft.com/download/x3tc/patches_en.php
or your favourite site
BTW: Guys from Egosoft BIG thanks
--new version 1.7g 09/22/2011--
Folder : Link
Mirror : Link
if this link doesnt work here are the files extra
Spk: Link
Mirror: Link
7z: Link
Mirror: Link
and if you cant do anything with these files
Zip: Link
Mirror: Link
Have fun with renaming your fleet
Greetings Medevel
Now I came back for X3TC 3.0 and still Loky didnt update his Scripts since ... well long ago .
So i looked into the Scripts and fixed some Bugs you can read them in the new Readme:
Readme: Link
Mirror: Link
With X3TC patch 3.1 the color bug was fixed so i recommend to upgrade to 3.1 from
http://www.egosoft.com/download/x3tc/patches_en.php
or your favourite site
BTW: Guys from Egosoft BIG thanks
--new version 1.7g 09/22/2011--
Folder : Link
Mirror : Link
if this link doesnt work here are the files extra
Spk: Link
Mirror: Link
7z: Link
Mirror: Link
and if you cant do anything with these files
Zip: Link
Mirror: Link
Have fun with renaming your fleet
Greetings Medevel
Last edited by Medevel on Thu, 22. Sep 11, 15:46, edited 10 times in total.
-
- Posts: 6
- Joined: Thu, 18. Nov 10, 08:01
I've made a temporary fix for the blank messages bug.
Soon I'll have a better fix made into a library that converts the colors and sends colored messages/questions.
Soon I'll have a better fix made into a library that converts the colors and sends colored messages/questions.
@tamtam77 Thanks for pointing me into this error i fixed it directly today
above you can DL the version 1.7b
@h2o.AvA Thanks for that info i will look it up when i am back from my cristmas holidays. I am looking forward that your fix can solve the blank message bug from the original scripts.
Have nice Cristmas and a happy new year See You 2011
Medevel
above you can DL the version 1.7b
@h2o.AvA Thanks for that info i will look it up when i am back from my cristmas holidays. I am looking forward that your fix can solve the blank message bug from the original scripts.
Have nice Cristmas and a happy new year See You 2011
Medevel
I wont say its dead ,just unsupported and possible buggy
Yes it seems Loky isnt supporting the script atm, but that doesnt mean its dead.
The version i provided is working fine for me and since Egosoft fixed the color bug in patch X3TC 3.1, i experienced no bugs with colors anymore.
There is still some "null"-bugs but i am looking into it atm.
Like i said its working for me and i provided a download with my fixed version here or scroll some posts up .
Greetings Medevel
Yes it seems Loky isnt supporting the script atm, but that doesnt mean its dead.
The version i provided is working fine for me and since Egosoft fixed the color bug in patch X3TC 3.1, i experienced no bugs with colors anymore.
There is still some "null"-bugs but i am looking into it atm.
Like i said its working for me and i provided a download with my fixed version here or scroll some posts up .
Greetings Medevel