[SCR] The Galactic News System (BBS 2.0) (V.105)

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

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

User avatar
enenra
Posts: 7150
Joined: Fri, 8. Apr 05, 19:09
x4

[SCR] The Galactic News System (BBS 2.0) (V.105)

Post by enenra » Wed, 30. Sep 09, 15:20

The Galactic News System

Welcome to the Galactic News System. As many people miss the former BBS-System in X3: Terran Conflict, we have developed a new system, which allows news to be available to the player in a similar fashion to X3: Reunion.

Installation:
Excluding the PDF which is not needed, copy all files/folders in the archive into your Terran Conflict root folder. Start a new game or load a saved game.

For players:
To open a newspaper you will need to define a hot-key in the interface section of Terran Conflict’s control set-up options menu. After this has been done, you will just need to press that key for a newspaper to open. The system will open a newspaper that will be based on the owner of the sector you are in (If a newspaper is available). The picking of articles will be random within the selection of articles that are available to that race.

For scripters:
Because for mods it may be better to open the newspaper in another way (for example MD-scripters who want to add a newspaper-seller to a station, from where you could purchase it) You would only need to adjust the set-up script for this so that the hot-key part is deactivated. The activation of the show-script can be done from any place you would like. This has been deliberately done to make this system as flexible as possible.

Some variables inside articles (not the titles!) which are added to the GNS will become replaced automatically by other content. For instance the variable $PLAYERNAME$ will be replaced by the name of the player. There are plenty of variables, all documented in the manual.
This function makes it easy to generate static articles, which change from one showing to the next.


Final Version Info:

All articles from X3: Reunion have been ported over to Terran Conflict and placed as a static type of news in the same way it was static in X3R.

However there is also a set of additional scripts that allow modders to quickly and easily add dynamic news into the system as well.

Anyone is welcome to try this system, and we are especially interested in getting feedback from scripters and modders for the dynamic news scripts. :)

A more complete instruction set for scripters is in the included PDF.

Download links
[ external image ]

[ external image ]

[ external image ]

Outdated link

Galactic News Service Version 105

Additionally we want to mention that one of our MD-scripters, Jens Ka, has written a MD-lib for use with the GNS. This can be downloaded here. By using this lib, the inclusion of new articles for missions is easier than by run_script.

This is a modders resource, so feel free to use it in your own mods.



Currently known problems:
Not all non-English txt files are fully translated. (There are a few buttons etc that are still in English, the main news is fully translated though. English and German should have complete translations.)

Change log:

Beta 1
-Initial public release.

Beta 2
- race-tagging for dynamic news didn´t work properly - fixed
- using a button in an article closed the newspaper - fixed
- news title now shown above the article, when opening it

Final Version
- added a clipboard function to save your articles and read them later
- changed the arguments of the add-script, so you can now rename the headline above the executing button, but the old argument-structure is not longer working!

Version 101
- adjusted some arguments for MD-usage, which wasn't possible in the previous version

Version 102
- fixed small bug which lead to double inclusion of first dynamic news
- added support for array of races for race.or.sector-argument (only SE)

Version 103
- added a small double check for add.news-script. (Fixes a rare bug that could show up in earlier versions of the GNS. In the earlier versions, when including an article twice (with the same id) it was included in the news list twice, without a double check. Now, the second inclusion doesn't happen any more. This was only relevant for the MD-side, as the SE-side uses a command which already had this check)
- added new functionality: Some variables inside articles (not the titles!) which are added to the GNS will become replaced automatically by other content. For instance the variable $PLAYERNAME$ will be replaced by the name of the player. There are plenty of variables, all documented in the manual.
This function makes it easy to generate static articles, which change from one showing to the next.

Version 104:
- removed the beep when opening the menu - useful, when the GNS should be opened by another task instead of the hotkey

Version 105:
- fixed a critical bug, which could occur, when the player didn't open the GNS for a long time. More and more dynamic articles got added to a list, leading to a freeze and severe lagging, when the player didn't open it early enough. This never occured in the Vanilla-version, though - there are no such dynamic articles included.

Links:

Das Galactic News System (BBS 2.0) (DE)

The X-Tended Team


Edit: Added alternative download links. X2-Illuminatus
Last edited by enenra on Fri, 23. Sep 11, 19:23, edited 10 times in total.

ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh » Thu, 1. Oct 09, 02:02

How about a little more info on usage and features?
  • Can the news reports be prioritised, "front page headline" style, for important but time-sensitive events?
  • Can a scripter fetch information on the other 'competing' articles (number, priority) to figure out where their article places in the stack?
  • Can there be restrictions or content differences based on notoriety?
  • Can articles be removed/updated dynamically?
  • Are articles only localised per race or can they be localised per sector (e.g. a battle going on in a neighbouring sector, which may not be big news on the galactic scale)?
  • Can you give some short code snippets of how the scripts are utilized, by both MSCI and MD, if possible?
There are 10 types of people in the S&M forums - those who understand binary, and those who don't.

Black holes are where God divided by zero.

User avatar
Trickmov
Posts: 1431
Joined: Wed, 7. Nov 07, 19:48
x3tc

Post by Trickmov » Thu, 1. Oct 09, 09:37

ThisIsHarsh wrote:How about a little more info on usage and features?
  • Can the news reports be prioritised, "front page headline" style, for important but time-sensitive events?
  • Can a scripter fetch information on the other 'competing' articles (number, priority) to figure out where their article places in the stack?
  • Can there be restrictions or content differences based on notoriety?
  • Can articles be removed/updated dynamically?
  • Are articles only localised per race or can they be localised per sector (e.g. a battle going on in a neighbouring sector, which may not be big news on the galactic scale)?
  • Can you give some short code snippets of how the scripts are utilized, by both MSCI and MD, if possible?
1. No, currently no priorization. We had discussed this, but normally all dynamic news should be displayed at once, when urgent (and in order of apperearence). The dynamic news are always more important than any static one, so it´s probably better to show them above every static one.
However, perhaps we will include this feature later, if necessary, the argument-structure is prepared for it.

2. This would make more work for the scripter of the dynamic news, if he had to control the other ranks, too. And he would have to know much more about the GNS-working than actually. Actually you need only one command to include a news.

3. No. But as you will need a controlling script anyway, which includes your dynamic news into the GNS, you could control there the notority and start the inclusion into the GNS only, if possible.

4. Yes, this is the "max.duration"-option. When activated, the article will be shown this time in the newspaper. When the time is over, it will be removed automatically. Updating is not really necessary, the static articles will remain in the GNS either until manually removed or until the optional "show.once"-argument has been used (article can be read only one time and will be removed then). If you want to reinclude an article, do this in your controlling script.

5. Yes, you can use either the "sector"-option, this news will be shown only in this sector, or use the "race"-option, this article will be shown in all sectors of this race.

6.
Unfortunatly currently only for SE

EDIT: for MD this is the same, but you will need your own id, the SE-id-command returns a number as string, so if you take a text like my.script.number... etc., there should be no problems.

EDIT2: The examples have been updated to the arguments of the final script.

This includes an article into the GNS, which is shown only in the defined $sec. This article can be read only one time and remains maximum for 8 minutes (480secs) in the GNS and will be removed then automatically:

Code: Select all

053 @ |$id = $null -> call script 'plugin.news.getid' : 
054 @ |= $null -> call script 'plugin.news.add.news' :  identifier=$id  sector or race=$sec  newstitle=$news.title  news article=$news.article  priority (0-100)=null  show only one time?=[TRUE]  max.duration to show news (secs)=480  script to start=null  headline for button=null  text for button=null
This article is shown everywhere and can be read only one time. It will remain in the GNS, until read or manually removed:

Code: Select all

035 @ $news.id = $null -> call script 'plugin.news.getid' : 
036 @ = $null -> call script 'plugin.news.add.news' :  identifier=$news.id  sector or race=null  newstitle=$news.title  news article=$news.article  priority (0-100)=$null  show only one time?=[TRUE]  max.duration to show news (secs)=$null  script to start=$null  headline for button=$null  text for button=$null
This article is shown everywhere, it remains in the GNS after read and it is automatically removed from the GNS after 10 minutes (600 secs). Also this article has a button, which activates the $script.to.start, when used.
If there would be no button, but a script defined, the script would be executed, as soon the article is shown:

Code: Select all

005 @ $id = $null -> call script 'plugin.news.getid' : 
016 @ = $null -> call script 'plugin.news.add.news' :  identifier=$id  sector or race=$null  newstitle=$news.title  news article=$news.article  priority (0-100)=null  show only one time?=[FALSE]  max.duration to show news (secs)=600  script to start=$script.to.start  headline for button=$button.headline  text for button=$news.button

7. Additions:
  • The uncolored outfit of the articles is not necessary. The current articles are the X3R-News. For XTC we will have our own ones. For including colors, the /033-codes work.
Last edited by Trickmov on Thu, 15. Oct 09, 15:55, edited 3 times in total.

User avatar
enenra
Posts: 7150
Joined: Fri, 8. Apr 05, 19:09
x4

Post by enenra » Thu, 15. Oct 09, 15:20

Update. Final Version released. :)

Change log:

Final Version
- added a clipboard function to save your articles and read them later
- changed the arguments of the add-script, so you can now rename the headline above the executing button, but the old argument-structure is not longer working!

User avatar
Khensu
Posts: 110
Joined: Wed, 28. Oct 09, 09:42
x3tc

Post by Khensu » Tue, 3. Nov 09, 18:36

IDEA:

you could do a player article in the news, like if the player kills an enemy of the race hi in, and the ship is bigger then M6, then there should be something in the news, like:


"RaceName" 's "SectorName" saved (as title)

The brave rising star of the "PlayerRace" has done it again. "PlayerName" killed "Number of ships killed" "ShipType" whit his "PlayerShipName" ...




or something like this, it whould be a great addon I think, but I cant make it :(

User avatar
Trickmov
Posts: 1431
Joined: Wed, 7. Nov 07, 19:48
x3tc

Post by Trickmov » Tue, 3. Nov 09, 20:41

The included articles are the X3R-News and included only for Vanilla-TC. For XTC we will have our own news-articles... if and in which form such dynamic articles will be included, can´t be said atm.

For Vanilla we are not going to script dynamic news... but as this a modder's resource, everyone who wants (and can), can include his own articles or dynamic news. This system is generally made for further inclusions, and it wins from every community-news.

User avatar
Khensu
Posts: 110
Joined: Wed, 28. Oct 09, 09:42
x3tc

Post by Khensu » Wed, 4. Nov 09, 15:41

the only problem is, that I cant do it :( (but I would if I could)


anyways, geting a dinamical version whould be better...


another Idea: could you give the news a time based opening? I mean like a subscription to the nexs, maybe every ingame week the news pops up, just like in real world u get some papers every week... it would be annoying when left in SETA, but other then that it would be great, maybe a little menu to ask if I want to get news every week :)

User avatar
Trickmov
Posts: 1431
Joined: Wed, 7. Nov 07, 19:48
x3tc

Post by Trickmov » Wed, 4. Nov 09, 16:27

Khensu wrote:the only problem is, that I cant do it :( (but I would if I could)
Yes... this is a problem... but as i said, for Vanilla we are not going to do this.
However scripting something like this is not as complicated as you might think.

it´s mainly something like this:

your code and checks
get texts for news
get id
add news...
anyways, geting a dinamical version whould be better...
Yes, we know ;)
another Idea: could you give the news a time based opening? I mean like a subscription to the nexs, maybe every ingame week the news pops up, just like in real world u get some papers every week... it would be annoying when left in SETA, but other then that it would be great, maybe a little menu to ask if I want to get news every week :)
The news itself don´t have an opening time, their showing is random for static news and depending on the executing script for dynamic news. Changing this is theoretically possible, but will not be done, because this would mean to change main parts of the script.
If you want to get an automated newspaper once a week, just change the setup-script, remove the hotkey-part and replace it by a wait-a-week-loop... together with open newspaper, but the news will still be random.
Last edited by Trickmov on Wed, 4. Nov 09, 16:32, edited 1 time in total.

User avatar
Khensu
Posts: 110
Joined: Wed, 28. Oct 09, 09:42
x3tc

Post by Khensu » Wed, 4. Nov 09, 16:32

Trickmov wrote:If you want to get an automated newspaper once a week, just change the setup-script, remove the hotkey-part and replace it by a wait-a-week-loop... together with open newspaper, but the news will still be random.
and how can I do that? dunno where to start or look for it :(

and if I want a switch to turn it off and on, how can I add that to it?

User avatar
Trickmov
Posts: 1431
Joined: Wed, 7. Nov 07, 19:48
x3tc

Post by Trickmov » Wed, 4. Nov 09, 16:38

I can´t explain you detailed how to do this... i don´t want to write a whole scripting tutorial... the hotkey-part is in the setup-script. For having a switch to enable/disable weekly delivery, i would use a AL-plugin, where also the wait-cycle could be defined...

But if you are asking how to do a AL-plugin, this would exceed this thread, i suggest you first start looking at other scripts that use AL-plugins for understanding, but you could also start with one of the scripting tutorials.

User avatar
Khensu
Posts: 110
Joined: Wed, 28. Oct 09, 09:42
x3tc

Post by Khensu » Wed, 4. Nov 09, 16:44

thx for the tips :)

will try to learn from tutorials and from other scripts, then I will try to make this script better if the owner lets me :D

ohh and if maybe somebody else makes something like this before me, then plz share with me to :)

User avatar
Trickmov
Posts: 1431
Joined: Wed, 7. Nov 07, 19:48
x3tc

Post by Trickmov » Mon, 7. Dec 09, 10:33

Just to clarify the really easy usage of own dynamic news (click the thumbnails to see the bigger versions):

Code: Select all

001   $null = null
002   
003 @ $id = $null -> call script 'plugin.news.getid' : 
004 @ = $null -> call script 'plugin.news.add.news' :  identifier=$id  sector or race=Teladi  newstitle='this is the title of our news'  news article='this is the article of our news'  priority (0-100)=null  show only one time?=[TRUE]  max.duration to show news (secs)=3600  script to start=$script.to.start  headline for button='this is the headline above the button of our news'  text for button='this is the text for our button'
005   
006   return null
This is the look, when opening the GNS in a Teladi-sector, select the newstitle and the second pic will popup

[ external image ]



The "button of our news" will start the defined script (which has no value in our example though)

[ external image ]

The whole article can be viewed for one hour in all Teladi sectors and will disappear then automatically. As the "show_once"-option is set to true, the article can be viewed only one time in the newspaper. If it has been viewed, it will be removed.

User avatar
enenra
Posts: 7150
Joined: Fri, 8. Apr 05, 19:09
x4

Post by enenra » Wed, 9. Dec 09, 18:15

Just something I want to add. Examples of what articles the GNS could display:

- player has accomplenished a mission - success message to the GNS
- player has failed to do a mission - fail message to GNS
- a sector has been overtaken by the player - article about this to the GNS

User avatar
Khensu
Posts: 110
Joined: Wed, 28. Oct 09, 09:42
x3tc

Post by Khensu » Wed, 9. Dec 09, 18:18

enenra wrote:Just something I want to add. Examples of what articles the GNS could display:

- player has accomplenished a mission - success message to the GNS
- player has failed to do a mission - fail message to GNS
- a sector has been overtaken by the player - article about this to the GNS
I already had this idea, but they wont do it, this script is for the original messages, but I think anybody could use it for other scripts as a base...
Sry for my bad english ^^"

User avatar
Trickmov
Posts: 1431
Joined: Wed, 7. Nov 07, 19:48
x3tc

Post by Trickmov » Wed, 9. Dec 09, 18:37

Yes, this is a modder's resource, so everyone can include it into his own scripts or mods without having to ask for it.

User avatar
enenra
Posts: 7150
Joined: Fri, 8. Apr 05, 19:09
x4

Post by enenra » Fri, 18. Dec 09, 14:20

Update to version 101.

Change log:
- adjusted some arguments for MD-usage, which wasn't possible in the previous version

User avatar
Trickmov
Posts: 1431
Joined: Wed, 7. Nov 07, 19:48
x3tc

Post by Trickmov » Fri, 18. Dec 09, 14:31

As the usage with the MD is now fully functional, here a working code-sequence:

Code: Select all

				<run_script script="plugin.news.add.news">
				<scriptargs  comment="start inclusion into GNS">
					<scriptvalue datatype="string" datavalue="id01" comment="id, which is needed for manual removal, so use a unique string, but not only numbers as string"/>
					<scriptvalue datatype="string" datavalue="Teladi" comment="race definition, where article can be shown, the races are defined in 9500-L0XX.xml, standard are Argon,Boron,Split,Paranid,Teladi,Pirates,Goner,Terran. This is case sensitiv for race-spelling and commata in this form. So 'Boron,Paranid' will go for these, but 'Boron, Paranid' not! 9500 could be changed for mod-usage"/>
					<!--<scriptvalue datatype="object" datavalue="{this.ship_found}" comment="any object, which defines the sector"/>-->
					<!--<scriptvalue datatype="integer" datavalue="0" comment="read by SE as null, defines this article for all sectors"/>-->
					<scriptvalue datatype="string" datavalue="this is the title of our news" comment="this is the title of our news"/>
					<scriptvalue datatype="string" datavalue="this is the article of our news" comment="this is the article of our news"/>
					<scriptvalue datatype="integer" datavalue="0" comment="priority - no function (1/0 - true/false"/>
					<scriptvalue datatype="integer" datavalue="1" comment="show only one time? (1/0 - true/false)"/>
					<scriptvalue datatype="integer" datavalue="3600" comment="duration in seconds"/>
					<!-- the following arguments should be skipped by MD, though can be used for starting the defined SE-script-->
					<scriptvalue datatype="string" datavalue="{value@script.to.start}" comment="script to start"/>
					<scriptvalue datatype="string" datavalue="this is the headline above the button of our news" comment="this is the headline above the button of our news"/>
					<scriptvalue datatype="string" datavalue="this is the text for our button" comment="this is the text for our button"/>
                </scriptargs>  
				</run_script>
The result is exactly the same like in the SE-example from above (that with the screenshots), the commented code-lines are examples for other usage of the argument "sector or race"
Last edited by Trickmov on Sun, 10. Jan 10, 14:26, edited 1 time in total.

moot
Posts: 129
Joined: Sun, 29. Jul 07, 16:19
x3tc

Post by moot » Sun, 3. Jan 10, 07:08

Sorry if this sounds stupid but I still don't understand after reading this thread and the pdf... How do I add dynamic articles? By running the addnews script within SE? Or do I have to write another script? I ask this because there's a whole bunch of news I hope to convert from my old X3R script.

User avatar
Trickmov
Posts: 1431
Joined: Wed, 7. Nov 07, 19:48
x3tc

Post by Trickmov » Sun, 3. Jan 10, 11:18

I am not completly sure, if your script really needs dynamic news. If you "only" want to show (randomly) these 350 news, a "simple" t-file would be enough (with some sort of short script which includes this file). If you really want to determine, when and where these news should occur, this post gives an example of a dynamic news inclusion. Of course then you would have to change the strings there to variables including your texts (read from a t-file).


Greets
Trickmov

moot
Posts: 129
Joined: Sun, 29. Jul 07, 16:19
x3tc

Post by moot » Sun, 3. Jan 10, 16:18

My X3R script has two parts. The first part selects BBS entries for publication based on the station's race. The second part of the script deals with economic news: stations with extreme shortages or full inventories would trigger off publication of news about the wares in shortage/surplus.

Looking at your example, I assume it would be applicable to my news based on race, i.e. I should be adding entries to 9500-L044.xml, appropriately tagged? If I wish to publish a particular entry in more than one race sector, can I add multiple race tags, or must I add duplicate entries for each additional race?

Seems also that my economic news is too complex for this script, think I'll have to write a new AL script for it.

Several miscellaneous questions:
  • Can the news be formatted in columns as was in X3R's BBS? I haven't studied the MSCI in detail, thought I'd just ask here.
  • The max.duration option affects an entry's display duration within a game session, but the show-once argument will determine if an entry is displayed only once within a single player campaign (unless re-added by the controlling script). Am I correct?
  • If an article is clipboarded, will GNS remember the variables' values?

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”