Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 298 299 [300] 301 302 ... 710

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

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24114
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4485 on: March 28, 2019, 04:44:58 PM »

Took a look; possible I'm missing something but at least this aspect of it is easy to address. Fixed it up so that 1) the hazard from an un-found condition does not apply to the cost to survey (which it didn't to begin with), and 2) the colonize screen reapplies the conditions, so that the hazard rating etc from these is visible in that screen.
Logged

Tartiflette

  • Admiral
  • *****
  • Posts: 3529
  • MagicLab discord: https://discord.gg/EVQZaD3naU
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4486 on: March 28, 2019, 04:54:03 PM »

Thanks!
Logged
 

manictiger

  • Ensign
  • *
  • Posts: 21
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4487 on: March 29, 2019, 10:49:43 AM »

Is there any way to force a specific blueprint to spawn on a planet or derelict?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24114
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4488 on: March 29, 2019, 11:01:09 AM »

You probably want to add a custom drop group to drop_groups.csv (configured to, say, include all blueprints with a certain tag, and whatever chance you like of nothing being there), and then, in the code, something like:

Code: java
DropData d = new DropData();
d.chances = 10; // or whatever number of drop chances you want
d.group = "<your drop group id>";
entity.addDropRandom(d);

I think that ought to do it.
Logged

Originem

  • Purple Principle
  • Captain
  • ****
  • Posts: 430
  • Dancing like a boss.
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4489 on: April 02, 2019, 11:23:11 AM »

Acutally I'm wondering about the function of checkOutPerson and returnPerson, I can't understand the meaning of 'check out' and 'return'...
Logged
My mods


Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24114
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4490 on: April 02, 2019, 03:50:27 PM »

"Check out" = mark as being used for something specific (the "reason" parameter). "Return" = mark as no longer being used.

For example if a person on the colony is someone you need to make a commodity delivery to, the code for the delivery mission could not handle two missions having the same person as the target. So the person is "checked out" as the delivery target, and then new delivery missions don't pick that person since they're "checked out" for the same reason the new mission wants to check them out for.
Logged

Sundog

  • Admiral
  • *****
  • Posts: 1727
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4491 on: April 04, 2019, 10:19:38 PM »

Is there a way to add a new campaign ability to an existing game?

This doesn't seem to do the trick:
Code
package sun.fs;

import com.fs.starfarer.api.BaseModPlugin;
import com.fs.starfarer.api.Global;

public class ModPlugin extends BaseModPlugin {
    @Override
    public void onGameLoad(boolean newGame) {
        if(!Global.getSector().getPlayerFleet().hasAbility("sun_fs_siphon_fuel")) {
            Global.getSector().getCharacterData().addAbility("sun_fs_siphon_fuel");
            Global.getSector().getPlayerFleet().addAbility("sun_fs_siphon_fuel");
        }
    }
}

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24114
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4492 on: April 04, 2019, 10:33:19 PM »

Hmm - looking at com.fs.starfarer.api.impl.campaign.rulecmd.AddAbility (and possibly how/where it's used) might be helpful. This is how the campaign tutorial adds the abilities along the way.

I *think* what you might be missing is assigning the ability to a slot, and it might already be added and would be visible if you clicked on a slot to assign an ability.

(Global.getSector().getCharacterData().addAbility(abilityId) adds it to the fleet as well, btw.)
Logged

Sundog

  • Admiral
  • *****
  • Posts: 1727
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4493 on: April 04, 2019, 10:46:33 PM »

Ok, thanks for the quick reply Alex. I've been clicking an empty skill slot to try to assign it, but no luck. I'll take a look at that file and see what I can learn.

Sundog

  • Admiral
  • *****
  • Posts: 1727
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4494 on: April 04, 2019, 10:57:23 PM »

Turns out I just forgot to add the modPlugin entry to mod_info.json... Man am I rusty...

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24114
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4495 on: April 05, 2019, 10:19:25 AM »

Happens to the best of us :)
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4682
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4496 on: April 07, 2019, 03:04:37 AM »

CombatTaskManagerAPI:
Code: java
	/**
* target should be one of:
* BattleObjectiveAPI
* DeployedFleetMemberAPI
* the result of createWaypoint()
*
* @param type
* @param target
* @param useCommandPointIfNeeded
* @return
*/
AssignmentInfo createAssignment(CombatAssignmentType type, AssignmentTargetAPI target, boolean useCommandPoint);
But neither BattleObjectiveAPI nor DeployedFleetMemberAPI implement the AssignmentTargetAPI interface. Wut?

If I want to give an escort order on a ship in combat, should I create my own class that implements AssignmentTargetAPI?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24114
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4497 on: April 07, 2019, 09:11:10 AM »

Oh, that's... definitely weird. For the moment, you should be able to cast any of these to AssignmentTargetAPI - while the DeployedFleetMemberAPI / BattleObjectiveAPI interfaces do not implement it, the core implementations do.

Let me make these two extend AssignmentTargetAPI; there, done.


If I want to give an escort order on a ship in combat, should I create my own class that implements AssignmentTargetAPI?

(That wouldn't work, btw - the method expects a core implementation, and the AssignmentTargetAPI is more of a marker interface, anyway.)
Logged

MShadowy

  • Admiral
  • *****
  • Posts: 911
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4498 on: April 11, 2019, 08:29:41 AM »

So I got reminded of a miscellaneous problem I'm having in relation to fighter wing rarity, and I was kinda wondering if I'm missing something on it.

In a relatively recent update of Shadowyards I added the Shikome, a sort of advanced prototype fighter that's basically just kinda monstrous; suitably for it's lore and capabilities I set it to be pretty rare -- presuming a default weighting of 1, the Shikome has a weighting of 0.05, so it should be getting selected about 1/20th as often as a fighter with the probable default weighting.

This doesn't actually seem to be happening, however, and Shikomes appear regularly in Shadowyards fleets; in fact this query got started by some reporting a battle with 8(!?!?!) of the things at once, which is probably way more than you should encounter at one time. I can only presume I've got the weighting messed up somehow and am wondering if anyone has any insight.
Logged

Tartiflette

  • Admiral
  • *****
  • Posts: 3529
  • MagicLab discord: https://discord.gg/EVQZaD3naU
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4499 on: April 11, 2019, 09:10:50 AM »

Actually, since we recently got a documentation post about loot drops, I owuldn't mind an in-depth look at how rarity works for everything, weapons wings and hulls.

The way I understand it, it is highly dependent on the number of available hulls for each role, and I suspect having a few rarity "tiers" rather than just a multiplier would help maintaining a consistent rarity regarless of the number of active mods.
Logged
 
Pages: 1 ... 298 299 [300] 301 302 ... 710