[MOD] Event Driven News v1.0.3

The place to discuss scripting and game modifications for X4: Foundations.

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

mrjonesandme
Posts: 26
Joined: Wed, 13. Mar 19, 06:15
x4

[MOD] Event Driven News v1.0.3

Post by mrjonesandme » Sat, 25. Apr 20, 18:39

Nexus Modpage - https://www.nexusmods.com/x4foundations/mods/494/
Git Code - https://github.com/mr-jonesandme/x4f_event_driven_news


This mod provides a dynamic event driven news feed to players, by creating logbook entries when certain activities occur within the game universe. This is my first mod so it may be a little rough around the edges at first as I learn how to work with md scripting.

The primary focus of this mod is to generate dynamic news entries based on ongoings within the universe. Players using this mod will be able to feel "caught up" on what has taken place while they spent the last 4 hours in the station design window :wink: .

Economic minded players may be able to find opportunity in boom/bust events. Military minded players will like the ability to "subscribe" into territory shifts and HQ movements. Bounty hunters should enjoy the ability to receive the occasional "bounty" alert (new in 1.0.2) when pirates are partaking in their usual pinata busting of station storage.

The repo readme will stay up to date as I add/change features in the mod. If you have issues, want to contribute, or want to write up some stories for me to add in, feel free to DM me, or open an issue/make a pull request

Current Feeds: GNN

Current events by news category (the category is logged into the headline)

GNN Politics
  • Sector ownership changes (includes player faction)
  • Rebuilt faction HQ's (NPC factions only)
GNN MarketTalk
  • Sector ware shipping issues (NPC factions, excluding Xenon)
  • Sector ware shortage events (NPC factions, excluding Xenon)
  • Sector ware surplus events (NPC factions, excluding Xenon)
GNN CrimeWatch
  • Pirate activity as it pertains to the theft of cargo from station storage (NPC + player faction )

Changelog

v1.0.3
  • Fixed a bug in factionlogic_economy patch which broke factionlogic from actually pausing production modules in the game universe (thanks DeadAir for catching this!)
v1.0.2
  • Added a new GNN "channel" - CrimeWatch
  • Added a new "bounty" story to the CrimeWatch channel. If a pirate successfully hacks a station cargo module, there is a slight chance of a dynamic news entry being created for this event
  • Various bugfixes to existing news events
v1.0.1
Removed SCA from ware shortage/surplus/shipping events - a news network probably shouldn't be reporting on SCA logistics

v1.0.0
Basic "GNN news feed" which reports dynamically on the following types of events
  • Sector ownership changes (all types - faction to faction, faction to ownerless, ownerless to faction)
  • New Faction HQ assigned (previous HQ was destroyed and reconstructed/re-assigned)
  • Ware shortage (increase in demand for a particular type of ware)
  • Ware transportation issues (goods piling up in stations)
  • Ware surplus issues
Big thanks to the folks in discord for answering my frequent questions about how to do simple stuff with mdscripts :)
Last edited by mrjonesandme on Mon, 11. May 20, 22:01, edited 7 times in total.

DeadAirRT
Posts: 1007
Joined: Fri, 25. Jan 19, 03:26
x4

Re: [MOD][WIP] Event Driven News

Post by DeadAirRT » Sat, 25. Apr 20, 19:01

Quick question, are you using t file entries for your news events? If you aren't, it would be easier to switch to them now before you get too deep into events.

Any plans on incorporating events for relations changes?

drhay53
Posts: 71
Joined: Fri, 7. Dec 18, 00:38
x4

Re: [MOD][WIP] Event Driven News

Post by drhay53 » Sat, 25. Apr 20, 19:03

Saw your post on Reddit and just wanted to say this looks awesome and keep up the good work.

mrjonesandme
Posts: 26
Joined: Wed, 13. Mar 19, 06:15
x4

Re: [MOD][WIP] Event Driven News

Post by mrjonesandme » Sat, 25. Apr 20, 19:07

DeadAirRT wrote:
Sat, 25. Apr 20, 19:01
Quick question, are you using t file entries for your news events? If you aren't, it would be easier to switch to them now before you get too deep into events.

Any plans on incorporating events for relations changes?
I'm not but would be interested in learning how to do that-not sure how to work with the t files. My events are basically constructed via a do_any within a given "news event" cue with multiple possibilities (probably another area that needs improvement):

Code: Select all

<do_any>
	<set_value name="$Body" exact="'Market chatter indicates that over the coming days, %1 will experience a shortage of %2.  Sector officials allegedly have put out a high priority message on unsactioned back channels, offering increased bids for the wares in demand'.[$Requester.knownname, $Ware]"/>
        <set_value name="$Body" exact="'There was great excitement today on the %3 Stock Exchange floor today as traders forecasts of a %2 shortage in %1 appear to be paying off. Traders have been speculating for some time that due to the ongoing conflict, %1 would experience a dramatic increase in demand'.[$Requester.knownname, $Ware, $Faction]"/>
	<set_value name="$Body" exact="'%3 trade officials have allegedly banned all exports of all %1 to %2 today, citing a trade regulation which allows them to redirect all specified goods output to supporting the ongoing civil war with the HOP.  Analysts note that this action may be indicitative of a growing shortage of the goods in question, though the issue may not necessarily manifest first in Godrealm space'.[$Requester.knownname, $Ware, $Faction.knownname]"/>
	<set_value name="$Body" exact="'Tensions between the Split and Argon Federation heightened today after a spat took place in a Teladi docking bay, as traders fought over a supply contract for %2 goods to deliver to %1.  Teladi security reportedly settled the dispute by confiscating the goods, citing a violation of trade protocols.'.[$Requester.knownname, $Ware]"/>
	<set_value name="$Body" exact="'News has been circulating across local trade station outlets that %1 is experiencing a shortage of food and medical supplies.  Analysts advise caution noting to - sell the news and buy the rumor. '.[$Requester.knownname, $Ware]"/>
	<set_value name="$Body" exact="'Its a busy day today on the %3 trading floor as prices for %2 soar in %1.  MarketTalk has seen a surge in traffic volumes to %1 as transporters capitalize on the opportunity '.[$Requester.knownname, $Ware, $Faction.knownname]"/>
</do_any>
Can relations change between factions themselves, or are they always static? If the factions themselves are unlocked (or if there is a cue for when faction relations change against one another), I could easily tie into that to generate a news event

Alternatively, if you have a mod that you want to have trigger a news cue, I could make a cue that listens and reports on faction relation changes

User avatar
StoneLegionYT
Posts: 1428
Joined: Fri, 4. Nov 05, 01:18
x4

Re: [MOD][WIP] Event Driven News

Post by StoneLegionYT » Sat, 25. Apr 20, 19:37

Looking forward to using this in the future.

DeadAirRT
Posts: 1007
Joined: Fri, 25. Jan 19, 03:26
x4

Re: [MOD][WIP] Event Driven News

Post by DeadAirRT » Sat, 25. Apr 20, 20:17

mrjonesandme wrote:
Sat, 25. Apr 20, 19:07
DeadAirRT wrote:
Sat, 25. Apr 20, 19:01
Can relations change between factions themselves, or are they always static? If the factions themselves are unlocked (or if there is a cue for when faction relations change against one another), I could easily tie into that to generate a news event

Alternatively, if you have a mod that you want to have trigger a news cue, I could make a cue that listens and reports on faction relation changes
The code can be rewritten to use t file entries like you do above. I use almost the same exact way as you do in the snippet above but i am going to transition to t file entries. Once i finish, you can look at dynamic wars mod to see how.

Without mods, ai relations rarely change between eachother but with the storyline stuff there are some. My mod changes relations between factions so there is changing war/peace etc. Initially i was asking hoping to dump off my event writing onto your mod but on second thought, i don't really like relying on other mods too much. I will however make them compatible since i plan on definitely using your mod in my game
Last edited by DeadAirRT on Sat, 25. Apr 20, 23:22, edited 1 time in total.

mrjonesandme
Posts: 26
Joined: Wed, 13. Mar 19, 06:15
x4

Re: [MOD][WIP] Event Driven News

Post by mrjonesandme » Sat, 25. Apr 20, 21:14

I think the only way there could be a conflict really is if you had two news sources firing off the same cue. This is the method I'm using for now to grab my source of events - diffing off the faction logic

Code: Select all

	<!-- Watch for factions requesting a new factory for a sector.  This indicates a demand for ware, which is the end product for the factory -->
	<add sel="//cue[@name='Request_Factory']/actions/do_if[@value='$Ware.tags.indexof.{tag.minable}']" pos="before">
		<signal_cue_instantly cue="md.GNN_Feed.Market_Chatter_Factory_Needed" param="[$Ware, $RequestSector, $Faction]"/>
	</add>
My cue listens for this event, then creates a "dynamic" news entry based off the params of the triggered cue-that way I don't need to do a ton of looping over things like the ware shortage report or whatever

shovelmonkey
Posts: 152
Joined: Wed, 29. Feb 12, 17:34
x4

Re: [MOD][WIP] Event Driven News

Post by shovelmonkey » Sat, 25. Apr 20, 21:32

mrjonesandme wrote:
Sat, 25. Apr 20, 19:07

Can relations change between factions themselves, or are they always static?
Interested in the definite answer on this just to know. I have always used DeadAir's Dynamic Relations mod as I thought vanilla just had static relations.
“Not even once has life or the weather complained about a human being.”
― Mokokoma Mokhonoana

DeadAirRT
Posts: 1007
Joined: Fri, 25. Jan 19, 03:26
x4

Re: [MOD][WIP] Event Driven News

Post by DeadAirRT » Sat, 25. Apr 20, 23:22

shovelmonkey wrote:
Sat, 25. Apr 20, 21:32
mrjonesandme wrote:
Sat, 25. Apr 20, 19:07

Can relations change between factions themselves, or are they always static?
Interested in the definite answer on this just to know. I have always used DeadAir's Dynamic Relations mod as I thought vanilla just had static relations.
Vanilla is static except for a few instances of scripts in the storyline. They do not change from mining/trading/killing.

DeadAirRT
Posts: 1007
Joined: Fri, 25. Jan 19, 03:26
x4

Re: [MOD][WIP] Event Driven News

Post by DeadAirRT » Sat, 25. Apr 20, 23:25

mrjonesandme wrote:
Sat, 25. Apr 20, 21:14
I think the only way there could be a conflict really is if you had two news sources firing off the same cue. This is the method I'm using for now to grab my source of events - diffing off the faction logic
I don't think mine would have any issues. Thank's for the info.

I saw your question on discord earlier, the benefit of the t-file entries is that is can be translated into multiple languages without having to create multiple versions of the mod. After you have it set up, one of the awesome bi(+)lingual people will tend to translate it for you!

ShiBDiB
Posts: 78
Joined: Mon, 7. May 07, 00:12
x4

Re: [MOD][WIP] Event Driven News

Post by ShiBDiB » Sat, 25. Apr 20, 23:29

Nice work so far, I made the mistake of saying I would do this on discord and now I don't have to :D
-----
My Mods
Go Home Drone, Reaction Force, Disable Story, Pay The Builder, Landlord, Training Exercise
Github with the latest (Unstable) Versions
Nexus Page
Steam Workshop Page

lordofpie7000
Posts: 117
Joined: Fri, 5. Jun 09, 05:45
x4

Re: [MOD][WIP] Event Driven News

Post by lordofpie7000 » Sun, 26. Apr 20, 22:01

This mod is really cool. If you ever want someone to help with flavor text, hmu.

The idea of hearing about shortages and then being able to rush to try and fill the gaps creates a really cool idea for gameplay imo.

User avatar
Axeface
Posts: 2938
Joined: Fri, 18. Nov 05, 00:41
x4

Re: [MOD][WIP] Event Driven News

Post by Axeface » Mon, 27. Apr 20, 04:46

Exciting stuff! Really miss bbs/xtc news and this sounds like its going to fill that gap.

Max Bain
Posts: 1458
Joined: Wed, 27. Jun 18, 19:05
x3ap

Re: [MOD][WIP] Event Driven News v1.0.2

Post by Max Bain » Mon, 27. Apr 20, 09:14

That sounds really great so far :). WIll try this out.

Suggestions:

Add some more war news. I dont know if this is possible to find out, but it would be cool if you sometimes can read about:
  • an attacking/invading fleet falling into enemy territorry as secret service report (just sometimes - maybe more often for your enemy factions)
  • the result of a fleet battle, which sides and how many bigger ships got destroyed - maybe the human/alien casualties also)
  • destroyed stations (especially Defense stations or bigger ones like wharfs)
  • maybe if big ships like carriers or builder ships got destroyed
  • not a war news bug sometimes maybe report about patrols if they found some smugglers or so
  • or if in a sector the piracy count is big, report about criminals/smugglers/pirates (maybe not for the pirate sectors?)
  • maybe sometimes you can report about the constructed military ships in the last X hours of faction Y as secret service report
Havent seen it in game, but do you have an extra tab in the log book? WOuld make things easier to read and I find it very interesting to read only these news in its own tab.

Future: Dont know if this is possible, but because some missions do have this, I think it should, you could later even add some smaller pictures to the news :D.
This can really become a super cool mod for immersion.
XR Ship Pack (adds several ships from XR) Link
Weapon Pack (adds several new weapons) Link
Economy Overhaul (expands the X4 economy with many new buildings) Link
X4 Editor (view stats of objects and make your own mod within a few clicks) Link

mrjonesandme
Posts: 26
Joined: Wed, 13. Mar 19, 06:15
x4

Re: [MOD][WIP] Event Driven News v1.0.2

Post by mrjonesandme » Mon, 27. Apr 20, 18:39

One of my tasks is to find out what all adding another category to the logbook entails - my answer right now is I'm not sure if I can do that or not but agree it would be nice to split it by news topic. For now though, you can make use of the search box to filter between Politics/MarketTalk/CrimeWatch

I'm actually planning to incorporate many of your war related idea into another module - I haven't decided yet if this should be part of the same mod, or a separate one.

Basically, I'm going to create an "intelligence officer" that a player can designate on a defense station. The purpose of this will be to emulate what the NPC factions are already capable of doing - delegating out the exciting task of keeping tabs on the other factions to someone else. The player will need to assign some recon ships to the defense station. Depending on the skill level of the individual (probably management) and the pilots (piloting), the player will be able to receive both passive and active intelligence.

Active Intelligence - requires player interaction with the defense station/officer
  • Player gives an order via conversation menu to the intel officer NPC to gather information on faction X. The officer will assign an available recon pilot to fly into the faction's space. If the recon pilot survives and returns to base, the player will receive an intel report, the quality of which depends on the skill of the officer (ie, "Lots of Paranid destroyers" vs "30+ Paranid destroyers")
  • The active intelligence will be very similar to how NPC factions currently gather intel on one another, just output in a way a human can interpret instead of game logic :)
  • Other report types - get info on ship building activity, approximate faction strength, etc
Passive Intelligence: As long as the defense station is operational and the intel officer exists
  • Notifications if a faction goal (main faction or pirate) entails attacking a player asset. The quality of this advance warning will depend on the skill of the officer
  • If I can figure out how to do it, information concerning notable battles (at least 1x XL combat ship is lost, or a defense station is destroyed)

drhay53
Posts: 71
Joined: Fri, 7. Dec 18, 00:38
x4

Re: [MOD][WIP] Event Driven News v1.0.3

Post by drhay53 » Thu, 30. Apr 20, 21:46

That sounds really fun, those are great ideas.

Anthoam
Posts: 21
Joined: Mon, 6. Apr 20, 21:14
x4

Re: [MOD] Event Driven News v1.0.3

Post by Anthoam » Fri, 29. May 20, 02:35

Someone on Nexus made a translation of your mod, by adding support for localisation. So I used his files to make a translation too, in french.

Feel free to use it ;) (this is just the t files, the script with localisation support is on your Nexus mod page, in posts)
https://drive.google.com/drive/folders/ ... sp=sharing
(it still needs testing which I will be doing this week)

User avatar
Malakie
Posts: 1059
Joined: Tue, 13. Apr 04, 23:08
x4

Re: [MOD] Event Driven News v1.0.3

Post by Malakie » Sun, 14. Jun 20, 23:48

Can you add your mod to the steam workshop for ease of access?
Take it light.....

Malakie

----------------------------------------------------

raim729
Posts: 157
Joined: Mon, 17. Dec 18, 16:21
x4

Re: [MOD] Event Driven News v1.0.3

Post by raim729 » Sat, 20. Jun 20, 16:52

Hello,

Will the news also be available in German?

SirConnery
Posts: 284
Joined: Mon, 10. Dec 18, 07:26

Re: [MOD] Event Driven News v1.0.3

Post by SirConnery » Tue, 31. Aug 21, 17:00

Does this still work?

Post Reply

Return to “X4: Foundations - Scripts and Modding”