[SCRIPT: Upd 09/02] Rename ships with Expression 1.7 (RSwE) New links

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

Post Reply
kelmen
Posts: 308
Joined: Tue, 9. Dec 08, 16:11

Post by kelmen » Tue, 8. Sep 09, 09:27

Pirate Nova Raider and Nova Raider are having slight different spec, but their *TN are same

is there a way to give their proper class name?

is there a way to setup the default naming? like i just wanna setup *CL *TN *NN

kelmen
Posts: 308
Joined: Tue, 9. Dec 08, 16:11

Re: [SCRIPT: Upd 09/02] Rename ships with Expression 1.7 (RSwE) New links

Post by kelmen » Fri, 11. Sep 09, 20:49

Loky77 wrote:
Loky77 wrote: Colors:

Currently, due to some hard coded behavior in X3TC, colors are working
differently between incoming messages/log book, and the rest of X3TC UI. You can still use the color tags provided, but messages will be empty.
This is an unfortunate known issue :cry: .
does anyone know any resolution for this problem? now I have many blank notifications, its really hard to keep track where/who its from.

and i decided to stop using this until the blank message can be resolved.

Alkeena
Posts: 414
Joined: Tue, 15. May 07, 20:43

Post by Alkeena » Fri, 11. Sep 09, 20:57

No known resolution.

You could always just stop using colors in your ship names. This script is quite useful even without that feature.

kelmen
Posts: 308
Joined: Tue, 9. Dec 08, 16:11

Post by kelmen » Fri, 11. Sep 09, 22:34

Alkeena wrote:No known resolution.

You could always just stop using colors in your ship names. This script is quite useful even without that feature.
but i never used any color code in the naming
*CL *TN *NN
are what i typically used

kelmen
Posts: 308
Joined: Tue, 9. Dec 08, 16:11

Post by kelmen » Sat, 12. Sep 09, 01:14

nvm, i found out the cause

there's another mod (MARS) that will auto append cargo-space to ship name with color

and with this, it cause the blank message

chmv
Posts: 2
Joined: Fri, 6. Feb 09, 22:25

Post by chmv » Fri, 23. Oct 09, 20:45

Thanks for script!

Small bug, please fix it.
$Wing is undefined in *ZN case.

plugin.loky.rswe.tool.xml:

Code: Select all

230   ||else if $part == '*ZN'
231   |||$Pers.Ship = null
232   |||$dummy = $ships.cntr
233   |||
234   * *= personal ship
235   |||if $currentship -> get amount of ware Spacefly Collector in cargo bay
236   ||||skip if $currentship -> is of class TS
237   |||||$Pers.Ship = 1
238   |||end
239   |||if $Pers.Ship
240   ||||$addvar = $Wing + '   '
241   |||else
242   ||||if $ships.cntr < 10
243   |||||$addstring = $Wing + '00' + $dummy
244   ||||else if $ships.cntr < 100
245   |||||$addstring = $Wing + '0' + $dummy
246   ||||else
247   *$addvar = $Wing + $dummy
248   |||||$temp = sprintf: fmt=' %s', $dummy, null, null, null, null
249   |||||$addstring = $Wing + $temp
250   ||||end
251   |||end
and ' %s' must be '%s' (without space) because '00' and '0' without space...

kelmen
Posts: 308
Joined: Tue, 9. Dec 08, 16:11

Post by kelmen » Sat, 24. Oct 09, 12:01

is there a code to get the total-num of that particular ship class owned by you?

say, I got 5 (#1) Cutlass, when i buy a new 1, its 6th (#1) . so i want to use this #1 as code to be append to the ship name

gsmhiker
Posts: 2
Joined: Tue, 3. Nov 09, 03:44

Post by gsmhiker » Tue, 3. Nov 09, 03:59

Loky77 wrote:1. Put *KG*FP *FI*KX in the clipboard 1
2. Put *KM*TS*KX in the clipboard 2
3. You should see *KG*FP *FN*KX on the clipboard 1 line and *KM*TS*KX on the clipboard 2 line
4. Rename a formation using *Y1 *Y2
5. The formation should be renamed with the type of ship in magenta, then its formation name + its position in this formation in green.
I am having the same issue as dcarver. For example, I set clipboard 1 to an expression, let's say *TN. When I rename a ship with the string "My *Y1", I expect the ship to be renamed "My Rapier" or something similar. Instead the ship is renamed to "My *TN". It seems that expressions in clipboard items are not evaluated, but are being literally applied to the name.

If I follow the steps above, my ships are named "*KG*FP *FN*KX *KM*TS*KX"

Lazerath
Posts: 847
Joined: Tue, 22. Mar 05, 07:31
x4

Post by Lazerath » Mon, 9. Nov 09, 03:28

Bug Report

When using *ZN (Description Below for reference) it adds the word "null" before the numbering. Example below using M4 Solano

*CL - GW-*ZN Escort - *TS

Results as:

M4 - GW-null001 Escort - Solano

I tried using just the *ZN and it still ended up putting "null" infront of the numbering. :(

*ZN : Incrementing number with leading zero

PS: I absolutely love this script. I only wish I saw it sooner then today :(
COMPUTER SPECS
[Mobo] SABERTOOTH 990FX R2.0
[CPU] AMD FX-9370 8 Cores 4.4 - 4.7GHZ 16MB DDR3-1866
[Cooling] Corsair Hydro Series H80I CPU Cooler System
[Video] Evga 970 GTX SC 3.5Gb Ram ==> [Ram] G-Skills Ripjaws X 16GB
[Harddrive] (2) x Samsung 850 Evo 250GB SSD
[Harddrive] Samsung 840 Series 120GB SSD ==> [Harddrive] WD BLACK 1TB 64MB 7200RPM
[Disc Player] LG 14X BLU-RAY BURNER ==> [Case] Thermaltake A71 Chaser [Windows 7 Pro]

corbosman
Posts: 47
Joined: Wed, 30. Dec 09, 01:32

Post by corbosman » Thu, 7. Jan 10, 22:11

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)

kissmejulie
Posts: 6
Joined: Wed, 6. Jan 10, 19:12

Post by kissmejulie » Thu, 14. Jan 10, 16:42

Is it possible to add wing color to the name scheme?

kraznyi_oktjabr
Posts: 2
Joined: Wed, 26. May 04, 09:58
x2

Post by kraznyi_oktjabr » Mon, 10. May 10, 22:39

Hi!

Is there version available for X3R? I tried from X3R - scripts and modding but unfortunately links were not functioning. They were for version 1.4 don't know if that is latest.

Thanks in advance!

Tim

bolgimo
Posts: 20
Joined: Thu, 3. Jun 10, 08:21

Post by bolgimo » Thu, 3. Jun 10, 08:31

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

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
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:

Code: Select all

   else if $part == '*IS' 
      $temp = $currentship->get ID code
      $addvar = get substring of $temp offset=6 length=2
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".

bolgimo
Posts: 20
Joined: Thu, 3. Jun 10, 08:21

Post by bolgimo » Thu, 3. Jun 10, 20:00

corbosman 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)
from what i understand so far, dynamic names appears to work like this
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
use it the same way you would to make a name through rswe ie. *RN*CL *TS *NN, it'll remove the property from the ship and carry on with the rest of the script to name it

after this is done you can name it manually or with rswe again and the AL will leave it alone

nairax
Posts: 5
Joined: Fri, 23. Jul 10, 08:47

Post by nairax » Sat, 24. Jul 10, 02:29

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.

Post Reply

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