[Script] SNM - Ship/Station Names Managment V4

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

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

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

[Script] SNM - Ship/Station Names Managment V4

Post by UniTrader »

Function:
The SNM is an extension to make the management of ships and stations easier by coloured names.

What it does
All player owned ships and stations where checked of token in there names. These token where replaced by the accordant announced text.

The routine works periodically every minute (could be changed in the t-file ;) page id 8648, text id 1 is the time between two runs in seconds for all scripters here ;))

If anybody wants the routine can be shut down in the AL-Plugin-menu. All colours in station-names and ship-names will be removed (if there are no changes at the names by reactivation, all colours would be set like before)


To dye a word or a text you only have to write a token at the beginning:

/gry for grey
/blu for blue
/cya for Cyan
/grn for green
/mag for magenta
/red for red
/whi for white
/yel for yellow
/bck for black
/nor to come back to normal text colour.


With the following token mutated vowels and special signs could be created

Mutated vowels:
/:a for ä
/:A for Ä
/:o for ö
/:O for Ö
/:u for ü
/:U for Ü
/sz for ß

Special signs:
/sbo for [
/sbc for ]
/cbo for {
/cbc for }
/til for ~
/vl for |
/ex2 for ²
/ex3 for ³
/at for @
/cir for °
/reg for ®
/+- for ±
/par for §
/cs for ø

Greek letters:
/alpha for α
/beta for β
/gamma for γ
/delta for δ
/epsilon for ε
/zeta for ζ
/eta for η
/theta for θ
/lota for ι
/kappa for κ
/lambda for λ
/mu for μ
/nu for ν
/xi for ξ
/omicron for ο
/pi for π
/rho for ρ
/sigma_e for ς
/sigma for σ
/tau for τ
/upsilon for υ
/phi for φ
/chi for χ
/psi for ψ
/omega for ω

French letters:
/*a for à
/^a for â
/'a for á
/*e for è
/^e for ê
/'e for é
/*o for ò
/^o for ô
/'o for ó
/*u for ù
/^u for û
/'u for ú
/,c for ç
/,C for Ç
/oe for œ
/:i for ï
/:e for ë

Moreover there are flexible strings, which were automatically updated:

/hbn adopt the name of homebase (only ships with homebase; priority: normal homebase > cag-homebase > cls-hombase)
/hbs adopt the sector of homebase (only ships with homebase; prioritys: see above)
/lvl adopt the current level of the pilot (priority: trade command software Mk3 > cag/cls)
/typ adopt the type of ship/station

example:

/blu/alpha /red/hbn /yelMamba /redAttacker /norexample (homebase is “Headquarter”)
α Headquarter Mamba Attacker example


There is one more feature added: Decimal numbers can be shown in followed display form:
/numI<Zahl> for roman number (major implemented sign is M, is equivalent to 1000)
/numa<Zahl> for small letters (as yet only till 26 assisted)
/numA<Zahl> for big letters (as yet only till 26 assisted)
/numG<Zahl> for greek letters (as yet only till 24 assisted)
/num#<base>#<numberl> for numbers in other systems, for example binary (base 2), Octal (base 8), Hex (base 16) (assisted till base of 36 and <number> < 2.000.000.000 / <base>)

Notes:
- It isn’t advisable to use only red names (and at stations blue too) . So you can’t see if there were attacked (or needs resources).

- Colour-tags are two invisible signs in the name-string, at this position the cursor act up while renaming, so don’t be amazed.


Adding own shortcuts:
100 entries has been createt (2x50; 50 shortcuts and 50x announced text), which you can use you wishes like. In your shortcuts you can use all above shortcuts for automatically translation.

For own shortcuts edit the file t/448649.xml.
The announced text: replace "UserDefinied#<Slotnumber>" with your own text
The corresponding shortcut: relace "/UD#<slotnumber>" with your shortcut
Don’t replace "<t id="###">" and "</t>", ore it wouldn’t work.

DL-Link:
http://www.letsshareit.net/files/30/SNM4.zip

Installation:
Extract the archive into your X³-folder (t-files into the t-folder and script-files into the scripts-folder) The SE is necessary (activation: rename yourself into “Thereshallbewings”). (Lucike posted possibilities to install scripts without activated SE)


Updating former versions:

Copy the content of "update.old.version" into the script-folder. Load all saves where the old version is in use and afterwards save them. Now delete the files from “update.old.version” from your scripts-folder.
Now are all parts assumed by the new version. (NOTE: I have not officially released any previous Version of this script in english..)

Also there are two uncommented functions. Explanations at request.


PS I am not avible until 31th Deceber 2007 because i am in vaction, so if you have problems please ask other users in this Topic or wait until i am back...
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)
User avatar
ninjitsumonk
Posts: 1874
Joined: Thu, 1. Mar 07, 09:21
x3

Post by ninjitsumonk »

nice, looks good, could even live upto(if not be better than) the standards of RSwE(my current favourite).
I'll give it a go later, see what its like :D.
Archeo Avis wrote:
if you take out phrasing and root notes and just look at the notes, they are the same
So what you're saying is, if you ignore everything that's different and focus only on the one thing that's the same, they're same.

Good God.
Guardian004
Posts: 107
Joined: Fri, 2. Nov 07, 02:03

Post by Guardian004 »

YAY!!!!
Guardian004
Posts: 107
Joined: Fri, 2. Nov 07, 02:03

Post by Guardian004 »

BUMP

for popularity :D
A5PECT
Posts: 6191
Joined: Sun, 3. Sep 06, 02:31
x4

Post by A5PECT »

Sounds great, I'll definitely be trying this out. However, I don't understand some your instructions.
Admitting you have a problem is the first step in figuring out how to make it worse.
Guardian004
Posts: 107
Joined: Fri, 2. Nov 07, 02:03

Post by Guardian004 »

KloHunt3r wrote:Sounds great, I'll definitely be trying this out. However, I don't understand some your instructions.

Well here is how I understand It and how it works well.

Ok lets say you want to name anything you want. "xexon loser"

If you want it to be BLUE, then you put "/bluxexon loser" xexon loser
When you put the /blu command in, everything after that command will be blue.
If you want more colors in the "xexon loser" name, then you can put...
lets say...red
"/bluxexon /redloser"

Which will turn out to be xexon loser

Now the /typ will put the current ships name. So if you have a XEXON N, and you Named your ship "XEXON LOSER" If you put the /typXEXON LOSER, it will display XEXON LOSER N as far as I'm concerned.

Hope this helps :P


happy gaming
fireexit
Posts: 12
Joined: Thu, 22. Dec 05, 06:14
x3

Post by fireexit »

Thanks For Making
This
UNITRADER

:P
MJALowe
Posts: 461
Joined: Fri, 5. Jan 07, 06:27
x3

Post by MJALowe »

since i don't personally use this script could someone who does test this with my font replacement and see if the special characters show up close to correctly (they would have been scaled about 60% on the width makeing circles into ovals and {[( into | )

edit: im asking specifically about the special characters cause there aren't much if any used in the vanilla game, and thats the compatibility i was worried about for the font replacement (though it would be nice if it works with special characters)
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

*short visit from holiday*

i have tested all listed special characters myself, they are all displayed correctly InGame without any problems (i wanted to add some more but they weren't displayed..), but they may look a bit diffrent from here because InGame is another font..
EDIT2: ok, now i understand what you mean.. i wasn in a hurry when i read your post.. i will test it when i am back at home..



EDIT: small correction:
Guardian004 wrote:Now the /typ will put the current ships name. So if you have a XEXON N, and you Named your ship "XEXON LOSER" If you put the /typXEXON LOSER, it will display XEXON LOSER N as far as I'm concerned.
/typXENON LOSER
will display
NXENON LOSER

to get the example text
XENON LOSER N
you have to write
XENON LOSER /typ
;)
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)
Guardian004
Posts: 107
Joined: Fri, 2. Nov 07, 02:03

Post by Guardian004 »

UniTrader wrote:*short visit from holiday*

i have tested all listed special characters myself, they are all displayed correctly InGame without any problems (i wanted to add some more but they weren't displayed..), but they may look a bit diffrent from here because InGame is another font..
EDIT2: ok, now i understand what you mean.. i wasn in a hurry when i read your post.. i will test it when i am back at home..



EDIT: small correction:
Guardian004 wrote:Now the /typ will put the current ships name. So if you have a XEXON N, and you Named your ship "XEXON LOSER" If you put the /typXEXON LOSER, it will display XEXON LOSER N as far as I'm concerned.
/typXENON LOSER
will display
NXENON LOSER

to get the example text
XENON LOSER N
you have to write
XENON LOSER /typ
;)
:lol: I had it backwards.....zaa....I was close enough.
A5PECT
Posts: 6191
Joined: Sun, 3. Sep 06, 02:31
x4

Post by A5PECT »

Alright, I've figured it out, and it works fantastically :D.
Admitting you have a problem is the first step in figuring out how to make it worse.
User avatar
Sandalpocalypse
Posts: 4447
Joined: Tue, 2. Dec 03, 22:28
x4

Post by Sandalpocalypse »

using /lvl on my CAGs gave the home base name instead.

ie

old ship:

Tofurkey Trader

New name:

Tofurkey /lvl

After script:

Tofurkey Tofurkey Prime

tried three times, same result

Tofurkey /hbn gives same result

otherwise, pretty nifty
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

i cannot find the error by looking in the Script... perhaps it is a mistake in the variable managment of the CAG, here are the script lines for the substitution of the pilot level (NOTE: CAG and goods delivery are using the same level system afaik):

071 1.47 $substitute = [THIS] -> get local variable: name='experience'
072 1.01 skip if $substitute
073 ║║1.47 $substitute = [THIS] -> get local variable: name='goods.dev.pilotlevel'
074 1.01 $substitute = $substitute + ''
075
076 1.35 $pattern = read text: page=$pageID id=13
077 1.4.05 $string = substitute in string $string: pattern $pattern with $substitute
078 1.3.03 $name.arr[4] = $substitute

and here the t-file-entry:
<page id="8648" title="UniTraders Page" descr="This Page contains all Text for UniTraders Scripts">
<t id="000">3</t>
<t id="001">60</t>
<t id="002">SNM - Ship/Station Names Managment</t>
<t id="010">/typ</t>
<t id="011">/hbn</t>
<t id="012">/hbs</t>
<t id="013">/lvl</t>
<t id="014">/fnum</t>
...

PS i have changed the X2Script a bit and numbered all SE-Commands :D i will release this in the englsh forums soon...
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)
Guardian004
Posts: 107
Joined: Fri, 2. Nov 07, 02:03

Post by Guardian004 »

KloHunt3r wrote:Alright, I've figured it out, and it works fantastically :D.
I love this script because it gives very good organization!
My military ships are marked in green, traders in purple, flagships in white, wingman in yellow, sector patrols in blue, my response fleet in black, and finally my ship in gray :D

UniTrader, I was going to make a script on this before you PMed me. Question. Do you plan to add more on? A truely nice addon, if possible, to add keywords like "Military Transport", "sentinel", "raider", etc. Having the computer actually say them. :roll:

I think the script I was going to download had that...? Not sure...
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

i have planned something like this bu i have not tested if it is possible.. when it is possible i will post some strings here which stay for a spoken AND written text and can be used in the custom Slots of this script (t-file 448649.xml; i will not implement it in the script itself because there is too many spoken text in the game to implement it completely..)
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)
User avatar
sferum
Posts: 78
Joined: Tue, 1. Jan 08, 13:50

Post by sferum »

Hi!! Thx for ur script!!

One question: you wrote at the end "Also there are two uncommented functions. Explanations at request."

Could you explain them for us all!! ^.^

Thx and go on with ur scripts! Good luck!
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

OK, but only because it is page 2 ^^
I haven't documented this functions because to understand them you need some basic Knowledge in Scripting.. and i dont want to give eerybody a tutorial for this...

#1: Put in a specified Locale Variable (it will be refreshed in every turn of the Script):

/Loc#<length>#<Variable Name>

with this Code you can put in the coontent of every Locale Variable on the Ship. <length> is the length of the <Variable Name>, her an small example to put in the Level of a UniTrader:

/Loc#10#experience


#2: Put in a specified Text from the loaded t-files:

ReadText#<PageID>-<TextID>

a String in this format will be substituted with the text in Page id <PageID> and t id <TextID>.

to differ it from the normal ReadText ther is a # between the ReadText and the PageID

PS small hint: you can put in a locale Variable or /lvl instead of <TextID> to display something instead of a number ;) (or use the /fnum-function ;))
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)
Maximus84
Posts: 14
Joined: Wed, 11. Feb 04, 05:50
x3

Post by Maximus84 »

Hi Unitrader ^^

I got a problem with the script. It's installed in the right place, SE activated and all of that stuff... but the Script does not work for me.

Some Details about my game:

Mods running
- XTM 0.73
- Ashleys XXL Fabs + Extended Hub Thingy
- TXU_HUD_V2.1.7

Scripts running
- 120K XTM Draw Distance (for better sight in the fog) (from Avicenna)
- Arena (from LV)
- Ashleys Factories & Extended Complex Hubs XTM (from Saint-Ashley and Armegeddon)
- Asteroid Creator (for.. uhm... testing some stuff :roll: ) (from Fud)
- Claim Unknown Sector (from Lazerath)
- Jumpdrive Delivery (from LV)
- No Trash BBS (from Klyith)
- Overtune BBS (from Cycrow)
- Race Respond Fleets Final (from LV)
- Salvage Insurance Contract (from Cycrow)
- T.U.B.S. Teladi Universal Banking System (from Black_BPG)
- Terracorp Fleet Package (from Myros,dwgh,jensemann,siath70,eladan)
- Xtended Mod Scripts (from the Xtended Team)

Maybe you see a conflict with anything of that running? As I installed the Files of your Script there was no window to overwrite anything. By the way... I have the english version of X3 with the patch 2,5 (if you send me a PM or anything, you can write it in german, cause I am german too).

Maybe there is a conflict with the Race respond Fleet Script? There are colored ship names, too.

I hope you can help me... cause I want this cool Roman Numbers sooo baaad ^^

Edit:
Well, I don't know why... but it works now o.O It's awesome ^^
User avatar
Brinnie
Posts: 908
Joined: Mon, 5. Jun 06, 08:26
x3tc

Post by Brinnie »

Hello again.

Just installed this last night.

Excellent, it's got so many options it'll keep me busy for a while.

The shortcuts are going to make things really interesting.



Have you made any more scripts/mods for X3, beside your HUD MOD?
Tritous
Posts: 899
Joined: Sat, 15. Jan 05, 17:20
x3tc

Post by Tritous »

for the record, /lvl seems to put out /hbn (they have no hb) on my Uni traders too
Give a man a fire, he'll stay warm for a day
Set a man on fire, he'll stay warm for the rest of his life ;)

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