Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 469 470 [471] 472 473 ... 710

Author Topic: Misc modding questions that are too minor to warrant their own thread  (Read 1719119 times)

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24112
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7050 on: February 08, 2021, 05:02:06 PM »

I think this should work, the mission is called "modules vs no modules"

Thank you! Gave this a try, and, hmm - I'm seeing the Meduas-with-modules win (though it looks very even/symmetrical). So it's likely that whatever issue you're seeing now is fixed for the next release, which, good news.


Putting it under LOCAL doesn't help either... I'll try all the data flags.

Try changing the variable names. IIRC there are some cases where it could be finicky if one variable starts with the same exact string that's the name of another variable. Not sure this is actually a problem here, but it'd be good to rule that out just in case.
Logged

NikoTheGuyDude

  • Commander
  • ***
  • Posts: 231
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7051 on: February 08, 2021, 05:07:10 PM »

I think this should work, the mission is called "modules vs no modules"

Thank you! Gave this a try, and, hmm - I'm seeing the Meduas-with-modules win (though it looks very even/symmetrical). So it's likely that whatever issue you're seeing now is fixed for the next release, which, good news.


Putting it under LOCAL doesn't help either... I'll try all the data flags.

Try changing the variable names. IIRC there are some cases where it could be finicky if one variable starts with the same exact string that's the name of another variable. Not sure this is actually a problem here, but it'd be good to rule that out just in case.

...I added a line of code that logged it... and... it works now. It just gets added to the log. That's all that I did.

Added public static Logger log = Global.getLogger(SDE_determineStealableCommodities.class); above execute in the value/variable storage section (what do people call the place you store your class variables?), and log.info("deficit is " + demandDeficit); to
Spoiler
if (command.equals("marketExploitableByInsider")) {
            if (marketStab <= 5) //placeholder value for debugging {
                log.info("deficit is " + demandDeficit);
                memoryMap.get(MemKeys.MARKET).set("$SDE_demandDeficit", demandDeficit, 0);
                memoryMap.get(MemKeys.MARKET).set("$SDE_commoditySurplus", commoditySurplus, 0);
                memoryMap.get(MemKeys.MARKET).set("$SDE_demandDataValue", demandDataValue, 0);
            return true;
            }
[close]


it doesnt even look like it logs it when i look in the log
« Last Edit: February 08, 2021, 05:09:18 PM by NikoTheGuyDude »
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7052 on: February 08, 2021, 05:11:57 PM »

What does your rules look like? I'd need more info to give more suggestions. Maybe a screenshot of the memdump too.

For me, this works:

Code
tokenChanceValue = memoryMap.get(MemKeys.FACTION).getFloat(TOKEN_BRIBE_VALUE_MEMKEY);

Where TOKEN_BRIBE_VALUE_MEMKEY = "$c:tokenBribeChance_ChangeByValue" (Which is populated by:"tokenBribeChance_ChangeByValue":10.0, - in the custom section of the faction file.)

And, this works as a condition in rules:

$AidRequest_fireChance <= 150

Which is populated through:

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

 - In CommodityRequestCalc - which is a script called in the rule prior to the one that has the condition check. fireChance is an int that is defined and manipulated in the script.
Logged

NikoTheGuyDude

  • Commander
  • ***
  • Posts: 231
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7053 on: February 08, 2021, 05:20:54 PM »

Oh my GOD I feel like such an idiot, I REVERSED MY MORE OR EQUAL TO OPERATOR WHICH WAS BREAKING IT AAAAAAAAAAAAGH!!!!!!!
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7054 on: February 08, 2021, 05:25:44 PM »

Nice! Glad you got it working. :)

(And no worries I do that kind of thing all the time, hehe.)
Logged

shoi

  • Admiral
  • *****
  • Posts: 658
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7055 on: February 08, 2021, 10:05:56 PM »

I think this should work, the mission is called "modules vs no modules"

Thank you! Gave this a try, and, hmm - I'm seeing the Meduas-with-modules win (though it looks very even/symmetrical). So it's likely that whatever issue you're seeing now is fixed for the next release, which, good news.


Thats good to hear! Thank you for checking for me  :)
Logged

NikoTheGuyDude

  • Commander
  • ***
  • Posts: 231
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7056 on: February 09, 2021, 06:48:51 AM »

Does anyone know of a good way to get the current level of pirate activity affecting a market/the status of luddic path cells, specifically, if they're active/inactive/disrupted?

I'm trying this
Spoiler
PirateBaseIntel originTierPirate = new PirateBaseIntel(system, factionId, tier);
        String getPirateBaseTier = String.valueOf(originTierPirate.getTier());
[close]
but I don't know if it will work.

I could also use some help on checking to see if a market's specific industry is disrupted or not, or better yet, checking to see if any markets with a specific *tag* (specifically HEAVY_INDUSTRY) are disrupted.
« Last Edit: February 09, 2021, 10:11:40 AM by NikoTheGuyDude »
Logged

Stealth

  • Ensign
  • *
  • Posts: 47
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7057 on: February 09, 2021, 11:39:57 AM »

Is there an up to date guide for making Factions? I only found this one from 2012.
Logged
"it is what it is"  ~me every 30 seconds

SafariJohn

  • Admiral
  • *****
  • Posts: 3021
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7058 on: February 10, 2021, 07:51:22 AM »

Does anyone know of a good way to get the current level of pirate activity affecting a market/the status of luddic path cells, specifically, if they're active/inactive/disrupted?

Loop over the market's conditions and use the conditions' plugins to find the info you need.

Code: java
// First get the levels of activity
PirateBaseIntel.PirateBaseTier pirateTier = null; // use the enum, there's no reason to get it as a string
String pathActivity = ""; // using the name of the condition because there is nothing else

for (MarketConditionAPI cond : market.getConditions()) {
    if (cond.getPlugin() instanceof PirateActivity) {
        PirateActivity plugin = (PirateActivity) cond.getPlugin();

        pirateTier = plugin.getIntel().getTier();
    }

    if (cond.getPlugin() instanceof LuddicPathCells) {
        LuddicPathCells plugin = (LuddicPathCells) cond.getPlugin();

        pathActivity = plugin.getName();
    }
}


// Handle pirate activity
if (pirateTier != null) {
    // switch on tier and do your stuff, or use several if cases
} else {
    // if it is still null, then there is no pirate activity
}


// Handle Path cells - I got the names from LuddicPathCellsIntel, which is where the LuddicPathCells plugin gets them
if (pathActivity.isEmpty()) {} // no path activity
if (pathActivity.equals("Luddic Path Cells - Sleeper")) {}
if (pathActivity.equals("Luddic Path Cells - Active")) {}
if (pathActivity.equals("Luddic Path Cells - Disrupted")) {}
Logged

bananana

  • Commander
  • ***
  • Posts: 228
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7059 on: February 12, 2021, 04:58:45 PM »

i think there's some weirdness going on with mirv configs
or, more likely, i'm just dumb

there's these parameters
spreadSpeed, which controls at which velocitysubmunitions are launched
projectileRange, which controls how far submunitions will travel if they are not missile-type projectiles
and the spreadSpeedRange, which is a complete blackbox mystery to me so far. by the name i'd guess it should introduce randomness into submunition launch velocity, which it does. but it also throws spread range completely off the rocker, and i can't seem to figure out in which way.
people on discord say that maybe it just fails to recalculate projectile life time.

so, can i get a clarification on how exactly is it supposed to work, and how much of it is intended behavior?
Logged
Any and ALL sprites i ever posted on this forum are FREE to use. even if i'm using them myself. Don't ever, EVER ask for permission, or i will come to your home and EAT YOUR DOG!!!
i do NOT want to see my name appear in the credits section of any published mod and will consider it a personal insult.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24112
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7060 on: February 12, 2021, 06:50:21 PM »

There were some bugs with it; I forget the details. Search the patch notes for "spreadSpeedRange" - it'll have some info but probably not enough to make it make complete sense. The good news is it should all work properly in the next release.

And, yes, in theory the speed of the projectile is:
spreadSpeed + (random number between 0 and 1) * spreadSpeedRange

("Range" in the mathematical sense of "distance from this number to that number", not like weapon range etc.)
Logged

bananana

  • Commander
  • ***
  • Posts: 228
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7061 on: February 12, 2021, 06:54:30 PM »

There were some bugs with it; I forget the details. Search the patch notes for "spreadSpeedRange" - it'll have some info but probably not enough to make it make complete sense. The good news is it should all work properly in the next release.
ahhh
thanks for clarification
should've looked in patchnotes first tbh
Logged
Any and ALL sprites i ever posted on this forum are FREE to use. even if i'm using them myself. Don't ever, EVER ask for permission, or i will come to your home and EAT YOUR DOG!!!
i do NOT want to see my name appear in the credits section of any published mod and will consider it a personal insult.

bananana

  • Commander
  • ***
  • Posts: 228
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7062 on: February 12, 2021, 07:16:19 PM »

speaking of missiles
Quote
Fixed issue causing ships with only missile weapons to close in to point-blank range regardless of weapon range
is there a way to induce this kind of behavior deliberately, in non-missile weapons? or will there be in the next version, since this is being fixed?
as in, make AI, both using and opposing said weapon, to ignore it's range when approaching or kiting an enemy
for the purpose of making LRM-equivalent weapons in other than missile slots
Logged
Any and ALL sprites i ever posted on this forum are FREE to use. even if i'm using them myself. Don't ever, EVER ask for permission, or i will come to your home and EAT YOUR DOG!!!
i do NOT want to see my name appear in the credits section of any published mod and will consider it a personal insult.

Stealth

  • Ensign
  • *
  • Posts: 47
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7063 on: February 17, 2021, 02:17:29 PM »

Sorry that im asking again, but...
is there an up to date guide for making Factions and Systems?
I am not good at coding or reverse-engineering lol
Logged
"it is what it is"  ~me every 30 seconds

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7064 on: February 17, 2021, 03:16:22 PM »

Sorry that im asking again, but...
is there an up to date guide for making Factions and Systems?
I am not good at coding or reverse-engineering lol

For a star system, yes - see this thread. It has a lot of important modding info on how to set up any mod as well. Basic things like the mod plugin, how to generate your system, etc.

For a faction itself? I don't believe so. For a brief summary you will need:

1) Faction file with your faction ID and the factions' details. These files are found under data/world/factions. Your faction ID must also be added to the factions.csv spreadsheet in your mod which will merge with vanilla's spreadsheet.

2) If you aren't adding markets with code, you can use the economy JSON files and either merge with existing systems (not recommended for mod compatibility afaik) or once you create your own you can designate a JSON file with your custom market info and give it resources, industries, conditions, etc. These files can be found under data/campaign/econ and remember to add any systems you create to the starmap JSON file under data/campaign. This will determine at what location the system will spawn.

That should get you started. My advice is to make your faction similar to an existing one at first, and then slowly make changes to see how things work. Start with making the star system and getting that to spawn in your mod before even bothering with faction specifics. Everything builds on top of that.
Logged
Pages: 1 ... 469 470 [471] 472 473 ... 710