Where to place the files
Open your SWL Directory.
Create a folder named "Scripts" (without the ") and place the text files there.
IE: Program Files/Secret World Legends/Scripts
If you created a script named "PopupTemplet", when that is placed in the Scripts folder, you can immediately in game type:/PopupTemplate
That will send the popup/link to the channel you are talking in.
Will auto-complete it for you.How it works
First word of caution:
It all needs to be in one continuous line.
If you put an [enter] in the popup, it will not work.
for line shift.
A simple script
<a href="text://Hello world">My first popup</a>
You need to start with:<a href="text://
Then put the text you want in the popup, then end with:">
If you put any " between those in your text, it will not work.
The next thing is what you want to appear as the clickable link, in this case:My first popup
Finally end it with:[/url]
This is all good for information, but if you want it to be pretty with colors, links to chat-channels, websites and /tell messages, then we need to ad links in that space between <a href="text://
and ">Changing color in the popup
When talking about adding or changing things in these posts I always mean between <a href="text:// and ">.
There are two ways to do it:
<font color=blue>text you want to be blue</font>
and if you want a more specific color:
<font color=#00CCFF>text you want to be that special shade of blue</font>
Again, if you put any "
in there, the popup will not work. They are not needed either.
Changing font size / make text bold in the popup
In TSW popups you do not change font size, you change the font face to do that.
The same with making text bold and italic.>
do not work. (
Here is how you change the font face:
<font face=LARGE>text you want to be large</font>
<font face=NORMAL_BOLD>text you want to be bold</font>
There are a limited number of options though, being:NORMAL
There are more and bigger font faces, but they are not needed.
To see how they look in-game you can use this script:
/Text <a href="text://<BR> <font color=#00CCFF face=NORMAL>NORMAL</font> Size: 12<BR> <font color=#00CCFF face=NORMAL_BOLD>NORMAL_BOLD</font> Size: 12<BR> <font color=#00CCFF face=LARGE>LARGE</font> Size: 14 weight: Medium<BR> <font color=#00CCFF face=LARGE_BOLD>LARGE_BOLD</font> Size: 14<BR> <font color=#00CCFF face=HUGE>HUGE</font> Size: 15 weight: Medium<BR> <font color=#00CCFF face=HYBORIANSMALL>HYBORIANSMALL</font> Size: 16 weight: Medium<BR> <font color=#00CCFF face=TSWLARGE>TSWLARGE</font> Size: 16 weight: Medium<BR> <font color=#00CCFF face=HYBORIANLARGE>HYBORIANLARGE</font> Size: 18 weight: Medium<BR> <font color=#00CCFF face=HEADLINE>HEADLINE</font> Size: 21 weight: Medium">Font faces</a>
Adding chat channel links to the popup
Remember the note about not having any "
between <a href="text:// and ">
We need a quote mark to put in links, luckily we still have ', meaning that you are not allowed to use that either in the links you put in the popup.
you can safely use ´and ` though, id you want to spell don´t or use it for other things.
The principle of the code is chatcmd://
A code that executes what comes after it in chat.
Meaning if you put in chatcmd:///say Hi
The character clicking it will say "Hi"
Just like that we write it so it allows people to join a chat-channel with a single click:chatcmd:///join chat IC
We need to put it into a link for it to work though:
<a href='chatcmd:///chat join IC'>Join the IC channel</a>
Adding /tell links to the popup
Sending a /tell via link works the same as chat channel links, it uses the chatcmd://
command, but rather with a chatcmd:///tell Daath
if you want the reader to easily be able to contact Daath.
Writing it out like this means that no matter who posts the code, the tells will always go to the same person, so be sure they are online.
<a href='chatcmd:///tell Daath I read your popup'>Send Daath a tell</a>
If you want to make it so you, the one posting the popup gets the message, here is the code for you:
<a href='chatcmd:///tell %m I read your popup'>Send %m a tell</a>%m
is automatically replaces with the name of the one sending the popup.
For more more variables, for scripts see the section later in the posts.
Adding website links to the popup
This is kind of complex, and relies on the previous methods and then some.
Hence I will post the code and then try to explain it afterwards:
<a href='chatcmd:///option WebBrowserStartURL "http://www.thesecretworld.com" \n /option web_browser 1'>open the TSW website</a>WebBrowserStartURL
is supposedly meant to set the permanent starting address for the browser..
But it is not working like that at the moment, it only affects the next time the browser is opened.
Which is actually what we want, so that is fine: no permanent damage there.
There is the slight (HUGE) problem that the way it works, if you want to use it is:/option WebBrowserStartURL "http://www.forums.thesecretworld.com"
and it does not work without the "
..and we have a popup where we can not put " in without breaking it..
---- luckily there is the fact that "
is another way of writing "
, and as "
in passed at a later stage it does not interfere with the popup.
So yes, we can set it so the next time the user opens his or her in-game browser the site linked will open.
.. but that is troublesome asking the user to do that, so in the code above a \n
in included, meaning "new line" or in this case "new command", after which we put in the command to open the in-game browser: /option web_browser 1
TL DR it works.