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

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

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

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

Post by Puruco » Fri, 2. Feb 07, 16: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, 19:19
x3

Post by Nho » Fri, 2. Feb 07, 19: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: 575
Joined: Fri, 6. Jan 06, 02:38
x3

Post by Klyith » Sat, 3. Feb 07, 03: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, 05: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: 12430
Joined: Fri, 13. Jan 06, 17:39
x3tc

Post by Gazz » Sat, 3. Feb 07, 12: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, 15:53
x3tc

Post by Whooosh » Mon, 5. Feb 07, 16: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: 575
Joined: Fri, 6. Jan 06, 02:38
x3

Post by Klyith » Mon, 5. Feb 07, 19: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, 20: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: 12430
Joined: Fri, 13. Jan 06, 17:39
x3tc

Post by Gazz » Mon, 19. Feb 07, 02: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: 677
Joined: Sat, 28. Jan 06, 18:28
x4

Post by Kazuma » Wed, 21. Feb 07, 06: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: 575
Joined: Fri, 6. Jan 06, 02:38
x3

Post by Klyith » Wed, 21. Feb 07, 06: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: 677
Joined: Sat, 28. Jan 06, 18:28
x4

Post by Kazuma » Wed, 21. Feb 07, 14: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, 22:27
x3

Post by -IH- » Wed, 21. Feb 07, 20: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: 575
Joined: Fri, 6. Jan 06, 02:38
x3

Post by Klyith » Wed, 21. Feb 07, 21: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: 575
Joined: Fri, 6. Jan 06, 02:38
x3

Post by Klyith » Wed, 21. Feb 07, 22: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.

Post Reply

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