Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - Morrokain

Pages: [1] 2 3 4

I came across this article today and I found it both touching and a really neat description of how people of different generations relate to game design and gaming as a whole. It doesn't strive for big answers or attempt to create catch-all definitions of these things, but rather brings them to light and touches upon how they shape what people do and do not enjoy about games new and old. Considering recent discussions in various threads about what is or isn't fun in a game, I thought it would be fun to share it.

For those of you who are unfamiliar with the game, Legend of Grimrock II is a dungeon crawler RPG inspired by 80's dungeon crawlers that came out ~8 years ago. I highly recommend it as I had a great time playing it and I've been pining for a Grimrock III ever since. Unfortunately the company broke up and went in different directions so the wait might be a while if not forever. :'(

If you plan on playing the game, there are some light spoilers in the article like puzzle archetypes and some monsters you will find. Nothing too earthshattering though.

One thing that I love about the article is that it brings up the 'nostalgia elephant' in the room. That is to say that nostalgia is a big factor in how we remember our favorite games and how we sometimes justify their dated flaws to ourselves even if they are painfully obvious to others who don't share our nostalgia. I think that is a huge point to make even if I don't think it's a bad thing. Fun is fun and having a different opinion of what is fun is both natural and healthy.

If anything, I'd say Grimrock II's triumph in bridging that gap is a testament to how well designed it truly is. I was born in 87, so I obviously couldn't possibly have the same experiences as anyone playing games at the time. Yet, somehow I didn't find anything dated about Grimrock II even if the features were nowhere near mainstream. In fact, I found it very refreshing and I was surprised at how excited I was to play it each day. If someone would have come up to me prior to that game and predicted that I would like a game where you press 'qweasd' to turn/move a single block tile in any direction and where slashing effects are a simple single stripe along a character portrait I probably would have laughed and said "you don't know what types of games I like" before going back to playing whatever MMO or RTS I was into at the time.

My takeaway is that good design can transcend time, nostalgia and mainstream trends alike. Discussion welcome! (Please keep it polite.)

*EDIT* Oh! I almost forgot! If you play the game, I recommend Old School mode that doesn't give you a map of any kind. Pen and paper mapping the entire game world as I explored it was quite honestly a BLAST and not the tedium I expected it to be! Maybe I'm an explorer at heart. ;D

Suggestions / Faction Doctrine Nice-To-Have
« on: September 03, 2020, 04:46:54 PM »
Just a "nice to have" nothing really serious.

It would neat to be able to determine variant probability based upon fleet size. That way I could prioritize more balanced variants in smaller fleets (early game challenges) and then prioritize more specialized (and synergistic) variants in late game changes. Or, in respect to the benefit for vanilla, some variants can be "reserved" for endgame - creating more challenge with larger fleets.

Example of current faction doctrine: (Please forgive the spacing syntax - it's relatively hard to do on a post.)
   # variantOverrides restricts hulls to listed variants and adjusts their probability

Suggested faction example:

   # variantOverrides restricts hulls to listed variants and adjusts their probability

Regarding upcoming skill changes and fleet diversity mechanics:

The bonus scales down linearly, so if it's 50% at 6, then it'd be 25% at 12.

And, yeah, I get what you're saying about Shepherds/Ventures. Kind of want to see how it actually works out; I mean, losing a bit of the bonus isn't a huge deal, and just in general I'd expect the various fleetwide bonuses to be less-than-maxed-at-all-times.

That said, I could see maybe adding a tag for certain wings or ships that make their bays not count (or get the bonus). But that's getting pretty off-topic for this thread.

The tag would likely be useful. It would also be ideal to have a way to override the cap before degradation of the bonus begins (or rate of decay but linear degradation means the cap is the most important component) - but, honestly, even if it didn't I don't think it would matter too much as an initial theory. (At least for my use case, anyway, the API already lets me give free OP fighters/weapons in some circumstances so that might be enough to warrant a weakened fleet-wide bonus to simply have higher numbers for the *damage impulse* factor or, even, increased sustainability of many more bays at a much lower rate.) Just giving overall impressions/theoretical feedback. For general mod-ability, access to this stat would be sweet!

At the end of the day, I am looking forward to the skill revamp and the idea of increased fleet roles and diversity in hullsize/ship types.

Elite skills seem really interesting as a concept! Besides the expanding lore, I am really excited to see how elite skills work.

Suggestions / Faction File Implementation For Modders
« on: June 18, 2020, 06:47:11 PM »
It would be great if the faction file had weight modifiers for all its market/fleet sections similar to how variants and hulls currently work. Even blueprint packages for known ships, etc, could use a way of overriding just that portion rather than having to lock the file entirely. (Not sure if that part already works that way though, and its pretty easy to override blueprint contents themselves by using the csv files to remove the blueprint tags... so on second thought not as big of a deal with the exception that removing the tags means that any factions in Nex, for instance, that rely on those packages' contents for a new game start will be negatively affected.)

This way some factions could have a higher chance, for instance, to have rare fighters or weapons in their markets. Or a lower chance, etc. Thematically this makes sense to me.

It also solves the issue of having to override the entire faction file to remove standard vanilla weapons and fighters from showing up in faction markets. (Which means no portraits can be added, no new ships/variants/weapons, etc, for other mods adding things to vanilla factions.) Instead, I could just remove the item from spawning or being used by setting its weight to 0 - like how the buffalo2 works in many vanilla factions.

If its too much work, ah well. It would certainly be nice though!  :)

Modding / Ugh THIS is why I hate Excel....
« on: June 17, 2020, 03:56:59 PM »
Arrrgh!  >:(

My ship_data.csv and weapon_data.csv files are now completely broken in the "tags" column for the Open Office csv editor because my dumb butt saved it in Excel Ex-smell (like hot garbage) for a tiny change to a completely different cell. Apparently that makes the quotes unable to be read as a cell wrapper for Open Office. *Curses under breath*

It's not a big deal for now because I still can use Excel or Google Sheets, but if I get a new computer I will have to buy Microsoft Office again or stick with Google Sheets and it's not exactly cheap. This stuff annoys me so much. Any quote enclosed cells are finicky-er than my cat in that program's format... sigh. I even tried re-saving it as a .csv with google sheets and nope its just permanently broken in Open Office now unless I manually change it. I will say I'm pretty unfamiliar with Google Sheets so that could be the problem. I'm probably going to permanently switch to that and learn it now though.

People... just use Google Sheets it will save you a large headache though it requires internet access (I don't always have that while camping and sometimes do late-night work by the fire with my gfs labtop). It's at least free instead of forcing a format that you will have to constantly pay for in the future.




Open Office:


Modding / [0.9.1a] Expanded Fleet Dialogue
« on: May 09, 2020, 03:14:16 PM »
Mod Page Under Construction

This WIP mod expands fleet dialogue options for npc fleets.

The current options are:

1) Commodity Requests (Fuel, Supplies, Credits)


2) Ceasefire Negations (Can also use bribes to increase the chance of success)


Mod Compatibility Information:

For those mods who implement their own dialogue, that dialogue will not spawn this mod's dialogue options. A couple examples: Coalition, Dassault-Mikoyan Engineering

However, mods that use the standard default fleet dialogue from vanilla for their mod faction will have the options populated. Example: Diable Avionics

Opt In/Out Options: the mod plugin can be set up to crash the game if Fleet Dialogue is active, so that is one way a modder can easily get around this. Another way would be to just implement custom faction dialogue using the unique mod id to prevent the default vanilla dialogue from being used.

There isn't an easy way around this on my side since many vanilla factions rely upon the defaults, but as an olive branch if there are particular modder/modders who really don't want to add custom dialogue for their faction or an exclusion in the mod plugin and also don't want these options available: Post here with a link to the mod page and I will try and add a "not this faction" check to the defaults and I *think* that should allow the original defaults in vanilla to still populate for that faction without the dialogue options. That is very much an educated guess though, and will be done in an "upon request" kind of way.

Similarly, if you have implemented custom dialogue for your mod faction, and would like these options to be included in the interim between release and if/when I can set up some way of doing this in the mod faction's directory, you can post here and I will implement the dialogue with the necessary script in this mod.

Suggestions / Easy Mode Toggles
« on: February 17, 2020, 05:37:01 PM »
It could potentially be helpful for new players to have visible in-game difficulty toggle options when starting a first play through. These options could also be expanded to effect more campaign difficulty spikes.

1) An option to reduce supply and maintenance costs or alternatively reduce the credit cost of supplies and fuel.

2) An option to reduce the penalty of inspections/or number of raids generated against their colonies.

(Thoughts of any more?)

Having a visible in-game toggle menu might encourage players to customize their difficulty the first time they play based upon their gaming experience or genre background. For instance, a player may want to reduce supply or fuel costs but not, say, reduce the combat damage their piloted ship takes, or, increase the damage it deals, etc.

A concern: How could this also accommodate mod additions to difficulty mode config? Is it possible to implement a scrolling list in the UI that could read entries from the settings file and populate toggles during in-game campaign starts? (Thereby allowing additions to the list of config options that can be enabled/disabled when starting a new campaign in-game).

TLDR: The main goal is to make difficulty customization more visible to new players and to increase the number of customization options for more elements of the campaign.

Modding / Any interest in a random faction battle mission?
« on: August 28, 2019, 09:44:12 AM »
I wanted to gauge interest in this since I am already making one for Archean Order, but has anyone ever created a random faction battle mission sort of like random battle but with randomly assigned faction fleets?

I am about... er, half way done? - with mine and if there is interest I can post the code here when I'm finished. I've made it fairly easy to edit for anyone else to use. You would just have to replace the variants since many of the current ones included are exclusive to my mod.

How it works:

1) Chooses a random faction for the player and the enemy. (lists of available factions for each are separate so you can lock some factions to one side or the other)

2) For for each side, chooses a capital-class flagship for the fleet from a list of the chosen faction's possible flagships. (those lists are also separate for the player and enemy)
3) From the remaining fleet points after the flagship is chosen populate the rest of the fleet with that faction's ships. (I am thinking of also investing in a sorting algorithm to make cruisers at the top of the fleet, destroyers just after, etc. Just makes it look prettier lol)

As I have been playtesting Archean Order with .9.1a of Starsector, I noticed something different in how the AI combats fighters over prior updates.

They seem to almost completely ignore the "STRIKE,USE_VS_FRIGATES" or simply "STRIKE" AI tags now, unless they are within range of another enemy ship.

I can give you some videos if you like, but the AI uses Atropos torpedoes and ballistic strike weapons designed with very limited ammo storage against inconsequential fighters whenever other ships aren't present. This often locks them out of those weapons when the actual fight commences, and its frustrating.

If there is time in the future, I would really appreciate an AI tag that explicitly prevents those weapons from being used on fighters, literally ever. Never ever, ever.

Reasoning: There is never a good situation where that is viable in my mod since fighters are so flimsy and replaceable. To make matters worse, the Tachyon Lance is a "kill shot super weapon" with a 60 second cooldown. It is wasted on fighters more often than not even with the "STRIKE,USE_VS_FRIGATES" tag. I'm actually not really sure why on that one, since other ships are actually very much in range of 10,000 at the time. Yet still, it seems to prefer fighters...

Or, it will fire, then suddenly re-target to a fighter randomly from the ship it started its burst on.

Suggestions / Player Expectations and Early Game Balance
« on: March 03, 2019, 12:45:13 PM »
Overall I think the last few official updates have really helped to open up the early game's starting options.

There is a lot more nuance in what you can do to get a bit of cash flow, and that extends to a variety of play styles. You can trade effectively with missions both from the bar and intel, you can salvage what you find on the fringes of the car world and take on surveying missions if you want to explore to start, or you can get right into combat early on with paid bounties.

Though all of these options are possible and explicitly encouraged through their immediate and open representation on the mission board, in my opinion the difficulty between each option is a bit confusing to the new player right now.

Details (--CAUTION-- spoilers contained):
- The average starting pirate bounty is pretty strong with typically a couple to several vessels above a frigate present. That is at lv 0. A level above that can include capitals with mods, but I assume its far above the strength of the derelict equivalent.

 - The starting tiered derelict has only a couple frigates, on average, defending it. So if you are exploring you will need very little combat capability early on. Trading and bounty hunting both require a lot more by comparison.

 - The derelict survey vessels can be a large jump in strength from the probes with a lot more defenders present. So a salvager or explorer suddenly finds that they went from needing a frigate or two to several frigates and a destroyer.

 - Some bar missions leading to weapon caches, on the other hand, are guarded by high tier REDACTED and are within a star's corona. That is a really difficult encounter for a new player. To have a large enough fleet to deal with the defenders, the corona's effects get worse and more costly/difficult to manage.


 - Like the fleet strength indicator added for the next update, maybe include something in the mission ui later down the line to give a general sense of the mission's difficulty.
 - I think starting encounters between play styles should roughly match each other in combat difficulty. Not 100% equal, maybe, but at least fairly close. Otherwise you run the risk of a new player unknowingly choosing a more difficult route simply because of role playing preferences. Though this point is less relevant if the player is explicitly made aware of that fact.

Modding / Blueprint Package Tiers
« on: January 03, 2019, 08:06:49 PM »
I recently familiarized myself with the wiki on blueprint modding and 0.9 compatibility to start campaign balance and though I have a pretty good understanding of how the blueprint system works in general and with faction spawning in the campaign.

I have a couple more questions about blueprint packages those sources don't completely cover:

How are blueprint packages, specifically, distributed to the player, and do they unlock everything in that package all at once or a single bp of the set?

Are they sold in markets? (I've browsed a few and haven't seen any). Can they be locked or unlocked with skills, or based on faction reputation such as with weapons bought wholesale? Or are they strictly limited to procgen (with the thing determining drop rate being the rare_bp tag) and raiding? I have created 3 tiers for each tech doctrine, and I want the first tier to be purchasable at favorable, the 2nd tier to unlock at welcoming and the 3rd tier to unlock only at "friendly" and above for specific factions.

Modding / [0.9a] Total Conversion Replace Array Resource (mod_info)
« on: December 14, 2018, 12:53:53 PM »
If you are working on a total conversion in starsector version .9 or above, changes to the way resource files are merged cause each base starsector file to attempt to merge with any mod files of the same name present in mod directories.

To get around this and truly have a total conversion, each individual file, along with its file path, must be included in the replace array inside mod_info. To save modders time, I will include all ship, skin, weapon, variant, and faction files inside the array alongside their csv files.

This will also include lines for a few other mod files in config and such that can be removed as needed. If your mod doesn't replace them, don't include them in the array.


*EDIT* Corrected a typo in one of the .skin file overrides that would prevent it from applying.

Bug Reports & Support / Disappearing fighter wings
« on: February 25, 2018, 12:00:25 PM »
Built-In fighter wings on ships present in the player's fleet that share ids with active inventory fighter wings cause those wings in the inventory to vanish when visiting the refit screen.

In vanilla, this shouldn't be a huge issue, at least for the moment. Can't remember, does any ship have built in mining drones? If so, then mining drones may disappear. Still, figured I'd report it.


Directions to Enable Nexerelin and Other Non-Utility Mods:
1) Go to mod_info.json located directly within the the first level of the mod directory and open it.

2) Change the value 

3) You can now enable the other mods when running the game.

Important:   However, "Archean Order" is a TOTAL CONVERSION and will NOT work with some mods due to its comprehensive editing of core files. Additionally, though faction mods are technically compatible, they are not balanced around Archean Order's combat balance and so use them at your own risk. Including mod factions might cause weird things to happen or imbalance Nex campaigns so results and experiences may vary. Feature mods and utility mods are generally ok and won't break the TC's balance.  If Archean Order is on the mod list and you are mod mixing and encounter a bug, please refrain from posting on any thread other than this one for bug reports. Even if the source is clearly another mod, the TC nature could be causing something unintended and you should not bother the mod author until I can verify I am not causing it. Thanks for reading this and have fun!

Feature mods that *shouldn't* break the TC balance.
Starship Legends
Combat Chatter
Unknown Skies
Ruthless Sector
Second Wave Options
Grand Sector
Commissioned Crews
Common Radar
Fuel Siphoning
Supply Forging
Updated Rotary Weapons
Automatic Orders
Player Station Construction
Boggled's Terraforming Mod
Skilled Up


1) If you are experiencing errors with markets without NPCs and major shortages/lack of supply and demand, see this thread for a solution (at the bottom of the first page). Please also get back to me with the relevant details asked for so that I can report it- in order to help reduce the number of instances of this error in the next Starsector update.


Older versions

Version 1.2.1d (.8 version of Starsector)


Download and Installation Instructions for New Players
   -   Upon downloading the mod by clicking the link above, unzip it and click through the folders until viewing a single folder above all the data. (So the file path would read "Archean Order TC v0.8.1a/data" etc)

   -   Next, drag the folders to the "Mods" directory. It should be located under something like: "C Drive/Program Files/Fractal Softworks/Starsector/Mods" See the image in the spoiler below for an example of what the final installation directory should look like.


   -   Run the game. When the first screen appears, at the very bottom click "Mods" and a list of installed mods should appear. As long as you followed the above steps, you should see "Archean Order". For reference see the photos below in the spoiler.


   -   As displayed in the image above, other mods you may have installed will also show up here (utility mods may still be selected).

   -   Remember, "Archean Order" is a TOTAL CONVERSION -- See the warning under Enabling Nexerelin above for mod merging information before disabling the TC behavior.

   -   Checkbox "Archean Order" and click "Save".

   -   Click "Play Starsector" and enjoy the Archean Order mod!

Mod Features
     -     More Dialogue Options for Fleet Encounters
            - >   Request commodities and war funds from anyone you meet.
            - >   Negotiate cease-fires with hostile captains or bribe your way out of combat situations.
            - >   Demand commodities or payment from fleets using your strength and influence.
            - >   Get tactical advice from your officers, who will have an opinion of you that will effect their dialogue and performance. **In Development**
            - >   Negotiate with allies to reinforce your position or attack enemy factions' fleets and installations. **In Development**
            - >   Use marines to protect your commodities and prevent boarding attacks on your vessels. **In Development**

     -     4 New Factions
            - >   New thematic factions with distinctive ships, weapons, culture, backstory and tactics.
            - >   Over 15 additional markets including 2 new systems of various factions added to the Core Worlds campaign map.
            - >   New and existing factions will react differently to your dialogue choices based on their motives, personality and other factors.
            - >   New factions have their own music, portraits, tech and skins.
            - >   Explore the sector to learn more and find your play style.
            - >   A customized tutorial that introduces new mechanics, ships and factions. **In Development**
            - >   A story introducing a few of the new and existing factions' characters. **In Development**

     -     New Combat Mechanics and Tactics
            - >   Over Over 50 types of fighters.
            - >   Fighters are smaller, faster, more numerous, and can deal extra damage to ships' weapons and engines.
            - >   Over 130 weapons.
            - >   Smaller weapons, more weapons per ship- designed to mimic a cinematic combat experience inspired from multiple movies and games.
            - >   New ships spread across all hull classes and factions.
            - >   650+ variants.
            - >   New paintjobs for existing ships - sometimes dramatically changing features and load-out options.

     -     New Starting Options and Role-Playing Scenarios
            - >   More starting ship choices and options based around play-styles.
            - >   Start as a pirate, with a reputation throughout the sector and a small raider wolfpack.
            - >   Start as a mercenary, with a powerful financial backer and a small elite strike force.
            - >   Custom tutorial options for each start, teaching new techniques and skills to succeed in that role. **In Development**

     -     An Emphasis on Story-Telling and Immersion
            - >   Rich background for all new factions- who will treat you differently based on their culture, your reputation, and your choices.
            - >   Thematic music, portraits, logos, descriptions, ships and weaponry for each new faction.
            - >   Faction colonies have custom descriptions that give insight into their history and culture.
            - >   New and existing factions are recognizable at a glance - unique faction weapons and custom appearances with stat modifiers give identity to their fleets.
            - >   Engage in small-talk to learn valuable secrets and improve your reputation with others, even your officers. **In Development**
            - >   Exploration, and investigation of hidden secrets leading to powerful allies, lost technology, or even shaping the politics of the sector's major factions. **In Development**
            - >   Bioware-inspired notoriety system. Strike fear into those who've heard of your deeds or be known as the sector's best hope for survival. **In Development**

Tactics Manual

   -    I created this tactics manual to give players a reference point for the multiple changes to the combat layer present in the mod. It should not be required to play, most of the game's descriptions will give an accurate sense of things, but it exists regardless! The tutorial will also explain a lot of things, but until I can get the bugs out of the story encounters there it is disabled.

   -   As a side note, the role playing starts will eventually require the tutorial to be played first, but I will disable that requirement until it is up and running.

Screenshots and Gifs

   -   These should provide a decent showcase of some of the mod's features, but can contain some light spoilers, so viewer discretion is advised.

New Dialogue Options












Performance and System Requirements

   -    More combat calculations and just the extra content/scripts in the mod will inevitably impact performance.

   -    The most noticeable performance difference from unodded Starsector is a longer loading time at start, especially the first time you load the mod.

   -    I've tried to optimize where I can but there is a lot of content. I wanted the dialogue features to be immersive, and that requires a lot of scenarios and dialogue to get it to feel right.

   -    It's hard to measure- I can tell you my test PC has these specs and performs fairly well.

              OS:                     -     Windows 10 Home(64x)
              PROCESSOR:        -     3.40GHz Intel i5
              RAM:                   -     8G
              VIDEO:                -     NVIDIA GeForce GTX 1060 3GB

   -    Please feel free to chime in with what kind of performance you are experiencing, alongside your specs.

   -    I know it is definitely playable on older PC's and laptops from tests, but if I need to make adjustments I can try a few things.

Credits and Thanks

            - Alex
                   - Starsector's creator and my inspiration in game design. For the countless questions and coding help over several years and the emphasis you put towards supporting the modding community, taking player suggestions seriously, and just being a general all around nice guy, a serious heart-felt thank you!

            - xenoargh
                   - Creator of EZFaction and a very active and vocal member of the modding community, thank you for your input, creative suggestions, and all the questions you've answered!

            - LazyWizard, Trylobot, kazi, TJJ, Deathfly, Dark.Revenant, Tartiflette
                   - Probably the majority of the mods that currently exist use your tools and tutorials. A big thanks for your support of the community!
            - Art and Sound Assets
                   - Though the ship edits, logos, title screen and weapons were done personally, factions of this mod would not be possible without the hard work, inspiration and generous free-use permissions granted by the artists who are responsible for the portraits and music.

            - ***Special Note*** As promised under applicable licenses, I will both credit and link to the websites of those artists! Thank you! I have also taken some of these assets from free art/sound websites that do not always specifically credit the author. I have worked hard to verify these sources- however, if for whatever reason you are the owner of an asset used in this mod and either you have not been credited or I do not have your permission to use said asset, please contact me and either I will ensure you are credited or I will remove the asset from the mod. I completely understand the desire for work to have the appropriate credit and I'm not here to profit or steal anyone's stuff. I am just trying to make a fun and unique mod experience the current game doesn't offer!  :D

               **Dev Note** I am not responsible for the content on the linked websites. They may contain mature material that I have no control over. Discretion is advised where necessary.

            - Illustrations
                   Andreas Rocha -

            - Portraits
                   SineAlas -
                   Degenerate Portrait Pack -
                   Thank you to the following portrait pack content creators:
                        - Rusty-Head:
                        - atreg:
                        - albarra:
                        - Interestio:

            - Music
                   Adrian von Ziegler (purchased with receipt available)-
                   PurplePlanet -
                   Ross Budgen (SoundCloud) -

            - Modding Community
                - To all the forum members who have given their advice, opinions, critiques and ideas - whether you even know it or not - you have been a big influence in shaping this mod to what it is now and inspiring me to continue working to bring this project to fruition. To say I stand on the shoulders of giants doesn't even do it justice. Again, a big thank you everyone!

Modding / Script Help: Advanced Scripting with Rules.csv
« on: August 24, 2017, 02:11:38 PM »
Ok, so this script is pretty big so no worries if noone feels like sifting through it, but the gist of it is that the conditions in rules.csv require it to pass or fail. Sometimes, randomly, it seems to return neither true nor false and causes the rules to fail to find a match in the conditions. Not the worst since just rehitting the dialogue option runs the script again where is passes or fails like 90% or more of the time. But weird and annoying lol.

Short end of the story: Where in the script would it "never" return true or false???

Proof of error:

673161 [Thread-4] INFO  com.fs.starfarer.campaign.rules.Rules  - Checking rule: CommodityRequestedBefore
673161 [Thread-4] INFO  com.fs.starfarer.campaign.rules.Rules  - Conditions: $option == Aid_request $entity.Requested_Aid score:1600 CommodityRequestCalc
673161 [Thread-4] INFO  com.fs.starfarer.campaign.rules.Rules  - Failed condition: CommodityRequestCalc
673161 [Thread-4] INFO  com.fs.starfarer.campaign.rules.Rules  - Checking rule: CommodityRequestedBeforeExalted
673161 [Thread-4] INFO  com.fs.starfarer.campaign.rules.Rules  - Conditions: $option == Aid_request $entity.Requested_Aid score:80 RepIsAtWorst $ COOPERATIVE score:1500
673162 [Thread-4] INFO  com.fs.starfarer.campaign.rules.Rules  - Failed condition: RepIsAtWorst $ COOPERATIVE score:1500
673162 [Thread-4] INFO  com.fs.starfarer.campaign.rules.Rules  - Checking rule: CommodityRequestedBeforeandAngry
673162 [Thread-4] INFO  com.fs.starfarer.campaign.rules.Rules  - Conditions: $option == Aid_request $entity.Requested_Aid score:1600 !CommodityRequestCalc
673162 [Thread-4] INFO  com.fs.starfarer.campaign.rules.Rules  - Failed condition: !CommodityRequestCalc


and the script...  :P


package archeus.rulecmd;

import java.util.List;
import java.util.Map;

import com.fs.starfarer.api.Global;
import com.fs.starfarer.api.characters.PersonAPI;
import com.fs.starfarer.api.characters.PersonalityAPI;
import com.fs.starfarer.api.characters.RelationshipAPI;
import com.fs.starfarer.api.campaign.InteractionDialogAPI;
import com.fs.starfarer.api.campaign.CampaignFleetAPI;
import com.fs.starfarer.api.campaign.rules.MemKeys;
import com.fs.starfarer.api.campaign.rules.MemoryAPI;
import com.fs.starfarer.api.campaign.FactionAPI;
import com.fs.starfarer.api.campaign.RepLevel;
import com.fs.starfarer.api.util.Misc.Token;
import com.fs.starfarer.api.impl.campaign.rulecmd.BaseCommandPlugin;
 *   Commodity Request Calculation
 *    by Morrokain
public class CommodityRequestCalc extends BaseCommandPlugin {
   public boolean execute(String ruleId, InteractionDialogAPI dialog, List<Token> params, Map<String, MemoryAPI> memoryMap) {
      if (dialog == null) return false;

        int BaseFireChance = 40;          // base chance of success before other factors calculated in

        CampaignFleetAPI playerFleet;
        CampaignFleetAPI otherFleet;

        FactionAPI faction;
        FactionAPI playerFaction;

        playerFleet = Global.getSector().getPlayerFleet();
        otherFleet = (CampaignFleetAPI) (dialog.getInteractionTarget());
        faction = otherFleet.getFaction();
        playerFaction = playerFleet.getFaction();

        PersonAPI commander = otherFleet.getCommander(); // get commander of fleet

        RepLevel level = faction.getRelationshipLevel(playerFaction);
                                                         // get rep level relative to player

        if (level.isAtWorst(RepLevel.INHOSPITABLE));     // no chance once hostile of course.
            int fireChance = BaseFireChance + (int) (Math.random() * 101);
                                                         // generates random number and adds to fireChance

            int fleetStrength = (int) otherFleet.getFleetPoints();
            int playerStrength = (int) Global.getSector().getPlayerFleet().getFleetPoints();
            double relativeStrength = 0;                 // gets relative size of fleet to player

            int repWeight = 1;                              // will impact the effect of fleet strength calc below

            if (level.isAtWorst(RepLevel.COOPERATIVE)) {    // rep impacts chance of success and weight of strength calc
                fireChance += 100;
                repWeight = 8;

            if (level.isAtWorst(RepLevel.FRIENDLY)){
                fireChance += 30;
                repWeight = 6;

            if (level.isAtWorst(RepLevel.WELCOMING)){
                fireChance += 30;
                repWeight = 4;

            if (level.isAtWorst(RepLevel.FAVORABLE)){
                fireChance += 15;
                repWeight = 3;

            if (level.isAtBest(RepLevel.NEUTRAL)){
                fireChance += 5;
                repWeight = 2;

            if (level.isAtBest(RepLevel.SUSPICIOUS))
                fireChance -= 20;

            if (level.isAtBest(RepLevel.INHOSPITABLE))
                fireChance -= 40;

            if (faction.getId().equals("scicorps")) {       // faction also has an effect
                fireChance += 30;                      // different factions have different base percentages
                repWeight += 2;                        // to aid player

            if (faction.getId().equals("hegemony"))  {      // fleet strength has a slightly lower impact on success rate
                fireChance += 15;                      // for some factions like hegemony and independent due to good nature
                repWeight += 1;

            if (faction.getId().equals("independent")) {
                fireChance += 5;
                repWeight += 1;

            if (faction.getId().equals("luddic_church")) {   // similar to hegemony in generosity.
                fireChance += 15;
                repWeight += 1;

            if (faction.getId().equals("luddic_path"))
                float credits = Global.getSector().getPlayerFleet().getCargo().getCredits().get();
                float aidCost = (int) Global.getSector().getPlayerFleet().getFleetPoints() * 500;

                memoryMap.get(MemKeys.LOCAL).set("$AidRequest_estCost", aidCost, 1);

                boolean canAfford;

                if (credits >= aidCost)
                    canAfford = true;
                    fireChance += 10;                   // if player can afford the estimated costs of resupply,
                }                                       // much higher chance of success for greedier factions
                    canAfford = false;
                    fireChance -= 25;
                memoryMap.get(MemKeys.LOCAL).set("$CanAfford_estCost", canAfford, 1);

            if (faction.getId().equals("archean_order"))
                float credits = Global.getSector().getPlayerFleet().getCargo().getCredits().get();
                float aidCost = (int) Global.getSector().getPlayerFleet().getFleetPoints() * 500;

                memoryMap.get(MemKeys.LOCAL).set("$AidRequest_estCost", aidCost, 1);

                boolean canAfford;

                if (credits >= aidCost)
                    canAfford = true;
                    fireChance += 20;                   // if player can afford the estimated costs of resupply,
                }                                       // much higher chance of success for greedier factions
                    canAfford = false;
                    fireChance -= 15;
                memoryMap.get(MemKeys.LOCAL).set("$CanAfford_estCost", canAfford, 1);

            if (faction.getId().equals("adamantine_consortium")) // in general consortium doesn't give much aid
                float credits = Global.getSector().getPlayerFleet().getCargo().getCredits().get();
                float aidCost = (int) Global.getSector().getPlayerFleet().getFleetPoints() * 500;

                memoryMap.get(MemKeys.LOCAL).set("$AidRequest_estCost", aidCost, 1);

                boolean canAfford;

                if (credits >= aidCost)
                    canAfford = true;
                    fireChance -= 5;                   // if player can afford the estimated costs of resupply,
                }                                       // much higher chance of success for greedier factions
                    canAfford = false;
                    fireChance -= 35;
                memoryMap.get(MemKeys.LOCAL).set("$CanAfford_estCost", canAfford, 1);

            if (faction.getId().equals("trader_guilds"))
                float credits = Global.getSector().getPlayerFleet().getCargo().getCredits().get();
                float aidCost = (int) Global.getSector().getPlayerFleet().getFleetPoints() * 400;

                memoryMap.get(MemKeys.LOCAL).set("$AidRequest_estCost", aidCost, 1);

                boolean canAfford;

                if (credits >= aidCost)
                    canAfford = true;
                    fireChance += 10;
                    canAfford = false;
                    fireChance -= 15;
                memoryMap.get(MemKeys.LOCAL).set("$CanAfford_estCost", canAfford, 1);

            if (faction.getId().equals("pirates"))
                float credits = Global.getSector().getPlayerFleet().getCargo().getCredits().get();
                float aidCost = (int) Global.getSector().getPlayerFleet().getFleetPoints() * 500;

                memoryMap.get(MemKeys.LOCAL).set("$AidRequest_estCost", aidCost, 1);

                boolean canAfford;

                if (credits >= aidCost)
                    canAfford = true;
                    fireChance += 10;                   // if player can afford the estimated costs of resupply,
                }                                       // much higher chance of success for greedier factions
                    canAfford = false;
                    fireChance -= 25;
                memoryMap.get(MemKeys.LOCAL).set("$CanAfford_estCost", canAfford, 1);

            PersonalityAPI personality = commander.getPersonalityAPI();

            if (personality.toString().equals("reckless")) {
                fireChance -= 15;
                repWeight -= 2;

            if (personality.toString().equals("aggressive")) {
                fireChance -= 10;
                repWeight -= 1;

            if (personality.toString().equals("cautious")) {
                fireChance -= 10;
                repWeight += 1;

            if (personality.toString().equals("timid")) {
                fireChance += 20;
                repWeight += 2;

            RelationshipAPI relationship = commander.getRelToPlayer();
            // finally, commander's personality and opinion of player matters

            if (relationship.isAtWorst(RepLevel.FRIENDLY)) {
                fireChance += 45;
                repWeight += 2;

            if (relationship.isAtWorst(RepLevel.WELCOMING)) {
                fireChance += 25;
                repWeight += 1;

            if (relationship.isAtWorst(RepLevel.FAVORABLE)) {
                fireChance += 15;
                repWeight += 1;

            if (relationship.isAtBest(RepLevel.SUSPICIOUS))
                fireChance -= (int) (fireChance * 0.2);

            if (relationship.isAtBest(RepLevel.INHOSPITABLE))
                fireChance -= (int) (fireChance * 0.5);

            if (relationship.isAtBest(RepLevel.HOSTILE))
                if (!level.isAtWorst(RepLevel.COOPERATIVE))
                    fireChance = 0;                         // unless highest rep, will fail if commander is hostile
                }                                           // even then, reduces by 50% like inhospitable rep

            if (repWeight <= 0)                             // safeguard for strength calc
                repWeight = 1;

            //** Note on Fleet Strength calculations: with neutral or lower rep, fleet strength is one of the primary
            // factors and those players without at least close to equal strength will be hard pressed to find any aid from
            // most factions. **

            if (fleetStrength > playerStrength) {       // less likely as other fleet gets stronger
                relativeStrength = (((playerStrength * 100) / fleetStrength)) * 0.01; // but higher rep reduces impact
                fireChance -= (int) ((fireChance - (fireChance * relativeStrength)) / repWeight); // of this calculation

            if (fleetStrength <= playerStrength) {      // more likely as the other fleet gets weaker
                relativeStrength = (((fleetStrength * 100) / playerStrength)) * 0.01;
                fireChance += (int) ((fireChance * (1 - relativeStrength)));
            }                                         // modifies final chance to fire by percentage of strength difference

            memoryMap.get(MemKeys.LOCAL).set("$AidRequest_fireChance", fireChance, 1);
            memoryMap.get(MemKeys.LOCAL).set("$FleetStrength_repWeight", repWeight, 1);

            if (fireChance >= 100)
                return true;                    // request granted if fireChance over 100 (successful roll)
      return false;

And some screens of the script (and some others) for funsies  ;D



Pages: [1] 2 3 4