[SCRIPT] Rename Ships with Expressions (v1.4 Feb 1 07)

The place to discuss scripting and game modifications for X³: Reunion.

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

Puruco
Posts: 527
Joined: Tue, 6. Dec 05, 00:09
x3

Post by Puruco » Fri, 2. Feb 07, 15:49

oh I forgot, for install the new version just desinstall the old one and install the new one with cycrow installer or need to do something else?

Nho
Posts: 180
Joined: Fri, 24. Feb 06, 18:19
x3

Post by Nho » Fri, 2. Feb 07, 18:02

Great job Klyith! I do have a request tho, if I may... Would it be possible to add a command for CAPITAL letters? I use them a lot, it saves time when I'm looking for one specific ship in the R menu :p

User avatar
Klyith
Posts: 594
Joined: Fri, 6. Jan 06, 01:38
x3

Post by Klyith » Sat, 3. Feb 07, 02:56

Puruco wrote:oh I forgot, for install the new version just desinstall the old one and install the new one with cycrow installer or need to do something else?
Yep, though I think you don't even need to deinstall the old one, it should just update over the top. I don't actually use the script manager myself though... Just package up my scripts for it. I should figure out the auto-update stuff so you guys can be kept up to date without having to keep track manually.
Nho wrote:Great job Klyith! I do have a request tho, if I may... Would it be possible to add a command for CAPITAL letters? I use them a lot, it saves time when I'm looking for one specific ship in the R menu
Yup, I'm already on it. ;) All caps & all lowercase will be among the more than 10 new expressions in v1.5 :o

Brand-X
Posts: 232
Joined: Thu, 15. Sep 05, 23:48
x3

Post by Brand-X » Sat, 3. Feb 07, 04:42

Hey, Klyith,

I dl your latest version with the color tag stripping and I got that figured out. It's looking good, having my stations change text color like I wanted. :) Thanks.

:)

User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz » Sat, 3. Feb 07, 11:36

Klyith wrote: I should figure out the auto-update stuff so you guys can be kept up to date without having to keep track manually.
Auto updating scripts is only needed in one case:
if the script is currently running on an actor (or globally), like UT trader or a turret command, it will not be loaded from script file but kept in the savegame.

Scripts that are only executed directly by the player are loaded from the file every time you load a game.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

Whooosh
Posts: 7
Joined: Sun, 14. Jan 07, 14:53
x3tc

Post by Whooosh » Mon, 5. Feb 07, 15:41

Whoa, I wouldn't need upto 399 in Roman Numerals but thanks anyway Klyith. The release comes at a good time as I just got the new DDRS mod and plan to start a new game.

Out of curiousity though, would the *TA and *TN commands work on new ships? I never got far enough in the mods or Bala Gi to try it

User avatar
Klyith
Posts: 594
Joined: Fri, 6. Jan 06, 01:38
x3

Post by Klyith » Mon, 5. Feb 07, 18:57

Gazz wrote:Auto updating scripts is only needed in one case:
Nah mate, I'm talking about the auto update in Cycrow's script manager. It will look on the author's website for new versions of a script package, and do the updates for the user. If, that is, the person putting the package together can figure out how to set it up.

Whooosh wrote:Whoa, I wouldn't need upto 399 in Roman Numerals but thanks anyway Klyith. The release comes at a good time as I just got the new DDRS mod and plan to start a new game.
I figured 399 was plenty myself. :) FYI, new game is totally irrelevant to a script like this. When I get the next update done you can just overwrite the files, no problem. No need for a new game or anything, if you want to update.
Out of curiousity though, would the *TA and *TN commands work on new ships? I never got far enough in the mods or Bala Gi to try it
Yeah, they will work just fine. (It uses X3's own reporting of the ship name, so as long at it displays properly in the other areas of the game it has no troubles.)

Greg_G
Posts: 110
Joined: Tue, 26. Apr 05, 19:15
xr

Post by Greg_G » Mon, 5. Feb 07, 19:04

Klyith wrote:
Out of curiousity though, would the *TA and *TN commands work on new ships? I never got far enough in the mods or Bala Gi to try it
Yeah, they will work just fine. (It uses X3's own reporting of the ship name, so as long at it displays properly in the other areas of the game it has no troubles.)
It even handles my homemade ships just fine, like my Mammoth and Centaur Vanguards and Albatross Hauler. :D

User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz » Mon, 19. Feb 07, 01:04

So there I was searching through my ships list, looking if there would be some ST around that I had forgotten to upgrade to UT.
And I thought... why am *I* doing this?

Script powerz activate!

Code: Select all

068      $temp = $currentship -> is script 'plugin.autotrade.galaxy' on stack of task=0
069      skip if not $temp
070       $addvar = 'UT'
071      $temp = $currentship -> is script 'plugin.autotrade.sector' on stack of task=0
072      if $temp
073       $temp = $currentship -> get local variable: name='experience'
074       $addvar = 'ST ' + $temp
075      end
For UT I dont care but ST get labeled with their XP level. =)
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

User avatar
Kazuma
Posts: 720
Joined: Sat, 28. Jan 06, 17:28
x4

Post by Kazuma » Wed, 21. Feb 07, 05:06

For some reason (I can only assume conflicting scripts) I cant seem to get the colors to work... does anyone know of any scripts that conflict with this? (I am thinking bounty hunter, as it does some stuff with color and whatnot), just would like a second opinion... and/or nuemans gui... everything else works like a champ (excellent btw) just the color string does nothing for me.

User avatar
Klyith
Posts: 594
Joined: Fri, 6. Jan 06, 01:38
x3

Post by Klyith » Wed, 21. Feb 07, 05:33

Kazuma wrote:For some reason (I can only assume conflicting scripts) I cant seem to get the colors to work... does anyone know of any scripts that conflict with this? (I am thinking bounty hunter, as it does some stuff with color and whatnot), just would like a second opinion... and/or nuemans gui... everything else works like a champ (excellent btw) just the color string does nothing for me.
All the other text is fine? That is, you're not getting any readtext errors anywhere?

I don't think it could be conflicting scripts unless the other script was also trying to rename your ships... And even then, you should at least see the changed name for a minute before the other script changes it back, unless the other script is renaming way too often.

Can you post the rswe string you were trying to use?

User avatar
Kazuma
Posts: 720
Joined: Sat, 28. Jan 06, 17:28
x4

Post by Kazuma » Wed, 21. Feb 07, 13:31

Sure K,

Remote select 1 of 2 in space M6 ships;

commands/general/RsWe Sector

Sector

M6

*CL *TN (this works, I get M6 whatever, and M6 whatever)

if I expand this to lets say;

*CL *TN *KR (does the above, just no color)

Mayhap I missed something, dunno; thought I would ask the expert on it.

As far as errors, I dont get any; and or havnt recieved any at all; the ships are also keeping there names assigned via *CL *TN and not reverting back... just no color differentiation... ie. there still the standard grey/white generic'o type color.

The only style of scripts I can think of that I have in action are the group commands (which can do ships of a type and form a flight group, would have to look which script that is), maybe the early warning sats (that will rename sats)... other then that... I dont have anything 'hanging out there' that auto controls the naming of meh stuff. Thanks for the help!

-IH-
Posts: 20
Joined: Tue, 5. Dec 06, 21:27
x3

Post by -IH- » Wed, 21. Feb 07, 19:25

Nice script. I was working on something similar but with more features:
1) Put current ship task into name (using top script name). It would be VERY usefull to know what exactly task a ship perfroms (UT, sector trading, (multi)sector convoy, fleet support, etc.).
2) With regard to 1) a job is required to check ship tasks by timeout and change name if required.
3) Ship weapons/speed/shields info. This is very usefull when you are fighting in some sector with large fleet :) My idea was to divide all weapons into 3 groups: heavy (HEPT, PPC, FAA), medium (PAC, PSG) and light (IRE, PBE, MD). So name of fighter may looks like that: "M5 (Leader) 200 5 L5 - 3". This means: M5, belongs to "Leader', speed 200, shileds 5MJ, 5 ligth weapons, UID = 3. It is not so hard task to check M1, M2, M6 (since there are just several ships of these classes) but check 50+ fightesr for proper config... thats a nightmare for me.

If you impelement the all above I'll fo sure throw away my script and use your one :D

User avatar
Klyith
Posts: 594
Joined: Fri, 6. Jan 06, 01:38
x3

Post by Klyith » Wed, 21. Feb 07, 20:56

Kazuma wrote:*CL *TN *KR (does the above, just no color)
Aha! You're using it wrong, but I suppose that was my fault since I didn't fully explain how to use the colors anywhere. I will add it to the readme.

Colors are like html or bbcode tags: they only colorize the text after them. So when you tried *CL *TN *KR, the red was at the end of the text and didn't colorize anything. To make the whole name in red, you need to do "*KR*CL *TN", with the color expression at the beginning of the name.

Some examples:
*KR*CL *TN . . . . . M3 Nova Raider
*CL *KR*TN . . . . . M3 Nova Raider
*KR*CL *KX*TN . . M3 Nova Raider
*KR*CL *KB*TN . . M3 Nova Raider

Note also that the spaces between the color and the rest of the string. RSwE preserves all spaces, so if you put spaces around any *expression, they will show up in your final name. Most of the time it's easy to predict what will happen, but some of the expressions don't make any visible text in the final name.

User avatar
Klyith
Posts: 594
Joined: Fri, 6. Jan 06, 01:38
x3

Post by Klyith » Wed, 21. Feb 07, 21:22

-IH- wrote:1) Put current ship task into name (using top script name). It would be VERY usefull to know what exactly task a ship perfroms (UT, sector trading, (multi)sector convoy, fleet support, etc.).

2) With regard to 1) a job is required to check ship tasks by timeout and change name if required.
Both are coming in version 1.5. The ship job feature is coming along, but complicated by the fact that it doesn't just go by what script the ship is running. 1.5 will also have a new renaming function that runs in an additional ship command slot, and periodically renames the ship.

However, it's going to be a little while... Besides a ton of new expressions, I'm also doing a ton of refactoring on the code to improve performance. RSwE is currently a real hog of a script. It's not that big of a deal normally because it only runs one time at the player command. But if I add the periodic rename task, it needs to go faster.
I've also been very busy with RL recently, plus we got 20 inches of snow last week to make life difficult. What spare time I have isn't in big enough chunks to do any useful coding.
3) Ship weapons/speed/shields info.
Lovely idea, but I don't think I can do this. Shields & speed wouldn't be hard, but the weapons thing is just too context dependent. A much better thing would be a new script that makes a report for how your ships are outfitted, and highlights those that don't have full kit.

User avatar
Kazuma
Posts: 720
Joined: Sat, 28. Jan 06, 17:28
x4

Post by Kazuma » Thu, 22. Feb 07, 02:22

Aha! You're using it wrong, but I suppose that was my fault since I didn't fully explain how to use the colors anywhere. I will add it to the readme.
:D :D :D

Well that explains that! Thanks Klyith (again) for this most excellent work! (Why this thing isnt signed is beyond me). While toiling away at work I had thought to myself "im probably coloring the damn spaces or somesuch) <laf>

User avatar
Klyith
Posts: 594
Joined: Fri, 6. Jan 06, 01:38
x3

Post by Klyith » Thu, 22. Feb 07, 03:57

Kazuma wrote:(Why this thing isnt signed is beyond me).
I haven't submitted it for testing or signing. Been toying with the idea, but I don't know if another official bonus pack is going to come out. Plus, you need to have a script in more or less stable form before you submit it, and rswe has plenty of new features on the drawing board. :mrgreen:

Kilrathi Avenger
Posts: 275
Joined: Fri, 6. Feb 04, 20:16
x3tc

Post by Kilrathi Avenger » Tue, 27. Feb 07, 12:17

Don't toy with the idea :shock: This script is brilliant and should have been in the original game.

Send it in for signing Please. :lol:

KA

P.S. What new features were you thinking of :?:
"As I slide down the banister of life;
my job is just another splinter in the bum"

Bane_v2
Posts: 543
Joined: Tue, 30. Dec 03, 03:52
x3tc

Post by Bane_v2 » Fri, 9. Mar 07, 03:44

Klyith, this script is fantastic. :D :thumb_up:

The clipboards are a great feature and the ability to add color all but eliminates the hassle of finding particular ships on a lengthy property menu. Nice work!

gatemonkey II
Posts: 30
Joined: Thu, 1. Mar 07, 09:12
x3

Post by gatemonkey II » Sun, 11. Mar 07, 04:09

That's it - I'm going to activate the script editor just to use this script! just what I've been looking for...

One request, though - is it possible to add something mid-way between *TA and *TN? I generally have (eg) 'Nova-R' for ship variants... given the way you're doing this in *TA code, this would have to know all the possible variant names available (Raider, Vanguard, etc) so it would be a bit of a pain.

Also, is there any way for it to distinguish between standard and pirate variations of the same ship type? As far as I can tell, it would currently call (for example) pirate novas just plain 'Nova'. Perhaps a special *PR tag that adds in 'Pirate'?

Post Reply

Return to “X³: Reunion - Scripts and Modding”