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 ... 246 247 [248] 249 250 ... 706

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

Regoso

  • Ensign
  • *
  • Posts: 25
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3705 on: December 21, 2017, 04:49:18 AM »

How does one go about getting a station_module to render below engines if that is possible.
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3706 on: December 21, 2017, 08:58:14 AM »

@Originem:  That looks great!  Good job  :)
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3707 on: December 21, 2017, 09:05:38 AM »

The bending tentacles which use GL_QUAD_STRIP to render  ;D

Ah, very nice! That's pretty tricky to do.


How does one go about getting a station_module to render below engines if that is possible.

Could you elaborate a bit? What exactly are you trying to accomplish?

Generally speaking, larger ships are rendered before smaller ships, and since station modules need to be FRIGATE for various reasons, this means they'll render above the engine glows of most other ships.
Logged

Regoso

  • Ensign
  • *
  • Posts: 25
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3708 on: December 21, 2017, 11:21:29 AM »

How does one go about getting a station_module to render below engines if that is possible.

Could you elaborate a bit? What exactly are you trying to accomplish?

Generally speaking, larger ships are rendered before smaller ships, and since station modules need to be FRIGATE for various reasons, this means they'll render above the engine glows of most other ships.

Spoiler
[close]
trying to get that rear armour plate to render below the engines
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3709 on: December 21, 2017, 12:26:54 PM »

Ah, gotcha - there's a UNDER_PARENT hint, but I'm fairly sure that's only in the dev version and not in the 0.8.1a release.
Logged

Regoso

  • Ensign
  • *
  • Posts: 25
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3710 on: December 21, 2017, 12:57:34 PM »

Ah, gotcha - there's a UNDER_PARENT hint, but I'm fairly sure that's only in the dev version and not in the 0.8.1a release.
ya it appears to not be work but thanks anyway =).

Also how does one get a station module to show up on a skin as i seem to be having trouble with that it well show up when i spawn the variant in but when i go to buy it its not on the ship its suppose to be on in the market. The base ship already has SHIP_WITH_MODULES on it but that doesnt seem to matter even when i add it to the skin "addHints":[SHIP_WITH_MODULES], it still doesnt work in the market.
The Armoured prow is whats not working on the skin.
Market img of working ship:
Spoiler
[close]
market img of none working ship:
Spoiler
[close]
skin details:
Spoiler
{
  "baseHullId": "dauntless_destroyer",
  "baseValue": 35000,
  "baseValueMult": 1,
  "builtInWeapons": {
    "WS0001": "prowtorpedolauncher"
  },
  "descriptionId": "dauntless_destroyer",
  "fleetPoints": 12,
  "hullDesignation": "Destroyer",
  "hullName": "Dauntless Mk.II",
  "addHints":[SHIP_WITH_MODULES],
  "ordnancePoints": 50,
  "restoreToBaseHull": false,
  "skinHullId": "dauntless_destroyer_MkII_skin",
  "spriteName": "graphics/ships/Dauntless_Destroyer.png",
  "systemId": "maneuveringjets"
}
[close]

Edit more details:
working ships variant file:
Spoiler
{
  "displayName": "Standard",
  "fluxCapacitors": 4,
  "fluxVents": 16,
  "goalVariant": true,
  "hullId": "dauntless_destroyer",
  "hullMods": [
    "targetingunit",
    "hardenedshieldemitter"
  ],
  "permaMods": [],
  "quality": 1,
  "variantId": "dauntless_destroyer_S",
  "weaponGroups": [
    {
      "autofire": false,
      "mode": "LINKED",
      "weapons": {
        "WS0001": "heavyprowlance",
        "WS0020": "armoured_destroyer_prow_S"
      }
    },
    {
      "autofire": true,
      "mode": "LINKED",
      "weapons": {
        "WS0002": "lightmc",
        "WS0004": "lightmc",
        "WS0006": "lightmc",
        "WS0008": "lightmc",
        "WS0010": "lightmc",
        "WS0012": "lightmc"
      }
    },
    {
      "autofire": true,
      "mode": "LINKED",
      "weapons": {
        "WS0003": "lightmc",
        "WS0005": "lightmc",
        "WS0007": "lightmc",
        "WS0009": "lightmc",
        "WS0011": "lightmc",
        "WS0013": "lightmc"
      }
    },
    {
      "autofire": true,
      "mode": "LINKED",
      "weapons": {
        "WS0014": "lightmacrocannonturret",
        "WS0015": "lightmacrocannonturret"
      }
    },
    {
      "autofire": true,
      "mode": "LINKED",
      "weapons": {
        "WS0017": "vulcanmbdtower",
        "WS0018": "vulcanmbdtower",
        "WS0021": "vulcanmbdtower",
        "WS0022": "vulcanmbdtower"
      }
    }
  ],
  "wings": []
}
[close]
non working ships variants file:
Spoiler
{
  "displayName": "Standard Mk.II",
  "fluxCapacitors": 4,
  "fluxVents": 16,
  "goalVariant": true,
  "hullId": "dauntless_destroyer_MkII_skin",
  "hullMods": [
    "targetingunit",
    "hardenedshieldemitter"
  ],
  "permaMods": [],
  "quality": 1,
  "variantId": "dauntless_destroyer_S_2",
  "weaponGroups": [
    {
      "autofire": false,
      "mode": "LINKED",
      "weapons": {
        "WS0001": "heavyprowlance",
        "WS0020": "armoured_destroyer_prow_S"
      }
    },
    {
      "autofire": true,
      "mode": "LINKED",
      "weapons": {
        "WS0002": "lightmc",
        "WS0004": "lightmc",
        "WS0006": "lightmc",
        "WS0008": "lightmc",
        "WS0010": "lightmc",
        "WS0012": "lightmc"
      }
    },
    {
      "autofire": true,
      "mode": "LINKED",
      "weapons": {
        "WS0003": "lightmc",
        "WS0005": "lightmc",
        "WS0007": "lightmc",
        "WS0009": "lightmc",
        "WS0011": "lightmc",
        "WS0013": "lightmc"
      }
    },
    {
      "autofire": true,
      "mode": "LINKED",
      "weapons": {
        "WS0014": "lightmacrocannonturret",
        "WS0015": "lightmacrocannonturret"
      }
    },
    {
      "autofire": true,
      "mode": "LINKED",
      "weapons": {
        "WS0017": "vulcanmbdtower",
        "WS0018": "vulcanmbdtower",
        "WS0021": "vulcanmbdtower",
        "WS0022": "vulcanmbdtower"
      }
    }
  ],
  "wings": []
}
[close]
Base .ship file
Spoiler
{
  "bounds": [
    -135.5,
    -8,
    -129.5,
    -23.5,
    -81,
    -23.5,
    -48,
    -34.5,
    -43,
    -13,
    74,
    -13,
    91,
    0,
    74,
    13,
    -43,
    13,
    -48,
    34.5,
    -81,
    23.5,
    -129.5,
    23.5,
    -135.5,
    8
  ],
  "builtInMods": [
    "auxiliarythrusters"
  ],
  "builtInWeapons": {
    "WS0001": "heavyprowlance",
    "WS0002": "lightmc",
    "WS0003": "lightmc",
    "WS0004": "lightmc",
    "WS0005": "lightmc",
    "WS0006": "lightmc",
    "WS0007": "lightmc",
    "WS0008": "lightmc",
    "WS0009": "lightmc",
    "WS0010": "lightmc",
    "WS0011": "lightmc",
    "WS0012": "lightmc",
    "WS0013": "lightmc",
    "WS0017": "vulcanmbdtower",
    "WS0018": "vulcanmbdtower",
    "WS0019": "upperdeck_12",
    "WS0021": "vulcanmbdtower",
    "WS0022": "vulcanmbdtower"
  },
  "builtInWings": [],
  "center": [
    81,
    137.5
  ],
  "collisionRadius": 140.5,
  "engineSlots": [
    {
      "angle": 180,
      "contrailSize": 9,
      "length": 50,
      "location": [
        -131.5,
        19
      ],
      "style": "HIGH_TECH",
      "width": 9
    },
    {
      "angle": -180,
      "contrailSize": 9,
      "length": 50,
      "location": [
        -131.5,
        -19
      ],
      "style": "HIGH_TECH",
      "width": 9
    },
    {
      "angle": 180,
      "contrailSize": 9,
      "length": 49,
      "location": [
        -134.5,
        9
      ],
      "style": "HIGH_TECH",
      "width": 9
    },
    {
      "angle": -180,
      "contrailSize": 9,
      "length": 49,
      "location": [
        -134.5,
        -9
      ],
      "style": "HIGH_TECH",
      "width": 9
    },
    {
      "angle": 180,
      "contrailSize": 9,
      "length": 49,
      "location": [
        -135.5,
        -0
      ],
      "style": "HIGH_TECH",
      "width": 9
    },
    {
      "angle": 91.5,
      "contrailSize": 128,
      "length": 16.94182,
      "location": [
        65,
        15.5
      ],
      "style": "HIGH_TECH",
      "width": 4.888646
    },
    {
      "angle": -91.5,
      "contrailSize": 128,
      "length": 16.94182,
      "location": [
        65,
        -15.5
      ],
      "style": "HIGH_TECH",
      "width": 4.888646
    }
  ],
  "height": 275,
  "hullId": "dauntless_destroyer",
  "hullName": "Dauntless_Destroyer",
  "hullSize": "DESTROYER",
  "shieldCenter": [
    0,
    0
  ],
  "shieldRadius": 142.5,
  "spriteName": "graphics/ships/Dauntless_Destroyer.png",
  "style": "MIDLINE",
  "viewOffset": 0,
  "weaponSlots": [
    {
      "angle": 0,
      "arc": 90,
      "id": "WS0001",
      "locations": [
        88,
        -0
      ],
      "mount": "TURRET",
      "size": "MEDIUM",
      "type": "BUILT_IN"
    },
    {
      "angle": 81,
      "arc": 95,
      "id": "WS0002",
      "locations": [
        33,
        9.5
      ],
      "mount": "TURRET",
      "size": "SMALL",
      "type": "BUILT_IN"
    },
    {
      "angle": -81,
      "arc": 95,
      "id": "WS0003",
      "locations": [
        33,
        -9.5
      ],
      "mount": "TURRET",
      "size": "SMALL",
      "type": "BUILT_IN"
    },
    {
      "angle": 80.800003,
      "arc": 95,
      "id": "WS0004",
      "locations": [
        18,
        9.5
      ],
      "mount": "TURRET",
      "size": "SMALL",
      "type": "BUILT_IN"
    },
    {
      "angle": -80.800003,
      "arc": 95,
      "id": "WS0005",
      "locations": [
        18,
        -9.5
      ],
      "mount": "TURRET",
      "size": "SMALL",
      "type": "BUILT_IN"
    },
    {
      "angle": 80.599998,
      "arc": 95,
      "id": "WS0006",
      "locations": [
        4,
        9.5
      ],
      "mount": "TURRET",
      "size": "SMALL",
      "type": "BUILT_IN"
    },
    {
      "angle": -80.599998,
      "arc": 95,
      "id": "WS0007",
      "locations": [
        4,
        -9.5
      ],
      "mount": "TURRET",
      "size": "SMALL",
      "type": "BUILT_IN"
    },
    {
      "angle": 80.400002,
      "arc": 95,
      "id": "WS0008",
      "locations": [
        -10,
        9.5
      ],
      "mount": "TURRET",
      "size": "SMALL",
      "type": "BUILT_IN"
    },
    {
      "angle": -80.400002,
      "arc": 95,
      "id": "WS0009",
      "locations": [
        -10,
        -9.5
      ],
      "mount": "TURRET",
      "size": "SMALL",
      "type": "BUILT_IN"
    },
    {
      "angle": 80.199997,
      "arc": 95,
      "id": "WS0010",
      "locations": [
        -24,
        9.5
      ],
      "mount": "TURRET",
      "size": "SMALL",
      "type": "BUILT_IN"
    },
    {
      "angle": -80.199997,
      "arc": 95,
      "id": "WS0011",
      "locations": [
        -24,
        -9.5
      ],
      "mount": "TURRET",
      "size": "SMALL",
      "type": "BUILT_IN"
    },
    {
      "angle": 80,
      "arc": 95,
      "id": "WS0012",
      "locations": [
        -38.5,
        9.5
      ],
      "mount": "TURRET",
      "size": "SMALL",
      "type": "BUILT_IN"
    },
    {
      "angle": -80,
      "arc": 95,
      "id": "WS0013",
      "locations": [
        -38.5,
        -9.5
      ],
      "mount": "TURRET",
      "size": "SMALL",
      "type": "BUILT_IN"
    },
    {
      "angle": 0,
      "arc": 330,
      "id": "WS0014",
      "locations": [
        34,
        -0
      ],
      "mount": "TURRET",
      "size": "SMALL",
      "type": "HYBRID"
    },
    {
      "angle": 0,
      "arc": 270,
      "id": "WS0015",
      "locations": [
        -29,
        -0
      ],
      "mount": "TURRET",
      "size": "SMALL",
      "type": "HYBRID"
    },
    {
      "angle": 0,
      "arc": 300,
      "id": "WS0016",
      "locations": [
        -2.5,
        -0
      ],
      "mount": "TURRET",
      "size": "SMALL",
      "type": "HYBRID"
    },
    {
      "angle": -90,
      "arc": 180,
      "id": "WS0018",
      "locations": [
        -45.5,
        -1.5
      ],
      "mount": "TURRET",
      "size": "SMALL",
      "type": "BUILT_IN"
    },
    {
      "angle": 0,
      "arc": 0,
      "id": "WS0019",
      "locations": [
        1.5,
        -0
      ],
      "mount": "TURRET",
      "size": "LARGE",
      "type": "DECORATIVE"
    },
    {
      "angle": 0,
      "arc": 0,
      "id": "WS0020",
      "locations": [
        95.5,
        -0
      ],
      "mount": "HARDPOINT",
      "size": "MEDIUM",
      "type": "STATION_MODULE"
    },
    {
      "angle": 90,
      "arc": 180,
      "id": "WS0017",
      "locations": [
        -45.5,
        1.5
      ],
      "mount": "TURRET",
      "size": "SMALL",
      "type": "BUILT_IN"
    },
    {
      "angle": 90,
      "arc": 180,
      "id": "WS0021",
      "locations": [
        -56,
        1.5
      ],
      "mount": "TURRET",
      "size": "SMALL",
      "type": "BUILT_IN"
    },
    {
      "angle": -90,
      "arc": 180,
      "id": "WS0022",
      "locations": [
        -56,
        -1.5
      ],
      "mount": "TURRET",
      "size": "SMALL",
      "type": "BUILT_IN"
    }
  ],
  "width": 162
}
[close]
« Last Edit: December 23, 2017, 09:56:15 AM by Regoso »
Logged

King Alfonzo

  • Admiral
  • *****
  • Posts: 679
  • -- D O C T O R --
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3711 on: December 24, 2017, 06:27:44 PM »

I know, I just KNOW this is going to be a stupid question, but it's something I'm a bit stuck on.

Currently looking to make a basic 'mini-faction' fleet spawner, the idea being fleets of the faction spawn from an entity, raid the system, then return to the entity. This entity is just that - a marketless planet or a space station. This prevents the faction from being conquered or removed, making them an eternal pain in the neck, while also keeping market numbers down and preventing more damage to the economy in the current version. I kind of want to do it up to current spec, as the original method I saw to do this was a tutorial from 0.6 and I'm not sure the code is still functionality.

The problem is this: I have a space station or marketless planet. I want to spawn a fleet from that place, specifically THAT place. How can I do this?

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3712 on: December 27, 2017, 08:08:24 PM »

Alright finally back at this after having to take a couple months off to finish my comp sci degree.  ;D

Still stuck on this encounter in my tutorial, though:

WARNING******** This contains HEAVY story spoilers for Archean Order and the standard tutorial ********WARNING

Spoiler

Context: after you salvage the derelict probe near Pontus, you are ambushed by a Trader Guilds mercenary fleet under the employ of Ancyra's commander just after grabbing the AI core.

I have built in a way to talk to your officers in my mod, and your second (a story character chosen earlier) informs you of the threat before they rush in and the dialogue encounter begins.

At the end of this dialogue, what is SUPPOSED to happen:

- enemy AI death fleet appears. Merc fleet, in dire straights, joins you in a fighting retreat and sacrifices themselves to let the player warn Ancyra.  (teaches the player about retreating)


And what ACTUALLY happens:

- battle happens anyway despite the fleet being forcibly pacified, but auto-resolved?, and the AI fleet doesn't spawn.

Screens of context and error with some devmode memory dumps.
Spoiler















Dont actually have an active battle but...




...battle damage and CR decay behind the scenes.

[close]

[close]

Here is the code that is supposed to implement the context. It is spread out over a couple different files.
Spoiler

rules.csv script entry at the end of the merc dialogue where the error occurs:

Spoiler
MakeOtherFleetHostile false
MakeOtherFleetAggressive false
MakeOtherFleetPreventDisengage false
MakeOtherFleetNonHostile true
MakeOtherFleetNonAggressive true
MakeOtherFleetAllowDisengage true
CallEvent $tut_eventRef startAIMercBattle
AddText "You detect another enemy fleet power up systems nearby." $faction.baseColor
[close]

The script being invoked by rules.csv in ArcheusTutorialMissionEvent.java:

Spoiler
        } else if (action.equals("startAIMercBattle")) {        // invoked with Rules.csv entry under Tutorial Mercenary AI Encounter (dialogue)
            mercCompany.clearAssignments();


            AIDeathFleet = AOGuardMiscFleetManager.createAIDeathFleet(false);
            // used to find the fleet if needed
            AIDeathFleet.setId("tutorial_AI_Deathfleet");
            system.addEntity(AIDeathFleet);

            AIDeathFleet.setLocation(playerFleet.getLocation().x + 200f, playerFleet.getLocation().y + 200f);
            TransmitterTrapSpecial.makeFleetInterceptPlayer(AIDeathFleet, true, 100f);

            BattleCreationContext mercAIBattleContext = Global.getCombatEngine().getContext();
            dialog.startBattle(mercAIBattleContext);

         float distToAI = Misc.getDistance(playerFleet.getLocation(), AIDeathFleet.getLocation());

         if (!mercCompany.isAlive() || distToAI > 900) {
            Global.getSector().reportEventStage(this, "ai_ambush_end", Global.getSector().getPlayerFleet(),
                  MessagePriority.DELIVER_IMMEDIATELY, createSetMessageLocationScript(ancyra));

            updateStage(TutorialMissionStage.RETURN_TO_ANCYRA);
         }
[close]

The script invoked in AOGuardMiscFleetManager.java - "createAIDeathFleet":
Spoiler
public static CampaignFleetAPI createAIDeathFleet(boolean withCaptain) {
        CampaignFleetAPI fleet = createEmptyAIFleet("AI Death Fleet", true);

        WeightedRandomPicker<String> pickerF = new WeightedRandomPicker<String>();
        pickerF.add("glimmer_Assault");
        pickerF.add("lumen_Standard");

        WeightedRandomPicker<String> pickerD = new WeightedRandomPicker<String>();
        pickerD.add("fulgent_Assault");


        WeightedRandomPicker<String> pickerC = new WeightedRandomPicker<String>();
        pickerC.add("brilliant_Standard");


        fleet.getFleetData().addFleetMember(pickerF.pick());
        fleet.getFleetData().addFleetMember(pickerF.pick());
        fleet.getFleetData().addFleetMember(pickerF.pick());
        fleet.getFleetData().addFleetMember(pickerF.pick());
        fleet.getFleetData().addFleetMember(pickerF.pick());
        fleet.getFleetData().addFleetMember(pickerF.pick());
        fleet.getFleetData().addFleetMember(pickerD.pick());
        fleet.getFleetData().addFleetMember(pickerD.pick());
        fleet.getFleetData().addFleetMember(pickerD.pick());
        fleet.getFleetData().addFleetMember(pickerD.pick());
        fleet.getFleetData().addFleetMember(pickerC.pick());
        fleet.getFleetData().addFleetMember(pickerC.pick());
        if (withCaptain) {             // to test if generating specific character necessary

        }

        fleet.getFleetData().sort();

        return fleet;
    }
[close]

The script further up in that file that the above script references - "createEmptyAIFleet(boolean withCaptain)":
Spoiler
    public static CampaignFleetAPI createEmptyAIFleet(String name, boolean withFaction) {
        CampaignFleetAPI fleet = FleetFactory.createEmptyFleet(Factions.REMNANTS, FleetTypes.PATROL_LARGE, null);

        fleet.setName(name);
        fleet.setNoFactionInName(!withFaction);

        fleet.getStats().getFleetwideMaxBurnMod().modifyMult("tutorial", 0.8f);

        fleet.getMemoryWithoutUpdate().set(MemFlags.MEMORY_KEY_PATROL_ALLOW_TOFF, true);
        fleet.getMemoryWithoutUpdate().set(MemFlags.MEMORY_KEY_NO_JUMP, true);
        fleet.getMemoryWithoutUpdate().set("$tut_aiDeathFleet", true);

        return fleet;
    }
[close]


[close]

Any advice or spotting bugs is greatly appreciated!
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3713 on: December 29, 2017, 09:58:48 AM »

Quote
The problem is this: I have a space station or marketless planet. I want to spawn a fleet from that place, specifically THAT place. How can I do this?
Look at FleetFactoryV2.java; it's currently the standardized method for building fleets. 

Also, bear in mind that a MarketAPI doesn't need a planet or anything to attach to, etc.; it can just exist, code-wise, and you can keep it stable, etc., etc. so that it'll produce the results you want.

If you want fleets out of THAT, though, the tricky bit is probably going to be writing code so that fleets from regular Markets can also traverse THAT and show up in nearby Systems if the player's there, too.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Machine

  • Commander
  • ***
  • Posts: 114
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3714 on: December 29, 2017, 03:41:48 PM »

Generally speaking, larger ships are rendered before smaller ships, and since station modules need to be FRIGATE for various reasons, this means they'll render above the engine glows of most other ships.

Alex, mainly for curiosity, could you elaborate on the various reasons?, since I have coded a ship using a module based shield shipsystem that has a script to set its collision class as a fighter, I tested it with a module that was an actual fighter and it seemed to work normally, the only undesirable thing I can remember is it showed as "Secondary Shield Wing" in its armaments list.

Also, I tried to give the same shipsystem to a fighter, and it seems it somewhat worked, since it appeared on the codex, but when spawned from a carrier they would lose it. Not sure if this is intended or some type of bug, but I guess ship modules on fighters were never supported to start with.

Stuff not relevant to the question, just some background info why I'm working with/want this.
Spoiler
To add some info on how I coded it, the shield module has a custom AI that activates its shield when its parent shipsystem is active, otherwise it turns it off. This is mainly to avoid the AI or player flickering the shields by taking its control out of their hands, without being too intrusive, like writing a complete new AI. Regarding the shipsystem itself, it is not important and it could be a dummy for all that matters...
Currently using this as a base for my mod's Ram Drive and Burt Shield shipsystems, the later one being the one alluded at the start (instant fighter collision bubble shield that grows in size for a short while and then dissipates).
[close]
Logged

AxleMC131

  • Admiral
  • *****
  • Posts: 1722
  • Amateur World-Builder
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3715 on: December 29, 2017, 03:51:40 PM »

Generally speaking, larger ships are rendered before smaller ships, and since station modules need to be FRIGATE for various reasons, this means they'll render above the engine glows of most other ships.

Alex, mainly for curiosity, could you elaborate on the various reasons?

I'm fairly sure one reason is to avoid cheesing of module loadouts - if a module is a FRIGATE, then you can't equip it with Converted Hangar for instance.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3716 on: December 29, 2017, 06:23:01 PM »

Alex, mainly for curiosity, could you elaborate on the various reasons?, since I have coded a ship using a module based shield shipsystem that has a script to set its collision class as a fighter, I tested it with a module that was an actual fighter and it seemed to work normally, the only undesirable thing I can remember is it showed as "Secondary Shield Wing" in its armaments list.

Fighters may actually be fine - you don't want larger ships, because they would cause screen whiteout when they explode. I know there was a second reason but I can't think of it right now.

One thing about FIGHTER-size modules is they won't collide with other ships, so depending on where on the sprite it's located that may or may not be a problem.

... but I guess ship modules on fighters were never supported to start with.

Yeah, that's not currently supported.
Logged

AxleMC131

  • Admiral
  • *****
  • Posts: 1722
  • Amateur World-Builder
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3717 on: December 29, 2017, 08:49:33 PM »

Fighters may actually be fine...

... One thing about FIGHTER-size modules is they won't collide with other ships, so depending on where on the sprite it's located that may or may not be a problem.

Huh. This actually hadn't occured to me as something that worked. Wonder how I can make use of this?  ;)
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4661
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3718 on: December 31, 2017, 05:20:17 AM »

I'm trying to force a fleet to attack a station, but they keep breaking off the battle after two seconds or so (apparently before the first autoresolve round) and going to the stand-down assignment. Is there a way to make them not do this?
Code: java
CampaignFleetAPI station = DefenceStationManager.getManager().getFleet(data.targetMarket);
if (station != null)
{
// clear "do not attack" memory
fleet.getAI().doNotAttack(station, 0);
fleet.getAI().advance(1);

if (fleet.getBattle() != null) fleet.getBattle().join(station);
else if (station.getBattle() != null) station.getBattle().join(fleet);
else {
Global.getFactory().createBattle(fleet, station);
fleet.getBattle().genCombined();
fleet.getBattle().takeSnapshots();
}
}
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3719 on: December 31, 2017, 08:29:59 AM »

Hmm - looking at the code, not seeing how that might happen - not saying that it couldn't, but definitely not seeing a path that would do that.

I'd expect it to get an autoresolve round in; the delay before the first autoresolve round is .8 to 1.2 seconds, so that would be in line with an autoresolve round happening and then this. What would cause this to happen, then, is one of the fleets deciding to disengage after the autoresolve round, i.e.:

getCombinedOne().getAI().pickEncounterOption(auto.getContext(), getCombinedOne()) == EncounterOption.DISENGAGE

I *think* massively increasing the fleet points value of the station might do the job here, it's the only thing that comes to mind that might. Assuming it's the one picking to run, and not the fleet. The larger fleet strength has to be less than double the weaker to avoid a disengage.

(I'm pretty sure you need a custom autoresolve plugin to handle station battles, btw, but iirc you're aware of this.)
Logged
Pages: 1 ... 246 247 [248] 249 250 ... 706