How to add color and formating to text

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

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

AalaarDB
Posts: 2279
Joined: Thu, 29. Jan 04, 09:19
x3tc

How to add color and formating to text

Post by AalaarDB » Tue, 21. Feb 06, 09:33

In conventient ready to copy and paste form.
Add colors by placing this in a text file:

Code: Select all

Yellow:
[b]TextHere[/b]
[yellow]TextHere[/yellow]
\033YTextHere\033X

Blue:
[blue][/blue]
\033B\033X

Red:
[red][/red]
\033R\033X

Green:
[green][/green]
\033G\033X

Cyan (light blue):
\033C\033X

Magenta (purple):
\033M\033X

Grey (gray):
\033A\033X

White (uh white):
\033W\033X

Black (MSCI only):
0TextHereX
Add formatting by placing this in a text file:

Code: Select all

New Line:
\n

Underline:
[u][/u]

Italics:
[i][/i]

Center: 
[center][/center] 

Title: 
[title][/title] 

Justify: 
[justify][/justify] 

Text:
[text][/text] 
[text cols='2'][/text]

Author (for messages):
[author][/author]

Button (for questions):
[select value="youGetThisAsInputToTellWhichButton"]Button label here, player sees this[/select]
Last edited by AalaarDB on Tue, 13. May 08, 21:33, edited 3 times in total.

A dJ
Posts: 168
Joined: Thu, 18. Dec 03, 17:34
x4

Post by A dJ » Tue, 21. Feb 06, 09:43

Code: Select all

Center: 
[center][/center]

Title:
[title][/title]

Justify:
[justify][/justify]

Text:
[text][/text]
[text cols='2'][/text]

AalaarDB
Posts: 2279
Joined: Thu, 29. Jan 04, 09:19
x3tc

Post by AalaarDB » Tue, 21. Feb 06, 09:47

In the [text cols=] part, do you need the single quotes ' ' ? I copied and pasted straight from your code into my code... and they're gone!

A dJ
Posts: 168
Joined: Thu, 18. Dec 03, 17:34
x4

Post by A dJ » Tue, 21. Feb 06, 09:48

I guess so, note that I edited my previous post twice :)

A dJ
Posts: 168
Joined: Thu, 18. Dec 03, 17:34
x4

Post by A dJ » Tue, 21. Feb 06, 18:38

Code: Select all

Text:
[text colwidth='xxx'][/text]    (xxx=number)
[text minlines='xxx'][/text]    (xxx=number)
[text cols='xxx' colwidth='xxx' minlines='xxx'][/text]    (xxx=numbers)

Button (for questions): 
[select][/select]   (i.e. "Cancel" or "End Transmission")

Other:
%s, %d, %sd
{xxx,yyy}   (xxx=textpage, yyy=t id)
$xxx$   (xxx=value)

These I found somewhere within xx0001.pck(cat04)
[Headline], [Intro], [Quote], [Report], [Byline], [Melodrama A], [Melodrama B], [Fear], [Joy]
(ADDED)(/ADDED)
@ANSA, @ANAN, @AND
[br/], [article/]
[ranking type='fight' title='$FIGHTRANK$'/]
[VK_xxx]   (xxx=keyname i.e. EJECT or JUMPDRIVE)
[IF xxx][ENDIF xxx]   (xxx=variable)

I've seen Cycrow use
::xxx::   (xxx=value)
I have no idea what some of these do.

Oh and it seems it's possible to have messages made up of HEX values entirely.

Code: Select all

BC BA D6 92 15 5B 3A $TargetStation$ 1F $TargetSector$ F8 FF B3 $TimeString$ D2 D6 BA $Credits$ CC CF FF 

[select value='go']01[/select] 
Edit: Added one + changed post a bit (23-02-06)
Last edited by A dJ on Thu, 23. Feb 06, 18:25, edited 2 times in total.

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 21061
Joined: Mon, 15. Nov 04, 00:26
x4

Post by Cycrow » Tue, 21. Feb 06, 18:47

the ::xxx:: format that i use is actaully not standard for the game, i use a script to parse these tags to fill in the correct data ;)

the other stuff line [Headline] [Intro] $xxx$ etc, are used to format BBS articles and you have to define them urself elsewhere in the t file

User avatar
s9ilent
Posts: 2011
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent » Mon, 16. Apr 07, 06:55

Is there a way to insert the a new line whislt in the script editor (ie \n)
It adds the actual charachters \n when you type it in

ChemODun
Posts: 320
Joined: Mon, 12. Feb 07, 22:58
x3tc

Post by ChemODun » Mon, 16. Apr 07, 09:26

s9ilent wrote:Is there a way to insert the a new line whislt in the script editor (ie \n)
It adds the actual charachters \n when you type it in
It possible do only via text files, not ScE
Multiply entropy by absolute zero

Ñâîáîäà ñðåäè çâåçä / Freedom in space

User avatar
max274bm
Posts: 74
Joined: Mon, 2. Apr 07, 02:26

Post by max274bm » Mon, 16. Apr 07, 16:03

Back in X2 there was a script that allowed you to change the text colour of player owned ships and stations. I used this to quickly identify my various ship classes i.e. my fighting ships (blue) from my trading ships (yellow).
Can this info here be used for this app?
If it can how do you do it please :gruebel:
I'm no modder and although I know what a text file is, where would you put the above script to be able to make this work?
Thanks for any advice

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

Post by UniTrader » Mon, 16. Apr 07, 16:34

the above information is useful for the Scripters, but not for the User ;)

I know two Scrits which can make colored names, the first is mine, but is only avible with a german readme (im too lazy to translate it :roll:) and the other one is by Klyith, look here ;)
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
max274bm
Posts: 74
Joined: Mon, 2. Apr 07, 02:26

Post by max274bm » Mon, 16. Apr 07, 23:59

Thanks UniTrader your a gem :)

Thraxwhirl
Posts: 681
Joined: Fri, 17. Feb 06, 21:54
x3ap

Post by Thraxwhirl » Mon, 24. Sep 07, 14:43

Is it possible to use colour in Script Editor commands?

For example, in General Object Commands, you might want to:

001 ship->change name to "The Enterprise"(or whatever)...

...but with it in yellow?

B-O'F
Posts: 719
Joined: Sat, 21. Feb 04, 03:15
x3tc

Post by B-O'F » Mon, 24. Sep 07, 15:57

Hi Thraxwhirl,

Yes you can do this in the editor.
The easiest method of using the control strings (such as \033Y and \033X) is to have them in the t-file, and then use them as required in your script.

$yellow = = sprintf: pageid=<Var/Number> textid=<Var/Number>,<Value>,<Value>,<Value>,<Value>,<Value>

Where pageid points to your t-file and textid points to the text \033Y

Same sort of thing for any other colours, and one to point to the colour ending - \033X

Then you can have -

$name = $yellow + 'The Enterprise' + $endcolour

which is : \033YThe Enterprise\033X

If you only intend to have the one named and coloured ship, then have the complete name in the t-file -- \033YThe Enterprise\033X.

As a bit extra - if you want all your stations and ships to have coloured names and/or your company name, then copy page id="1706" from 440001.xml to your t-file. Then you can edit it in Notepad to change all the 'Your xxx ' to '\033W My company name xxx \033x' to give your company name in front of the station, all in bright white (in this example) and the game will automatically name all your ships and stations for you.... plenty of scope for colours and names...

Boron - Ol Fh'art
Public Service announcement

Growing old is not a disease - it is a delayed symptom of birth trauma.

Thraxwhirl
Posts: 681
Joined: Fri, 17. Feb 06, 21:54
x3ap

Post by Thraxwhirl » Mon, 24. Sep 07, 16:54

Ah, I think I get you, B-O-F.

I'll have a play-around later(though I've other scripting stuff to sort first), and see if I can master that.

Thanks. :)

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 21061
Joined: Mon, 15. Nov 04, 00:26
x4

Post by Cycrow » Mon, 24. Sep 07, 22:21

in a few of my scripts my set coloured names for some ships and use the entry

Code: Select all

\033B%s\033X
then u can set any ship name to blue, or have a few entries for different colours, etc

Post Reply

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