Hyperlinks

The place to discuss scripting and game modifications for X³: Farnham's Legacy

Moderators: Scripting / Modding Moderators, Moderators for English X Forum, Moderators for the X3:FL Forums

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

Hyperlinks

Post by Cycrow » Sat, 10. Apr 21, 15:39

In Farnham's Legacy, you can now add hyperlinks to various places like menus, description pages, incoming messages, mission breifings, etc.
The hyperlinks will appear similar to links in on a web page that you can click on with your mouse (or select with keyboard/joystick/controller) to take you to other menus. This is primary used to open help pages within the encyclopaedia, but can open most menus.

Detailed information can be found by reading the Hyperlinks page, but discussion and questions should be posted in this topic.

Deniskos
Posts: 63
Joined: Wed, 11. Jun 08, 21:40
x4

Re: Hyperlinks

Post by Deniskos » Wed, 13. Oct 21, 18:48

Created a link in the command description
Show
Image
and everything is fine here,
but in other menus where this description is used, the link stopped working
Show
How can I fix this?
Last edited by Terre on Thu, 14. Oct 21, 08:37, edited 1 time in total.
Reason: Images posted directly to the forums should not be greater than 640x480 or 100kb, oversize image now linked

Deniskos
Posts: 63
Joined: Wed, 11. Jun 08, 21:40
x4

Re: Hyperlinks

Post by Deniskos » Thu, 14. Oct 21, 05:26

In this menu, I managed to fix it with -
Show
Image

Code: Select all

add custom menu hyperlinked info: menu=$Array, page id=0, text id=0
But I cannot influence this menu in the encyclopedia ))
Show
Image

Deniskos
Posts: 63
Joined: Wed, 11. Jun 08, 21:40
x4

Re: Hyperlinks

Post by Deniskos » Thu, 14. Oct 21, 17:56

Deniskos wrote:
Thu, 14. Oct 21, 05:26
But I cannot influence this menu in the encyclopedia ))
It seems to me that the following command is simply needed here :wink:

Code: Select all

add encyclopedia command override: command=0, pageid=0, textid=0

Deniskos
Posts: 63
Joined: Wed, 11. Jun 08, 21:40
x4

Re: Hyperlinks

Post by Deniskos » Thu, 14. Oct 21, 17:59

I'm talking to myself here :-D :x3:

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

Re: Hyperlinks

Post by Cycrow » Thu, 14. Oct 21, 20:30

Another way you can do it is to use the automatic hyperlinks. This will replace words with a hyperlink wherever a hyperlink could appear

Code: Select all

register message automatic hyperlink, page=<int>, id=<int>, link=<string>
the page and id is the text you want to replace, and the link is the string for your hyperlink.

this way if the text is display elsewhere where it doesn't format the text the hyperlink wont appear.

But any old scripts will need to be adjust to display the formatted strings instead of a standard info line

Deniskos
Posts: 63
Joined: Wed, 11. Jun 08, 21:40
x4

Re: Hyperlinks

Post by Deniskos » Fri, 15. Oct 21, 04:18

Cycrow wrote:
Thu, 14. Oct 21, 20:30
Another way you can do it is to use the automatic hyperlinks.

Code: Select all

register message automatic hyperlink, page=<int>, id=<int>, link=<string>
This is the first thing I did.
Registered with this command a link in the navigation command description on page 2022.
After that, I got broken links in two menus: Advanced Jumpdrive Menu and Encyclopedia Menu.

The next thing I did was change the menu, namely, I changed the script code:

Code: Select all

$text = read text: page=2022 id=226
add custom menu info line to array $menu: text=$text
on

Code: Select all

add custom menu hyperlinked info: menu=$menu, page id=241102, text id=38
Then everything started working in the Advanced Jumpdrive Menu.
But I cannot influence the menu of the encyclopedia. And this is where a non-existent script command would help.

Code: Select all

add encyclopedia command override: command=226, pageid=241102, textid=39

Post Reply

Return to “X³: Farnham's Legacy - Scripts and Modding”