Code Monkey home page Code Monkey logo

x4f_event_driven_news's Introduction

Event Driven News v1.0.3

Event Driven News is a mod for X4 which adds dynamic event based news and reports to the game. Forum link - https://forum.egosoft.com/viewtopic.php?f=181&t=426035

Installation

Place the 'event_driven_news' folder into your X4 Foundations extensions folder. This mod does not require a fresh game start and is to the best of my knowledge safe to remove. Make a backup of your save just in case

Known Issues

On a brand new game start, you will receive faction HQ destruction news events after the universe first initializes. I'm aware of this issue and need to add in some kind of timer to suppress the very first, but not subsequent, faction HQ change events

Change Log

1.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!)

1.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

1.0.1

  • Removed SCA from ware shortage/surplus/shipping events - a news network probably shouldn't be reporting on SCA logistics
  • Bumped up frequency of ware surplus/shortage events, was too low
  • Some edits to content.xml so the version and name show correctly

1.0.0

Initial release

Feeds and Events

Currently, there is one active feed - GNN

GNN

The GNN feed reports on general galaxy events, logging into the player's "tips" logbook with the headline split by category. This is your basic barebones news feed and is available to all from the start. For balancing purposes, it will not be as precise as one of the planned "premium" feeds, but adds life to the universe and gives some indication to the player as to what sectors are experiencing. The GNN feed currently reports based off the following types of events:

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 & SCA)
  • Sector ware shortage events (NPC factions, excluding Xenon & SCA)
  • Sector ware surplus events (NPC factions, excluding Xenon & SCA)

GNN CrimeWatch

  • Pirate activity as it pertains to the theft of cargo from station storage

Additional planned GNN features

  • Basic UI for toggling news events on/off by category
  • Rumors regarding Xenon I sightings
  • More variety/X lore friendly reporting

Premium Feeds

The following "premium" feeds are planned in a future update. In contrast to the GNN feed, these will be more analytical in nature and help guide players in military and economic objectives

Teladi Trading Terminal

This will be a license available from a friendly Teladi for some change. It will provide more precise economy related event topics, making it easier for industry focused players to respond to dynamic pricing events. These events are likely to arrive sooner and contain information that a player is able to act on to bring in more profitsss

Corporate Intelligence Services

This feed will depend on the dedication of a player "asset", such as a defense station or fleet. It will enable the player to receive periodic intelligence assessments on other in game factions and alerting about faction goals targeting player assets. Reports could include information such as estimated faction capital ship numbers, active defense stations, faction goals, contested sectors, faction momentum etc.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. If you are interested in adding more variety in some stories of your own, please open an issue so that I can get into contact with you

License

MIT

x4f_event_driven_news's People

Contributors

galaxycr8r avatar mr-jonesandme avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

x4f_event_driven_news's Issues

[Suggestion] HQ Destroyed Spam

I see based on your "known issues" you're aware of the HQ Destroyed spam at the beginning of the game. I wanted to suggest that instead of a timer or delay, you could always use a simple flag.

I have had cases in my game where the 5 minute delay isn't long enough because several script heavy mods can take a while to initiate so the 5 minutes passes before the galaxy finishes spawning and the "HQ Destroyed" spam comes through.

  • Create script level variable displayHQDestroyedMsg = 0
  • Only perform the notification if the value is 1

Something like:

<cue name="New_HQ_Headline" instantiate="true">
			<conditions>
				<event_faction_headquarters_changed/>
			</conditions>
			<delay exact="5min"/> <!-- add a delay timer to prevent race condition where HQ has changed but new rep has not been assigned-->

            <!-- TODO: Declare the variable displayHQDestroyedMsg properly at the top of the script and save / load it with the game save / load -->

		<do_if value="displayHQDestroyedMsg == 1">
                    <!-- To avoid spam at game start, only display message if it isn't the first time triggered -->
                    <actions>
                        <set_value name="$GameAge" exact="player.age"/>
                        <set_value name="$Faction" exact="event.param" />
                        <set_value name="$Rep" exact="md.$FactionData.{$Faction}.$Representative.knownname" />
                        <set_value name="$HQ" exact="md.$FactionData.{$Faction}.$Headquarters.knownname"/>
                        <set_value name="$Sector" exact="md.$FactionData.{$Faction}.$Headquarters.sector.knownname"/>
                        <set_value name="$Body" exact="'We are receiving reports that the %1 HQ was destroyed, the cause of which is unknown at this time. Sources say that %2 is slated to takeover, and will be restarting operations from the %3 station in the %4 sector.  The whereabouts or status of the former leader are currently unknown'.[$Faction, $Rep, $HQ, $Sector]"/>
                        <set_value name="$Ticker" exact="'GNN Politics'" />
                        <set_value name="$Headline" exact="'%1 HQ Destroyed'.[$Faction, $Rep, $Sector]" />
                        <write_to_logbook category="tips" title="$Ticker + '-' + $Headline" text="$Body"/>
                        <show_notification text="$Ticker + '-' + $Headline" timeout="10s"/>
                        <play_sound object="player.entity" sound="'notification_generic'"/>
                        <debug_to_file name="'gnnlog.log'" directory="'gnn'" text="player.systemtime.{'%Y-%m-%d %H:%M:%S'} + ' ' + '[Faction]' + ' ' + 'GameAge=\'%1\' Event=\'HQChange\' EventAction=\'New HQ and faction representative\' Sector=\'%2\' Faction=\'%3\' Station=\'%4\' Rep=\'%5\' Logbook=\'True\' FeedType=\'GNN\' '.[$GameAge, $Sector, $Faction, $HQ, $Rep]"/>
                        <remove_value name="$Faction" />
                        <remove_value name="$Rep" />
                        <remove_value name="$Body" />
                        <remove_value name="$Ticker" />
                        <remove_value name="$Headline" />
                    </actions>
            </do_if>
            <do_else>
                <!-- This is the first time triggering the event. Set the flag so it will allow future messages to display -->
                <!-- TODO increment a counter and only set this to 1 if the event has been triggered enough times for all HQ at game init -->
                <set_value name="displayHQDestroyedMsg" exact="1"/>
            </do_else>
</cue>

I suggest add colour to highlight different news types... and change logbook categories...

mr-jonesandme,

I've made some adjustments (to 1.02 in this case) inline with some recommendations ive read and had myself to improve readability:-

  • - add colours to highlight different news types, (red for Xenon takeovers, gold for market news etc) and;

  • change logbook category for Sector changes to 'News'

attached is a zip of adjusted event_driven_news.xml
event_driven_news.zip

hope you can adopt the refinements or something similar!
your consideration much appreciated,

cheers,
Sparky

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.