Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 256 257 [258] 259 260 ... 710

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

Nicke535

  • Commander
  • ***
  • Posts: 240
  • Degenerate Core
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3855 on: May 08, 2018, 07:07:03 AM »

Aha, I missed that part, sorry! Read it as being 400 per shot, not total.

Are you 100% sure the per-shot damage is indeed 20? Also, might be worth testing in an as-vanilla-as-possible to try to narrow down what might be going on.

... in other words, no, it doesn't make sense, and I can't see how that would happen either. Although it's certainly possible if say the damage-dealt or damage-received stats of the ship/target are modified by something else.
OK, I might have figured it out, but this is mostly speculation:

The problem does not persist when I ceased spawning the projectiles via scripted means [sorry I didn't mention that first, btw: might have explained a lot]. However, the behaviour of the scripted projectiles is completely fine as long as it doesn't impact hull/armor: shields work just as intended.

Thus, I believe the issue is that setting a projectile's damage via script only changes the impact damage, and not the AoE damage from a flak projectile. I might be completely wrong, but that would explain a lot of the behaviour, since the Fuse-based detonations might not affect shields in the same way as hull.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24127
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3856 on: May 08, 2018, 08:09:13 AM »

For now, how to decrease the chance of ship's recover that made them catchable after battle? member.getStats().getDynamic().getStat(Stats.BOARDING_CHANCE_MULT)?

stats.getDynamic().getMod(Stats.INDIVIDUAL_SHIP_RECOVERY_MOD)

(See ReinforcedBulkheads for an example.)


Thus, I believe the issue is that setting a projectile's damage via script only changes the impact damage, and not the AoE damage from a flak projectile. I might be completely wrong, but that would explain a lot of the behaviour, since the Fuse-based detonations might not affect shields in the same way as hull.

Aha - yeah, that makes sense. Added a CombatEntityAPI.getAI() method to get at proximity fuse AI from projectiles, and
added ProximityFuseAIAPI, with an updateDamage() method, so that you can force the damage changes to be picked up.
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 #3857 on: May 08, 2018, 08:21:04 AM »

stats.getDynamic().getMod(Stats.INDIVIDUAL_SHIP_RECOVERY_MOD)

(See ReinforcedBulkheads for an example.)

So if I apply it when fleet is generated, it could take effect right?
Logged
My mods


Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24127
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3858 on: May 08, 2018, 08:55:32 AM »

So if I apply it when fleet is generated, it could take effect right?

No, fleet member stats are updated from scratch before battles or any time the fleet composition changes etc. In particular they do not end up in save files. Any changes you make like this should come either from a hullmod or using FleetMemberAPI.getBuffManager().
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 #3859 on: May 08, 2018, 09:53:50 AM »

No, fleet member stats are updated from scratch before battles or any time the fleet composition changes etc. In particular they do not end up in save files. Any changes you make like this should come either from a hullmod or using FleetMemberAPI.getBuffManager().

So can I apply it during the battle?
Logged
My mods


Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24127
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3860 on: May 08, 2018, 09:57:59 AM »

I'm not sure. I wouldn't, really; even if that works now there's no guarantee it'll continue working.
Logged

stormbringer951

  • Commander
  • ***
  • Posts: 130
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3861 on: May 11, 2018, 02:53:33 AM »

How do you make a hullmod that is unlocked and installable on all ships, but is not droppable as loot from battle / research stations and not for sale?
Logged
Weapons Group Controls mod - deselect all weapon groups, hold-down hold-fire mode, toggle alternating/linked fire
Captain's Log - throw away your notepad: custom notes, ruins and salvageable reminders
Old Hyperion - for your dose of nostalgia
Adjustable Skill Thresholds - set fleet DP and fighter bay thresholds

MajorTheRed

  • Captain
  • ****
  • Posts: 289
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3862 on: May 11, 2018, 06:21:19 AM »

How do you make a hullmod that is unlocked and installable on all ships, but is not droppable as loot from battle / research stations and not for sale?

In data/hullmods/hull_mod.csv
The hull mod will be unlocked if "unlocked" value is "TRUE",
installable on all ships as long as you don't specify it in the .java file of the hullmod,
and not droppable if "hidden" value is "TRUE"
Also, if you don't want the hullmod to show on the refit screen for ship equipped with it (such as specificities for station, for example), you can also set the "hiddenEverywhere" value as "TRUE"

Hope it helps
Logged

stormbringer951

  • Commander
  • ***
  • Posts: 130
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3863 on: May 11, 2018, 12:43:43 PM »

How do you make a hullmod that is unlocked and installable on all ships, but is not droppable as loot from battle / research stations and not for sale?

In data/hullmods/hull_mod.csv
The hull mod will be unlocked if "unlocked" value is "TRUE",
installable on all ships as long as you don't specify it in the .java file of the hullmod,
and not droppable if "hidden" value is "TRUE"
Also, if you don't want the hullmod to show on the refit screen for ship equipped with it (such as specificities for station, for example), you can also set the "hiddenEverywhere" value as "TRUE"

Hope it helps

Hidden hullmods can't be installed, even if they're also unlocked, because unlocked hidden hullmods aren't displayed in the list :(.
« Last Edit: May 11, 2018, 12:48:56 PM by stormbringer951 »
Logged
Weapons Group Controls mod - deselect all weapon groups, hold-down hold-fire mode, toggle alternating/linked fire
Captain's Log - throw away your notepad: custom notes, ruins and salvageable reminders
Old Hyperion - for your dose of nostalgia
Adjustable Skill Thresholds - set fleet DP and fighter bay thresholds

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24127
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3864 on: May 11, 2018, 12:52:53 PM »

I don't 100% remember if this is only for the next release or not but adding a "no_drop" tag might be worth a shot.
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 #3865 on: May 13, 2018, 05:25:35 AM »

public void reportBattleFinished(CampaignFleetAPI primaryWinner, BattleAPI battle)
when it will be called? each engagement finished? not the whole battle is over?
What is getCombinedOne() and Two ? I mean, which sides do they refer to?
for (CampaignFleetAPI fleet : battle.getPlayerSide()) {
            if (fleet.isPlayerFleet()) {}
}

the fleet contains the fleet members which are involved in this battle right? and the fleet does not equal to Global.getSector().getPlayerFleet()?
if it is, what will fleet.isPlayerFleet() return?
Logged
My mods


Histidine

  • Admiral
  • *****
  • Posts: 4688
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3866 on: May 13, 2018, 07:27:19 AM »

public void reportBattleFinished(CampaignFleetAPI primaryWinner, BattleAPI battle)
when it will be called? each engagement finished? not the whole battle is over?
What is getCombinedOne() and Two ? I mean, which sides do they refer to?
for (CampaignFleetAPI fleet : battle.getPlayerSide()) {
            if (fleet.isPlayerFleet()) {}
}

the fleet contains the fleet members which are involved in this battle right? and the fleet does not equal to Global.getSector().getPlayerFleet()?
if it is, what will fleet.isPlayerFleet() return?
reportBattleFinished is called at the end of the battle, after one/both fleets have retreated or died
(while reportBattleOccured is called every autoresolve round; not sure about player engagement rounds)

I think (Alex would know for sure):
  • Side 1 and 2 are arbitrary; e.g. when two fleets meet, either of them could be side 1.
  • Each fleet on one side == the actual fleet on the campaign map that joined the battle. So if the player was in that battle, one of the fleets will == SectorAPI.getPlayerFleet() and its isPlayerFleet() will return true.
  • The combined fleet for each side does not equal any of its constituent fleets, even if only one fleet joined that side.


EDIT: One more thing: in reportBattleFinished you'll want to use the methods that get fleet snapshots rather than the original ones, because those don't exists anymore; the battle has been cleaned up. Source
« Last Edit: May 13, 2018, 08:09:15 AM by Histidine »
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 #3867 on: May 13, 2018, 08:23:20 AM »

One more thing: in reportBattleFinished you'll want to use the methods that get fleet snapshots rather than the original ones, because those don't exists anymore; the battle has been cleaned up. Source

Well I'm in a mess, if I want to get the fleet member whose hull ids start with "XXX" and participated in the battle, what should i do?
« Last Edit: May 13, 2018, 08:27:19 AM by Originem »
Logged
My mods


Histidine

  • Admiral
  • *****
  • Posts: 4688
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3868 on: May 13, 2018, 09:00:59 AM »

Safest way seems to be to call battle.getSnapshotBothSides() and iterate over each fleet and its members.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24127
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3869 on: May 13, 2018, 09:58:04 AM »

(This all sounds right.)
Logged
Pages: 1 ... 256 257 [258] 259 260 ... 710