[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: Scripting / Modding Moderators, Moderators for English X Forum

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

Post by enenra » Fri, 18. Dec 09, 15: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: 1432
Joined: Wed, 7. Nov 07, 20:48
x3tc

Post by Trickmov » Fri, 18. Dec 09, 15: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, 15:26, edited 1 time in total.

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

Post by moot » Sun, 3. Jan 10, 08: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: 1432
Joined: Wed, 7. Nov 07, 20:48
x3tc

Post by Trickmov » Sun, 3. Jan 10, 12: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: 127
Joined: Sun, 29. Jul 07, 16:19
x3tc

Post by moot » Sun, 3. Jan 10, 17: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?

User avatar
Trickmov
Posts: 1432
Joined: Wed, 7. Nov 07, 20:48
x3tc

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

Ok, I think the race-specific articles could be done as static ones. Let me give an example from the 9500-file:

Code: Select all

		<t id="99">404</t>
		<t id="100">galnet</t>
		<t id="101">Terran/Solaran conflict gets front page news</t>
		<t id="102">With the tension between Terrans and Solarans in the new universe a special team has been established to make reports and explorations of this new fight. The XTC team will send you into the deepest of the thick of things and return you with fresh info into the happenings in and around the X universe.\n\nSign up for XTC today and see what is really going on in Solaran space, and who, if any, will come out on top.\n\nRity Fist, Galnet News</t>
id 99 is the number of articles in this file.
100 is the tagging, this can include also race tagging, for instance "galnet,trade:Argon,Boron"
101 is the title of the article
102 is the article itself

this is described in the manual more extensive, the next set would be from 110 to 112, then 120 to 122 and so on. Have a look at the 9500-file to understand the tagging.


You can use your own t-file, no need to change the 9500-file... even this example (with id 99=1) would work... lets say this is file 9800, then the script should be:

Code: Select all

001   $null = null
002   
003 @ = $null -> call script 'plugin.news.add.newsfile' :  text-file number=9800
004   return null
Then all articles in your file will be added to the Vanilla-texts and randomly shown.



For the second part, the economic news, which should of course only be shown, when such an event occurs, a new script (AL or something similar) would be handy... for XTC we have already done such an event, dealing with ware shortage or overflow, but this will not become released out from XTC, so you are free to do so ;)

About your questions:
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?
  • No, the new custom menues don't allow direct formatting in columns like it was for the X3R-BBS, theoretically possible, but too difficult and unhandy to include.
  • max duration = maximal time until the article is removed automatically (0=endless)
    show-once = article will be removed, when player has opened it, so when wanting to reopen it, the control script has to include it again, or you could disable this feature and remove the article by the included remove.news-script (with the used id)
  • The clipboard saves only text, so all text which is shown when seeing the article can be saved into the clipboard, but not the enhanced features for using a button for starting another script from an article.
    These parts in the example from the earlier post, the "this is the headline above the button of our news" and "this is the text for our button" cannot be seen, when the article is viewed from the clipboard... but as the dynamic articles are time-sensitiv, this makes sense, imo.

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

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

Trickmov wrote:max duration = maximal time until the article is removed automatically (0=endless)
show-once = article will be removed, when player has opened it, so when wanting to reopen it, the control script has to include it again, or you could disable this feature and remove the article by the included remove.news-script (with the used id)
If I understand you correctly, "remove" here means "remove from display on the GNS", but it could appear again later at random? And max duration = article will be "removed" after some time, regardless of whether the player has opened it, whereas show-once = article is removed once player has opened it, even if max duration has not expired?

Thanks very much for your clarification, I'll start work on the conversion and come back when I've other questions. I've also some suggested modifications for GNS, but first I should deal with the meat and potatoes. :)

User avatar
Trickmov
Posts: 1432
Joined: Wed, 7. Nov 07, 20:48
x3tc

Post by Trickmov » Sun, 3. Jan 10, 19:03

moot wrote:
Trickmov wrote:max duration = maximal time until the article is removed automatically (0=endless)
show-once = article will be removed, when player has opened it, so when wanting to reopen it, the control script has to include it again, or you could disable this feature and remove the article by the included remove.news-script (with the used id)
If I understand you correctly, "remove" here means "remove from display on the GNS", but it could appear again later at random? And max duration = article will be "removed" after some time, regardless of whether the player has opened it, whereas show-once = article is removed once player has opened it, even if max duration has not expired?
The removal of dynamic articles is for ever - not only for display now, when you want to see it more often or longer, include it again or don't use a remove-feature.
The second sentence is absolutly correct ;)
Thanks very much for your clarification, I'll start work on the conversion and come back when I've other questions. I've also some suggested modifications for GNS, but first I should deal with the meat and potatoes. :)
Feel free to do so ;)

User avatar
Trickmov
Posts: 1432
Joined: Wed, 7. Nov 07, 20:48
x3tc

Post by Trickmov » Mon, 4. Jan 10, 18:44

Update to version 1.02:

http://downloads.thexuniverse.us/XTC_GN ... temV102.7z

Change log:

- 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)

User avatar
Locksley
Posts: 366
Joined: Fri, 18. Mar 05, 17:26
x3tc

Post by Locksley » Wed, 3. Mar 10, 16:41

Great stuff here!
I first read about it over at the XTM site but didn't really "read".

This is a very welcome addition for adding atmosphere and allot more roleplaying rewarding when one starts adding articles that reflects the player actions.

I will have a look at this after I reinstalled and played for a while. I think the scripting aught to be in my division (amateur, drop the ball - division).

Cheers!
Projects:
Onhold..... time time....

User avatar
Trickmov
Posts: 1432
Joined: Wed, 7. Nov 07, 20:48
x3tc

Post by Trickmov » Wed, 3. Mar 10, 17:19

Locksley wrote:Great stuff here!
I first read about it over at the XTM site but didn't really "read".

This is a very welcome addition for adding atmosphere and allot more roleplaying rewarding when one starts adding articles that reflects the player actions.

I will have a look at this after I reinstalled and played for a while. I think the scripting aught to be in my division (amateur, drop the ball - division).

Cheers!
Thank you :)

As far as we know, there are two scripts out there, that include support for this script:

1. enenra's Rescue Princess MD Mission
2. my sectortakeover-script STO

In XTC we will have also some other "events", that add articles and simulate a non-player-centric universe.

And in XTC we are using the same GNS-version, so if you have scripted something for Vanilla, it will run also in XTC (from the viewing side).

BlackRazor
Posts: 4653
Joined: Tue, 20. Apr 04, 17:39
x3tc

Post by BlackRazor » Thu, 22. Apr 10, 10:36

The Italian text file contains an error that causes the file not to be loaded and all text to be replaced by ReadText errors.
The problem is in 't id 1042':

Code: Select all

direttore del settore R&S della Arminet
That '&' charachter has to be escaped like in the English Text file, i.e. it has to become

Code: Select all

&amp;
Can I redistribute the correct Italian text file or do you prefer to publish your own fix ?

BTW I noted that several text entries in the Italian file are actually in Spanish, is this correct ?
"For the love of the Fish-Queen!"

User avatar
Trickmov
Posts: 1432
Joined: Wed, 7. Nov 07, 20:48
x3tc

Post by Trickmov » Thu, 22. Apr 10, 11:32

Hm, that's problematic.... the &-bug could be easily fixed, but the spanish texts inside the italian file are another thing.

It's a quite huge work to extract these from X3R and put them into a new file. As we don't use the X3R-files in XTC anyway, we cannot spend time on the italian file now... so, if possible, we would appreciate, if you could take care of that problem.

All we could do, is fixing the &-bug, but if you provide a complete italian file, we will include it in the archive.

Sorry ;)

BlackRazor
Posts: 4653
Joined: Tue, 20. Apr 04, 17:39
x3tc

Post by BlackRazor » Thu, 22. Apr 10, 16:07

Well I have no idea how I can extract these texts from Reunion and put them in a text file so I can't provide you with the correct Italian file. I just got a report from an Italian user saying that he was getting ReadText errors when using this script, investigated and reported here my findings :wink:
"For the love of the Fish-Queen!"

User avatar
Trickmov
Posts: 1432
Joined: Wed, 7. Nov 07, 20:48
x3tc

Post by Trickmov » Thu, 22. Apr 10, 16:29

Yeah, we feared so... you can tell him, that we could fix the &-bug, but extracting the italian X3R-newstexts and creating a new italian file without spanish texts is out of our resources atm, so it would be up to him, if he wants to get an italian file online.

The X3R-newstexts are included in the 0001.xml-file, so the work is mainly copying and pasting them out of there (where a bug must have happened at us).
These are 404 articles and it's a really big load of work and time, which we can't afford atm.
Also in XTC we don't use these articles, so it's a bit lost time for us ;)

Post Reply

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