Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 260 261 [262] 263 264 ... 710

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

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 #3915 on: June 02, 2018, 12:00:00 PM »

The planets spawn alright but are empty when surveying ("there is nothing of interest here"). It did it for every Lava biome planets, and I think the hab_1s? Not exactly sure about the later, I'll test that again to be sure.
Logged
 

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24118
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3916 on: June 02, 2018, 12:31:09 PM »

What exactly do you mean by "biome"?
Logged

Snrasha

  • Admiral
  • *****
  • Posts: 705
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3917 on: June 03, 2018, 03:13:38 PM »

Sorry for busy you, but on my mission where you fight a fleet.

This method is not called after than i have defeated a fleet:
    public void reportBattleOccurred(CampaignFleetAPI primaryWinner, BattleAPI battle)

So, when i go on the sector, the mission finish with :
    public void advance(float amount)

And i go a failure mission because the first method have not be called...

(I have put a tried=0 who go to 1 if the reportBattleOccurred have be called)


How made the first method to work, like this is everything like personBountyEvent class?
Thank you!

Logged
I am pretty bad on english. So, sorry in advance.

Gladiator Society
Add battle options on Com Relay/ Framework for modders for add their own bounty.

Sanguinary Autonomist Defectors A fan-mod of Shadowyard.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24118
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3918 on: June 03, 2018, 03:31:35 PM »

Sorry for busy you, but on my mission where you fight a fleet.

This method is not called after than i have defeated a fleet:
    public void reportBattleOccurred(CampaignFleetAPI primaryWinner, BattleAPI battle)

Did you register your class as an event listener? Just implementing the interface isn't enough.

I forget if it's possible to add listeners directly to fleets in 0.8; if it is that's the preferred way to do it. Otherwise you can Global.getSector().addListener() it. Also: make very sure to remove it once the event is over, or it'll be a performance/memory leak.
Logged

Snrasha

  • Admiral
  • *****
  • Posts: 705
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3919 on: June 03, 2018, 11:53:29 PM »

Sorry for busy you, but on my mission where you fight a fleet.

This method is not called after than i have defeated a fleet:
    public void reportBattleOccurred(CampaignFleetAPI primaryWinner, BattleAPI battle)

Did you register your class as an event listener? Just implementing the interface isn't enough.

I forget if it's possible to add listeners directly to fleets in 0.8; if it is that's the preferred way to do it. Otherwise you can Global.getSector().addListener() it. Also: make very sure to remove it once the event is over, or it'll be a performance/memory leak.

Just add the add on the startEvent, on the remove on the endEvent, so?<
Edit: Work, and i do no think i can better.

Edit2: A tutorial exist for add a custom text for each fleet linked to this Event than you fight?(Like the IBB from SWP)
« Last Edit: June 04, 2018, 12:32:27 AM by Snrasha »
Logged
I am pretty bad on english. So, sorry in advance.

Gladiator Society
Add battle options on Com Relay/ Framework for modders for add their own bounty.

Sanguinary Autonomist Defectors A fan-mod of Shadowyard.

Histidine

  • Admiral
  • *****
  • Posts: 4682
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3920 on: June 04, 2018, 04:50:05 AM »

Is there any way to change the fleet composition depending on fleet size? So small fleets might have a moderate % of small escorts relative to overall small units, while large fleets would not field them.
DR mods use the hack of modifying the faction's fleet doctrine before creating the fleet, then changing it back afterwards. (It's used to make larger fleets prefer big ships)
(example)
Logged

Snrasha

  • Admiral
  • *****
  • Posts: 705
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3921 on: June 04, 2018, 01:52:06 PM »

Ok, new stupid question: (The previous have be fixed per this question)


For a custom text for each fleet on my bounty:

When i create the fleet, i add just:
        fleet.getMemoryWithoutUpdate().set("$text2", mission.getDescription2());


Then, he will be retired automatically when the fleet is gone?

Like this thing work for have custom description.
« Last Edit: June 04, 2018, 02:58:23 PM by Snrasha »
Logged
I am pretty bad on english. So, sorry in advance.

Gladiator Society
Add battle options on Com Relay/ Framework for modders for add their own bounty.

Sanguinary Autonomist Defectors A fan-mod of Shadowyard.

King Alfonzo

  • Admiral
  • *****
  • Posts: 683
  • -- D O C T O R --
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3922 on: June 17, 2018, 03:19:42 AM »

Quick question, because I'm not sure exactly how to do this: how does one make the small mini descriptions on the UI in the bottom-left of the screen during combat? I want a little thing to pop up as a consequence of activating a speed increase at high flux for a hullmod, but I'm unsure how.

Nick XR

  • Admiral
  • *****
  • Posts: 713
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3923 on: June 17, 2018, 02:43:00 PM »

Are flack weapons not ever returning true for the call DamagingProjectileAPI.didDamage() expected? I'm guessing this has something to do with them doing AoE damage (probably via spawning an explosion). 

So if that's true, is there a way to get all the current explosions and what their source was? I've looked on CombatEngineAPI but I don't see any methods that seem like they would return current explosions.

Thanks!

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24118
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3924 on: June 17, 2018, 08:04:51 PM »

Ok, new stupid question: (The previous have be fixed per this question)


For a custom text for each fleet on my bounty:

When i create the fleet, i add just:
        fleet.getMemoryWithoutUpdate().set("$text2", mission.getDescription2());


Then, he will be retired automatically when the fleet is gone?

Like this thing work for have custom description.

Yes but this doesn't seem like a good idea. Probably better to generate the text where you need to use it, and store whatever parameters you need to do so in memory. Otherwise you're potentially sending a bunch of redundant text data into the savefile.

Are flack weapons not ever returning true for the call DamagingProjectileAPI.didDamage() expected? I'm guessing this has something to do with them doing AoE damage (probably via spawning an explosion). 

So if that's true, is there a way to get all the current explosions and what their source was? I've looked on CombatEngineAPI but I don't see any methods that seem like they would return current explosions.

Thanks!

Pretty sure you're right & nothing comes to mind as far as getting to the explosions. Someone else might have a better idea, though.
Logged

Snrasha

  • Admiral
  • *****
  • Posts: 705
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3925 on: June 18, 2018, 12:04:05 AM »

Ok, new stupid question: (The previous have be fixed per this question)


For a custom text for each fleet on my bounty:

When i create the fleet, i add just:
        fleet.getMemoryWithoutUpdate().set("$text2", mission.getDescription2());


Then, he will be retired automatically when the fleet is gone?

Like this thing work for have custom description.

Yes but this doesn't seem like a good idea. Probably better to generate the text where you need to use it, and store whatever parameters you need to do so in memory. Otherwise you're potentially sending a bunch of redundant text data into the savefile.


The problem is:
The custom text is extremely different of each mission, they are used when you encounter a fleet and dialog with them. The custom text is from a JSON, also, my mod is like a Mission Bounty Framework.
And i do not think than the player will have more than 3 of theses missions. (Limited to 3 on the market)
Logged
I am pretty bad on english. So, sorry in advance.

Gladiator Society
Add battle options on Com Relay/ Framework for modders for add their own bounty.

Sanguinary Autonomist Defectors A fan-mod of Shadowyard.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24118
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3926 on: June 18, 2018, 01:17:18 PM »

I mean, it's totally fine as a one-off. Just a general point that if everything did it that way, it'd become a problem.
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4682
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3927 on: June 19, 2018, 06:53:44 AM »

Quick question, because I'm not sure exactly how to do this: how does one make the small mini descriptions on the UI in the bottom-left of the screen during combat? I want a little thing to pop up as a consequence of activating a speed increase at high flux for a hullmod, but I'm unsure how.

Phase cloak uses this:

Code: java
	protected Object STATUSKEY1 = new Object();
protected Object STATUSKEY2 = new Object();
protected Object STATUSKEY3 = new Object();
protected Object STATUSKEY4 = new Object();

protected void maintainStatus(ShipAPI playerShip, State state, float effectLevel) {
float level = effectLevel;
float f = VULNERABLE_FRACTION;

ShipSystemAPI cloak = playerShip.getPhaseCloak();
if (cloak == null) cloak = playerShip.getSystem();
if (cloak == null) return;

if (level > f) {
// Global.getCombatEngine().maintainStatusForPlayerShip(STATUSKEY1,
// cloak.getSpecAPI().getIconSpriteName(), cloak.getDisplayName(), "can not be hit", false);
Global.getCombatEngine().maintainStatusForPlayerShip(STATUSKEY2,
cloak.getSpecAPI().getIconSpriteName(), cloak.getDisplayName(), "time flow altered", false);
} else {
// float INCOMING_DAMAGE_MULT = 0.25f;
// float percent = (1f - INCOMING_DAMAGE_MULT) * getEffectLevel() * 100;
// Global.getCombatEngine().maintainStatusForPlayerShip(STATUSKEY3,
// spec.getIconSpriteName(), cloak.getDisplayName(), "damage mitigated by " + (int) percent + "%", false);
}
}

For a hullmod, use advance() instead of maintainStatus().
Logged

King Alfonzo

  • Admiral
  • *****
  • Posts: 683
  • -- D O C T O R --
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3928 on: June 20, 2018, 04:24:09 AM »

Meso said the same thing. Got it working, thanks Histidine.

sylva

  • Ensign
  • *
  • Posts: 18
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3929 on: July 09, 2018, 07:49:31 AM »

Hello people, greenhorn modder here(copypaster)

I'm working on a faction mod (corporation) and was wondering if it is possible to get the faction's capital to move once every 3-6 months to an another system. (Thinking about a smaller, mobile starbase)
Logged
Pages: 1 ... 260 261 [262] 263 264 ... 710