Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 372 373 [374] 375 376 ... 710

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

Server_Corgi

  • Ensign
  • *
  • Posts: 3
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5595 on: November 05, 2019, 03:01:44 AM »

Is there any mod or method to add blueprints of ships without blueprints in the base game into the game?

Sorry if that seems confusing, but I just want to be able to produce Legion XIV's with my own production.
Logged

Hrothgar

  • Captain
  • ****
  • Posts: 327
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5596 on: November 05, 2019, 03:18:07 AM »

Is there any sort of shorthand method to render a visual copy of a ship like how addAfterimage does? Working on some custom afterimage visuals, but currently I'm just rendering the ship's sprite which looks fine mostly, but has some issues like obviously empty weapon mounts.



I guess making a ship with fixed loadout of weapons, like Nomad ones is eventually way to go.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24111
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5597 on: November 05, 2019, 08:00:59 AM »

Is there any sort of shorthand method to render a visual copy of a ship like how addAfterimage does? Working on some custom afterimage visuals, but currently I'm just rendering the ship's sprite which looks fine mostly, but has some issues like obviously empty weapon mounts.

ShipAPI.setCopyLocation(Vector2f loc, float copyAlpha, float copyFacing);

Used in vanilla by phase skimmer and the like; sounds like it should work for you unless you need more than one copy, in which case, SoL.


Is there any mod or method to add blueprints of ships without blueprints in the base game into the game?

Sorry if that seems confusing, but I just want to be able to produce Legion XIV's with my own production.

Hmm - if you have the Console Commands mod, something like:
RunCode Global.getSector().getPlayerFaction().addKnownShip("legion_xiv", false);

Should do the job. To be clear, it won't add a blueprint chip to your cargo (which would be doable with another command), but should just make it known by your faction.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24111
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5599 on: November 05, 2019, 08:07:11 AM »

Ah, that's a really good point, forgot about that - thank you!

So, yeah, would also need to edit data/world/factions/default_ship_roles.json, find the "carrierLarge" section, and add:

"legion_xiv_Elite":10,
Logged

Nia Tahl

  • Admiral
  • *****
  • Posts: 792
  • AI in disguise
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5600 on: November 06, 2019, 05:10:01 AM »

Is there a method to make a faction not receive any reputation changes from trade?

Context: I have a non-faction that only exists as the owner of a single submarket on an independent planet  and is otherwise not present as a faction. The market offers access to special ships associate with said faction, but trade with said market will still give reputations gains towards said faction, which can be somewhat confusing to users since the faction otherwise doesn't actually exist in any way.
Logged
My mods: Tahlan Shipworks - ScalarTech Solutions - Trailer Moments
It's all in the presentation

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24111
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5601 on: November 06, 2019, 07:40:17 AM »

Is there a method to make a faction not receive any reputation changes from trade?

Context: I have a non-faction that only exists as the owner of a single submarket on an independent planet  and is otherwise not present as a faction. The market offers access to special ships associate with said faction, but trade with said market will still give reputations gains towards said faction, which can be somewhat confusing to users since the faction otherwise doesn't actually exist in any way.

Hmm... looking at RepTrackerEvent, the main option would be to have submarket.isParticipatesInEconomy() return false. That would have the side effect of profitable trades there not granting XP either, though, and possibly some other (minor, I think?) effects; haven't dug through it exhaustively.
Logged

Nia Tahl

  • Admiral
  • *****
  • Posts: 792
  • AI in disguise
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5602 on: November 06, 2019, 07:34:55 PM »

And another while I'm at it:

Any way to get the offset of a ship's center from the center of its sprite via script? Have noticed that my custom afterimages are rendering well behind some ships as they have centers off mass further back. (Onslaught comes to mind)
Logged
My mods: Tahlan Shipworks - ScalarTech Solutions - Trailer Moments
It's all in the presentation

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24111
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5603 on: November 06, 2019, 08:25:35 PM »

Probably something based on ship.getSpriteAPI().getCenterX()/getCenterY(). The Atlas is a good test ship, too, since it's suuuper pronounced there.
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 #5604 on: November 07, 2019, 12:05:39 AM »

What is the file that deals with annulling a commission after hostile engagement?
Logged

Nia Tahl

  • Admiral
  • *****
  • Posts: 792
  • AI in disguise
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5605 on: November 07, 2019, 02:31:30 AM »

Probably something based on ship.getSpriteAPI().getCenterX()/getCenterY(). The Atlas is a good test ship, too, since it's suuuper pronounced there.

Wasn't aware those returned the offset center's coordinates. Thanks. After a bunch of fiddling I got the whole thing working.
Logged
My mods: Tahlan Shipworks - ScalarTech Solutions - Trailer Moments
It's all in the presentation

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24111
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5606 on: November 07, 2019, 09:21:57 AM »

What is the file that deals with annulling a commission after hostile engagement?

FactionCommissionIntel:

Code
@Override
public void advanceMission(float amount) {
float days = Global.getSector().getClock().convertToDays(amount);

RepLevel level = faction.getRelToPlayer().getLevel();
if (!level.isAtWorst(RepLevel.NEUTRAL)) {
setMissionResult(new MissionResult(-1, null));
setMissionState(MissionState.COMPLETED);
endMission();
sendUpdateIfPlayerHasIntel(missionResult, false);
} else {
makeRepChanges(null);
}
}

And then a couple of places check missionResult.payment < 0 to determine it's an annullment.
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 #5607 on: November 07, 2019, 12:27:58 PM »

Hmm. Ok, so here's my dilemma:

I have a rules entry that checks whether a player has a commission with the faction and then, if they do, gives a dialogue option for commission-giving npcs to also set the player faction's portraits to that faction's portraits (immersion feature).

The first time this happens you get some rep (usually just for npc but I think if you take a commission at "welcoming" it might bump faction rep too) since its a show of loyalty, but you can always change your mind and go back to "stock" player portraits in your faction by talking to any commission-giving npc again and choosing the appropriate dialogue to change your mind. This doesn't reduce rep, but if you change your mind again and choose that faction's portraits, they are less impressed and rep isn't affected.

That's the context of what I am trying to do and it all works except:

When you lose your commission from hostile action or rep loss of any kind if will remove the dialogue option from the npc but obviously won't run the rule command to change the player faction's portraits back to stock. So it would lock the player into whatever their choice is until they can get a commission back so the dialogue shows up again. That's obviously not ideal.

Potential solutions:

1) So I could just make the "change back" dialogue always populate if your portraits are locked no matter if you have a commission or not, but that doesn't really make sense from a logical standpoint since if they were mad enough to annul your commission they certainly aren't going to keep sending you officers until you kindly ask them not to.  :P

2) Or I can figure out how to run the rule command each time the commission is annulled. The optimal solution for immersion.

Sorry it took so long to get here, but I really wanted the context to be fleshed out.

Important Part:
If I created a class that extended FactionCommissionIntel and overrides methods like createResignedCommissionResult() or endMission(InteractionDialogAPI dialog) and just added in the rule command to it I wonder if that would work.

Any potential ideas from anyone?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24111
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5608 on: November 07, 2019, 01:03:54 PM »

Another possible solution: have a script check, maybe even every frame, whether the player had the commission but no longer does (if this is a quick check, doing it every frame is no problem) and if so <do thing>.
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 #5609 on: November 07, 2019, 01:11:57 PM »

Another possible solution: have a script check, maybe even every frame, whether the player had the commission but no longer does (if this is a quick check, doing it every frame is no problem) and if so <do thing>.

It would check for a boolean assigned to player memory to be true and then check if the player has a commission. That's pretty quick right? Any examples of EveryFrameScript being implemented? I've actually never written one and I tend to avoid them whenever possible because until my last update my mod already had ample performance issues as it was haha.
« Last Edit: November 07, 2019, 01:13:55 PM by Morrokain »
Logged
Pages: 1 ... 372 373 [374] 375 376 ... 710