Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.9.1a is out! (05/10/19); Blog post: Raiding for Fun and Profit (11/27/19)

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.

Messages - Morrokain

Pages: 1 ... 40 41 [42] 43 44 ... 62
616
Modding / Re: [0.8][UTILITY] EZ Faction 0.3a
« on: August 31, 2017, 08:16:23 PM »
Food shortages are pretty unlikely; one of the deliberate features of the economic-tweaking was to make most EZ Faction planets fairly self-sufficient for now.

Customs inspections should work.  I haven't ever seen a stranded fleet, though.

Good to know. I won't customize any of that dialogue, then.

You saved me quite a bit of effort, so thank you!

617
Modding / Re: [0.8][UTILITY] EZ Faction 0.3a
« on: August 31, 2017, 01:28:21 PM »
OK, after some tweaks... I've gotten:

1.  Bounties to show up for all the Factions EZ Faction generates.

2.  Addressed all of the weirdness with the Comm Relays not quite working right.

3.  The game will generate enough hireable Captains that EZ Faction locations aren't continually empty.

I'll have a new build out as soon as I've built the code to add the new requested features.

Nice, looking forward to that!

Any chance on getting those earlier questions answered? Sorry if they are dumb... I truly have not had the time to play-test and find out what events get called by EZ factions, the only ones I know do for sure are the transponder being off and suspected smuggling pursuits and scans from play-testing some features I've developed. I haven't run into food shortages, custom inspections or stranded fleets yet.

618
Modding / Re: [0.8][UTILITY] EZ Faction 0.3a
« on: August 28, 2017, 12:54:01 PM »
You have the latest build of EZ Faction installed, yes?

I know that they get Comm Stations and Missions, at least over here.

As for Bounties, I'm not sure about the mechanisms involved; I'll look into that.

Question similar to this so I know how much custom dialogue to put into rules.csv:

1) Do EZ Faction fleets answer player distress calls or take part in the distress call event where they have a fleet stranded?

2) Do EZ Factions perform custom inspections and investigator bribe events at the market?

3) Same for food shortages / causing markets to become unstable - mainly again for unstable market dialogue in rules.

I don't want to spend the time writing all this dialogue if it isn't being used haha.

619
Blog Posts / Re: A True and Accurate History of the Persean Sector
« on: August 25, 2017, 11:43:29 AM »
I absolutely love lore posts!!  ;D

Some good framework here!

So, Artemisia Sun is still alive, then, and leader of TriTachyon?

Also, I know Daud is Space Marshal, but who is the current High Hegemon?


Various means of extending lifespans are indeed possible in the Sector- for the rich and well-connected, at least.


Ah good I am glad this was brought up!

One of my factions requires this kind of tech being present in the lore.. and some heavy gene manipulation to boot.

620
Modding / Re: Script Help: Advanced Scripting with Rules.csv
« on: August 24, 2017, 04:22:56 PM »

Also, why does the random number added to fireChance make the rule sometimes not return anything? I would have thought simply having two paths based on one variable where an end equals a true return and the other end equals a false return would be enough. (This is more for my own curiosity and for me to better understand the engine/java)

What happens is it returns true for one rule and false for another, because of the random component. It's not that it returns nothing - that's not possible - but what it returns is inconsistent from call to call.


Yeah lol just picked up on what you meant, one of those tricky areas I really did not anticipate at first. Makes total sense once you think about it, though. Why would all rules "check" at once??  :P


621
Modding / Re: Script Help: Advanced Scripting with Rules.csv
« on: August 24, 2017, 03:12:00 PM »
fireChance has a random component :)

If you want the check to only be run once, put the result of it in memory in CommodityRequestCalc, and then only call that once, and not as a condition, but rather in the body of another rule before this stuff fires.


Ok I think I gotcha, so just like the cost of the aid request, the calc script would put a boolean into memory that would be set as true if fireChance is over 100 and false otherwise. Then the calc script could be run, say at the initial dialogue (in the scripts column, not the conditions) that would set the variable (and give you the description flavor), then the condition in the following line of rules simply check for the memory variable.

That sum up what you mean?

edit:
Also, why does the random number added to fireChance make the rule sometimes not return anything? I would have thought simply having two paths based on one variable where an end equals a true return and the other end equals a false return would be enough. (This is more for my own curiosity and for me to better understand the engine/java)

Nvm I get it now! Just clicked!  ::)

In case people are following this, so its running the script each rule entry, (duh, cant believe I didn't see that flaw).

So actually, though it would appear that the script would return "one" true or false, its actually running the calc script each time a new rule is checked, so it can, sometimes, return the script as false in the rule that checks for true, but still have the condition that checks for false ALSO return a true, by pure chance, when the script is run AGAIN, causing that rule to fail too, so rules can't find a match. Thats why it only "fails" to return a true or false rarely, because multiple chance calculations have to align... haha  :D

Putting the script in a precursor rule makes it only run once, therefore, the true or false return stays "constant" across all the followup rule checks in rules.csv

(This is looking very cool, btw!)

Wow thanks that's high praise coming from you!

Have more in the development list that I'm excited about too! How big can rules be, btw? The commodity request rules configurations has.. about 100 entries so far, or with dialogue options around 300 different potential outputs and 100 condition configurations. It doesn't seem to slow anything down that I can tell, but I'm curious as to its limitations.

I'm thinking once I start scripting in story stuff, that will begin to get a lot higher. School is starting next week though so time is going to get more limited.

I also want to say I love how rules.csv works! I was intimidated at first, but it really makes things a lot easier once you get it down!

622
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:


Spoiler
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 $faction.id COOPERATIVE score:1500
673162 [Thread-4] INFO  com.fs.starfarer.campaign.rules.Rules  - Failed condition: RepIsAtWorst $faction.id 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

[close]


and the script...  :P

Spoiler

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 {
    @Override
   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
                else
                {
                    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
                else
                {
                    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
                else
                {
                    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;
                }
                else
                {
                    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
                else
                {
                    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;
   }
}
[close]

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

Spoiler


















[close]


623
So maybe this is the EZ faction utility mod at work here, but I thought there were many levels of reputation per faction in the campaign?

I'm only seeing it jump from: NEUTRAL(-10-30?) FRIENDLY(30-69) COOPERATIVE(70-100) during a script test?

Has it changed from how it was before with things like FAVORABLE, WELCOMING etc?

I ask because scripts and descriptions based on those aren't showing up from what I can see  :-\

Edit: Nvm, ugh I'm silly.   :P

For some reason I thought the number scale for rep worked differently, but after further testing its just that the levels above friendly are below 50 and the ranges I was looking at was greater than 50 at the time  :-[

624
Modding / Not recognizing compiled script: IntelliJ (solved)
« on: August 03, 2017, 10:09:49 PM »
Alright, so wrote a script to return true or false based upon the player's replevel with the interaction target and a randomly generated 'fireChance'

The idea here is that the event more or less often based on the players rep level.

Anywhoo, compiling my first script with IntelliJ and everything seems to check out and compile without any errors but I get an error message about rules saying it can't find the custom script when I try and actually run the game.

Code:
Spoiler
package archeus.rulecmd;

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

import com.fs.starfarer.api.Global;
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;
/**
 *   Consortium Tribute Calculation
 *    by Morrokain
 */
public class ConsortiumTributeCalc extends BaseCommandPlugin {
    @Override
   public boolean execute(String ruleId, InteractionDialogAPI dialog, List<Token> params, Map<String, MemoryAPI> memoryMap) {
      if (dialog == null) return false;
      
      float credits = Global.getSector().getPlayerFleet().getCargo().getCredits().get();
      float tribute = (int) Global.getSector().getPlayerFleet().getFleetPoints() * 200;
      
      memoryMap.get(MemKeys.LOCAL).set("$Consortium_tribute", (int)tribute, 0);

        int BaseFireChance = 50;          // base chance of success before rep cal


        CampaignFleetAPI playerFleet;
        CampaignFleetAPI otherFleet;

        FactionAPI faction;
        FactionAPI playerFaction;

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

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

        if (level.isAtWorst(RepLevel.INHOSPITABLE)); // no chance once hostile.
        {
            int fireChance = BaseFireChance + (int) (Math.random() * 101);
                                                        // generates random number and adds to fireChance
            if (level.isAtWorst(RepLevel.COOPERATIVE))   // rep adds or subtracts fireChance
                fireChance -= 100;

            if (level.isAtWorst(RepLevel.WELCOMING))
                fireChance -= 20;

            if (level.isAtWorst(RepLevel.FAVORABLE))
                fireChance -= 15;

            if (level.isAtWorst(RepLevel.FRIENDLY))
                fireChance -= 10;

            if (level.isAtWorst(RepLevel.NEUTRAL))
                fireChance += 5;

            if (level.isAtWorst(RepLevel.SUSPICIOUS))
                fireChance += 20;

            if (level.isAtWorst(RepLevel.INHOSPITABLE))
                fireChance += 30;

            memoryMap.get(MemKeys.LOCAL).set("$Tribute_fireChance", fireChance, 0);

            if (fireChance >= 100 && credits >= tribute)  // only fire if enough player credits for tribute request
                return true;                              // and if fireChance over 100 (successful roll)
            }

      return false;
   }

}

[close]

settings entry:

Spoiler
   "ruleCommandPackages":[
          "archeus.rulecmd"
   ],
[close]

Error Message:
Spoiler
5450 [Thread-4] INFO  com.fs.starfarer.campaign.rules.Rules  - Loading rule: greetingArcheanTOffNormal
5450 [Thread-4] INFO  com.fs.starfarer.campaign.rules.Rules  - Loading rule: greetingArcheanTOffWeaker
5450 [Thread-4] INFO  com.fs.starfarer.campaign.rules.Rules  - Loading rule: greetingArcheanFriendly
5450 [Thread-4] INFO  com.fs.starfarer.campaign.rules.Rules  - Loading rule: greetingArcheanHostileWeaker
5450 [Thread-4] INFO  com.fs.starfarer.campaign.rules.Rules  - Loading rule: greetingArcheanHostileWeakerDefiant
5450 [Thread-4] INFO  com.fs.starfarer.campaign.rules.Rules  - Loading rule: greetingArcheanHostileStronger
5450 [Thread-4] INFO  com.fs.starfarer.campaign.rules.Rules  - Loading rule: greetingArcheanNeutral
5451 [Thread-4] INFO  com.fs.starfarer.campaign.rules.Rules  - Loading rule: greetingAdamantineFriendly
5451 [Thread-4] INFO  com.fs.starfarer.campaign.rules.Rules  - Loading rule: greetingAdamantineHostileWeaker
5451 [Thread-4] INFO  com.fs.starfarer.campaign.rules.Rules  - Loading rule: greetingAdamantineHostileWeakerDefiant
5451 [Thread-4] INFO  com.fs.starfarer.campaign.rules.Rules  - Loading rule: greetingAdamantineHostileStronger
5451 [Thread-4] INFO  com.fs.starfarer.campaign.rules.Rules  - Loading rule: greetingAdamantineNeutral
5451 [Thread-4] INFO  com.fs.starfarer.campaign.rules.Rules  - Loading rule: ConsortiumTributeCheck
5451 [Thread-4] INFO  com.fs.starfarer.loading.scripts.OoOO  - Loading class: com.fs.starfarer.api.impl.campaign.rulecmd.ConsortiumTributeCalc
5451 [Thread-4] INFO  com.fs.starfarer.loading.scripts.OoOO  - Loading class: com.fs.starfarer.api.impl.campaign.rulecmd.salvage.ConsortiumTributeCalc
5451 [Thread-4] INFO  com.fs.starfarer.loading.scripts.OoOO  - Loading class: com.fs.starfarer.api.impl.campaign.rulecmd.newgame.ConsortiumTributeCalc
5451 [Thread-4] INFO  com.fs.starfarer.loading.scripts.OoOO  - Loading class: archeus.rulecmd.ConsortiumTributeCalc
5725 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - com.fs.starfarer.api.util.RuleException: java.lang.RuntimeException: Command [ConsortiumTributeCalc] not found in packages:
com.fs.starfarer.api.impl.campaign.rulecmd
com.fs.starfarer.api.impl.campaign.rulecmd.salvage
com.fs.starfarer.api.impl.campaign.rulecmd.newgame
archeus.rulecmd

com.fs.starfarer.api.util.RuleException: java.lang.RuntimeException: Command [ConsortiumTributeCalc] not found in packages:
com.fs.starfarer.api.impl.campaign.rulecmd
com.fs.starfarer.api.impl.campaign.rulecmd.salvage
com.fs.starfarer.api.impl.campaign.rulecmd.newgame
archeus.rulecmd

   at com.fs.starfarer.campaign.rules.A.<init>(Unknown Source)
   at com.fs.starfarer.campaign.rules.Rules.o00000(Unknown Source)
   at com.fs.starfarer.loading.SpecStore.OO0000(Unknown Source)
   at com.fs.starfarer.loading.ResourceLoaderState.init(Unknown Source)
   at com.fs.state.AppDriver.begin(Unknown Source)
   at com.fs.starfarer.combat.CombatMain.main(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.RuntimeException: Command [ConsortiumTributeCalc] not found in packages:
com.fs.starfarer.api.impl.campaign.rulecmd
com.fs.starfarer.api.impl.campaign.rulecmd.salvage
com.fs.starfarer.api.impl.campaign.rulecmd.newgame
archeus.rulecmd

   at com.fs.starfarer.campaign.rules.A.getCommandClass(Unknown Source)
   ... 8 more

Process finished with exit code 1
[close]

Anyone dealt with this?

I'm fairly confident I set up the artifact correctly in the compiler, and in the 'compiled output' folder after the project builds the script shows up as a class file, so its recognized there.

Not really sure where to go from here.  ???


Edit: Solved. The dumb thing (intelliJ) renamed the jar to the project name for some reason so I just needed to update the entry in the mod_info file with the correct jar name since I can't get it to call the jar anything else for some reason.  >:(

625
Modding / Re: hullmod help
« on: July 23, 2017, 10:53:46 PM »
As far as I can tell, that particular hullmod is scripted internally in the games api, so you can't copy and edit the hullmod file like some others without creating your own script for it and compiling it into a jar, which is quite a bit of research and effort.

Well worth it if you want to get into modding starsector though.

What that file does is give a description and set a few attributes like op cost. I was going to do the same thing to reduce the cost of small mounts on capitals, but it can't even be used for that. (at least i couldn't get it to work)

Can't remember off the top of my head, but I don't even think the api supports a reference to fighter wings op cost yet, and so you cannot do things like effect their cost per ship. You also can't make specific wings -like only a hi tech bomber for instant- modified in any way either or restrict them by hull.

I can tell you that some of this support has been requested though.

626
Wanted to update this tutorial slightly-

When setting up the Run configuration options two points of the original post are now incorrect. See post here: http://fractalsoftworks.com/forum/index.php?topic=12833.msg217359#msg217359


But to summarize:

1. Under 'script' in the configuration options simply type out starsector.bat
 - do not click "..." as this will put the full file path and that will cause an error when you try to build and run the game

2. For 'working directory' make sure you indicate the starsector-core directory, not the starsector directory.

627
That did it! Working! Thanks a lot!  ;D

I'll also post in the tutorial so others can know to do this. The tutorial says to put the file path in 'script' section.

628
I have no idea about the details of what you're doing here :)

Just trying to get the mod hooked up to IntelliJ IDEA as a project and compile my eventual scripts to a jar so I can begin advanced work with the tutorial in rules.csv

Right now said scripts do not exist, its just a blank mod plugin for a unique id and a mod_info JSON file.

But! This thing:

C:\Program Files (x86)\Fractal Softworks\Starsector>..\jre\bin\java.exe

Is just not going to work because the jre/ folder is inside the Starsector/ folder, not one level above it.

Ok gotcha. So, the default file structure of starsector/jre somehow got messed up when trying to run the executable? How do I tell it to look in the right place? All I seem to have under configuration options for run is 'working directory', which is set to fractalsoftworks/starsector and 'script', which is set to starsector-core/starsector.bat

Or am I just not understanding what you are saying?    :-[ Sorry if so

629
The .bat file needs to run from inside the folder it's in, as the path it contains - to the java executable - is relative.

..\jre\bin\java.exe


Hm, ok. I haven't moved the file or anything and it should have the same file structure it always has. The built executable jar for the mod is in the base mod directory, are you saying I should move this to match the java.exe structure?


I'm, frankly, winging this based off the basic Mayorate mod plugin after removing all the additional scripts and going off this tutorial: http://fractalsoftworks.com/forum/index.php?topic=10057.0

So, yeah, something could easily have gone wrong as this is a first attempt. But, now when I run the game it doesn't even recognize my mod. lol

630
No, fair question, this is confusing :)

Basically, what I'm saying is, if you want your own text-substitution things - e.g. $LordOrLady etc - there are two ways to go there:

1) Provide your own implementation of RuleTokenReplacementGeneratorPlugin, and add it to the Rules via Global.getSector().getRules().addTokenReplacementGenerator() - which you will have to do on every game load, since that's not persistent, or

2) Put them into the local memory, with expiration time 0, using one of the updateXXXFactions methods in your own implementation of CampaignPlugin (see: CoreCampaignPluginImpl for reference of how to do it). You only have to register this plugin once and then it goes in the savefile. (See: SectorGen.java, sector.registerPlugin(new CoreCampaignPluginImpl()); )

What I'm saying is the two are more or less equivalent (at least, I can't think of a way why #1 would be superior) for text replacement, and the second way also allows those values to be used in rule conditions etc, plus it's just one less place to keep track of. So my suggestion would be to use the 2nd way. But, whichever one works for you.

Ohh completely understand what you mean, now! Yeah the second way does make more sense to me :) , especially if it opens up use in rule conditions and less load (even if relatively unnoticeable).

On a side note from an earlier response, nice to know I can safely use existing tokens, too.

Thanks for all the help, as always!

Pages: 1 ... 40 41 [42] 43 44 ... 62