Hyperlinks

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

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

Post Reply
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22201
Joined: Sun, 14. Nov 04, 23: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: 146
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: 146
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: 146
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: 146
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: 22201
Joined: Sun, 14. Nov 04, 23: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: 146
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

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22201
Joined: Sun, 14. Nov 04, 23:26
x4

Re: Hyperlinks

Post by Cycrow » Tue, 26. Oct 21, 11:21

Deniskos wrote:
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.
This doesn't really make sense, if all you did was register the hyperlink, then it will only be displayed in menus where hyperlinks work.
If the menu doesn't display hyperlinks, then it also wont add the automatic hyperlinks in.

Did you also add the hyperlink to the actual text ?
As you should only use one or the other, not both

Code: Select all

add encyclopedia command override: command=226, pageid=241102, textid=39
[/quote]

Such a command wouldn't really work to fix your issue. The command text displayed in the bottom is the same as the command text displayed in the command menu as well, so if you change 1, it will change both.


The better solution would be to allow hyperlinks to work in that menu as well, which might be an option if another patch is made at some point

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

Re: Hyperlinks

Post by Deniskos » Tue, 26. Oct 21, 12:59

Cycrow wrote:Such a command wouldn't really work to fix your issue.
Yes ))
Cycrow wrote:The better solution would be to allow hyperlinks to work in that menu as well, which might be an option if another patch is made at some point
This is also one of the options for solving this situation.

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22201
Joined: Sun, 14. Nov 04, 23:26
x4

Re: Hyperlinks

Post by Cycrow » Tue, 9. Nov 21, 16:22

This should be fixed in 1.3 RC1

Post Reply

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