Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Simulator Enhancements (03/13/24)

Pages: 1 ... 458 459 [460] 461 462 ... 706

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

SafariJohn

  • Admiral
  • *****
  • Posts: 3010
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6885 on: November 11, 2020, 06:01:48 AM »

No, it's hardcoded.
Logged

Sinosauropteryx

  • Captain
  • ****
  • Posts: 262
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6886 on: November 13, 2020, 09:48:26 AM »

Ah, too bad.

I want to make a weapon barrel that recoils forwards instead of backwards. Putting a negative number in the recoil field doesn't work. Am I out of luck?
Logged

Harpuea

  • Lieutenant
  • **
  • Posts: 58
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6887 on: November 13, 2020, 11:31:25 AM »

I am trying to make a shuttle land in the hangar bay, but I have to reference a fighter craft nearby. There may be a problem if there are no fighters nearby. How do I get a ship with carrier bay landing location directly if only the carrier is present?

Code
    	    for (ShipAPI fighterAI : CombatUtils.getShipsWithinRange(ship.getLocation(), 4000.0F)) { //Check for fighters nearby to use their landing bay.
          if (fighterAI.getOwner() != fighterAI.getOwner() || !fighterAI.isFighter() || !fighterAI.getWing().getSourceShip().isAlive()) {
                  continue;
                }
          if (fighterAI.getOwner() == ship.getOwner()) {
                if (ship == playerShip) //If it is the player, display the text.
                Global.getCombatEngine().maintainStatusForPlayerShip("SystemAlert", "graphics/ui/icons/icon_retreat2.png","RALLY POINT",
                                fighterAI.getWing().getSourceShip().getName() ,false);
                }
                       
        if (fighterAI != null) {
        fightersource = fighterAI;
        carrier = fighterAI.getWing().getSourceShip();
        target = carrier;
            targetOffset = StolenUtils.toRelative(carrier, fighterAI.getWing().getSource().getLandingLocation(fighterAI));
        }
        break;
       
        }


Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6888 on: November 13, 2020, 12:00:37 PM »

I want to make a weapon barrel that recoils forwards instead of backwards. Putting a negative number in the recoil field doesn't work. Am I out of luck?

... since that's what I was about to suggest - probably, yeah.


@Harpuea: I'm not sure I understand the question. Why couldn't you iterate over the ships nearby and find a carrier that way?
Logged

Harpuea

  • Lieutenant
  • **
  • Posts: 58
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6889 on: November 13, 2020, 12:40:37 PM »

Quote
@Harpuea: I'm not sure I understand the question. Why couldn't you iterate over the ships nearby and find a carrier that way?

I can get the location of the center of the carrier, but not the hangar bay. The shuttle lands in the middle of the carrier if I just get carrier location. So I have to iterate a fighter that is present to get the exact hangar bay location. Don't how to get the hangar bay location directly from the carrier. Thank you for the quick reply.



[attachment deleted by admin]
« Last Edit: November 13, 2020, 12:43:08 PM by Harpuea »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6890 on: November 13, 2020, 02:00:12 PM »

Ah - I'd take a look at this:
ShipAPI -> List<FighterLaunchBayAPI> getLaunchBaysCopy();
Logged

shoi

  • Admiral
  • *****
  • Posts: 650
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6891 on: November 13, 2020, 05:37:58 PM »

Is there a simple way to check if a ship is the only one left on its side, with no remaining reserves?
I don't know if you've already tried this (I haven't) but if you turn a fighter into a frigate, or change its collision class, right as it dies, the hulk might stick around?
I tried to with a baseeveryframecombatplugin but it seems to fire after the ship decides it will go poof or stick around, unfortunately :(
« Last Edit: November 13, 2020, 05:40:30 PM by shoi »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6892 on: November 13, 2020, 05:49:46 PM »

Is there a simple way to check if a ship is the only one left on its side, with no remaining reserves?

Iterating over getDeployed()/getReserves() from the respective CombatFleetManagerAPI would be the way to go here.
Logged

shoi

  • Admiral
  • *****
  • Posts: 650
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6893 on: November 13, 2020, 06:12:23 PM »

Thanks! I actually thought of something else while working on this.

Quote
Added fighter wing tags:
rapid_reform - lagging wing members catch up more quickly
leader_no_swarm - leader will start a new attack run on reaching target
wingmen_no_swarm - wing members will keep their position in the wing on reaching target
match_leader_facing - wing members will not face towards target but will match wing leader
attack_at_an_angle - aim to pass near target instead of directly over it, based on weapon range
independent_of_carrier - combat won't end when only these are left on the field

With 0.95, If I stuck this tag on a ship that had it's hullsize changed to fighter, would it be properly evaluated? I was also thinking I could just add the tag to it using ship.getWing().getSpec(), but I guess im not sure how it works behind the scenes. I've noticed that ships targetting anything that had its hullsize changed appends "Wing" to the variant name, so i'm assuming it wouldn't evaluate to null?
« Last Edit: November 13, 2020, 06:13:55 PM by shoi »
Logged

Sinosauropteryx

  • Captain
  • ****
  • Posts: 262
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6894 on: November 17, 2020, 01:35:52 AM »

Is it possible to change the way monthly salaries are calculated? For example, could I make a type of crew that gets paid less or more than normal crew?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6895 on: November 17, 2020, 06:18:44 PM »

Is it possible to change the way monthly salaries are calculated? For example, could I make a type of crew that gets paid less or more than normal crew?

See: CoreScript.reportEconomyTick(); you could have a CampaignEventListener registered that could do this sort of thing. Where you'd run into problems though is making a different type of crew; the game will not use anything other than "crew" for things like crewing ships, colonization, etc.
Logged

Feuerholz

  • Ensign
  • *
  • Posts: 9
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6896 on: November 18, 2020, 02:47:13 PM »

Is there a way to modify the stats of the base hull in a .skin file?

I'm new to this, but i already created a separate Colossus tanker in order to fill the gap between destroyer and capital. However as i went through the files i realized that this should also work as just a "skin", but i don't find any info on how to change base hull stats like cargo and fuel in a .skin file.

Is this possible?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6897 on: November 18, 2020, 02:55:19 PM »

You'd have to do it using a built-in hullmod. I'm not sure offhand if it's possible to change the ship's type designation (i.e. "Colossus-class Freighter") through the skin file. All in all it sounds like doing this with a separate ship hull is the right way to go.
Logged

Feuerholz

  • Ensign
  • *
  • Posts: 9
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6898 on: November 18, 2020, 03:26:45 PM »

Thanks for the answer Alex. I already thought this might only be possible with a hullmod, if at all. However i did not think about the type designation, what relevance does this have?
So i'll stick with the new ship. Maybe for future updates it might be a cool idea to have the ability to create modified clones via skins. I could be wrong though, i'm rather new at this. ;)
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6899 on: November 18, 2020, 03:30:15 PM »

Ah - the relevance is that when the ship shows up in-game, its designation will no longer reflect its role :) You wouldn't want a "Colossus-class Freighter" to be a tanker.
Logged
Pages: 1 ... 458 459 [460] 461 462 ... 706