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

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

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3720 on: December 31, 2017, 02:52:18 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!


Going to attempt to get back on this now that the mod is released and fairly well showcased. Anyone take a crack at it?

I just have a sinking suspicion its going to take me completely reverse engineering FleetInteractionDialogPluginImpl.java lol
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4661
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3721 on: January 01, 2018, 01:11:54 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.
Hmm you're right, the station is disengaging from the fight after the first autoresolve round. I tried forcing its encounter option in resolve() to HOLD_VS_STRONGER / HOLD / ENGAGE but it still disengages after the first round. :(

Worked around it for now by making it run 50 autoresolve rounds at once (within the scope of a single resolve()) when this happens.
I don't want to mess with the FP values too much because of the potential side effects, e.g. if I make the station not run when it's outmatched, the fleet might run when they actually have parity.
« Last Edit: January 01, 2018, 01:17:36 AM by Histidine »
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 #3722 on: January 04, 2018, 02:43:37 AM »

This is probably stupid, but getting a nullpointerexception:

Code
211947 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.NullPointerException
java.lang.NullPointerException
at com.fs.starfarer.campaign.CircularOrbitPointDown.advance(Unknown Source)
at com.fs.starfarer.campaign.BaseLocation.updateAllOrbits(Unknown Source)
at com.fs.starfarer.campaign.StarSystem.autogenerateHyperspaceJumpPoints(Unknown Source)
at com.fs.starfarer.campaign.StarSystem.autogenerateHyperspaceJumpPoints(Unknown Source)
at data.scripts.world.systems.HMI_hazard.generate(HMI_hazard.java:103)
at data.scripts.world.HMI_gen.generate(HMI_gen.java:20)
at data.scripts.HMI_modPlugin.initHMI(HMI_modPlugin.java:16)
at data.scripts.HMI_modPlugin.onNewGame(HMI_modPlugin.java:24)
at com.fs.starfarer.campaign.save.CampaignGameManager.o00000(Unknown Source)
at com.fs.starfarer.title.TitleScreenState.dialogDismissed(Unknown Source)
at com.fs.starfarer.ui.Oo0O.dismiss(Unknown Source)
at com.fs.starfarer.ui.impl.J.dismiss(Unknown Source)
at com.fs.starfarer.campaign.save.if.actionPerformed(Unknown Source)
at com.fs.starfarer.ui.j.super(Unknown Source)
at com.fs.starfarer.ui.I.processInput(Unknown Source)
at com.fs.starfarer.ui.V.o00000(Unknown Source)
at com.fs.starfarer.BaseGameState.traverse(Unknown Source)
at com.fs.state.AppDriver.begin(Unknown Source)
at com.fs.starfarer.combat.CombatMain.main(Unknown Source)
at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

The region in question:

Code
		JumpPointAPI jumpPoint = Global.getFactory().createJumpPoint("hazard_jumpPointB", "Chan Huan Jump-point");
OrbitAPI orbitouter = Global.getFactory().createCircularOrbit(hazard2, 270, 6000, 350);
jumpPoint.setOrbit(orbitouter);
jumpPoint.setRelatedPlanet(hazard2);
jumpPoint.setStandardWormholeToHyperspaceVisual();
system.addEntity(jumpPoint);

// generates hyperspace destinations for in-system jump points
system.autogenerateHyperspaceJumpPoints(true, true);

cleanup(system);
}

Not entirely sure what I've done wrong.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3723 on: January 04, 2018, 10:45:44 AM »

Call orbit.setEntity(jumpPoint). It really ought to be a parameter to createXXXOrbit, but isn't for some reason.
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 #3724 on: January 04, 2018, 11:18:52 PM »

Call orbit.setEntity(jumpPoint). It really ought to be a parameter to createXXXOrbit, but isn't for some reason.

No dice, I still get the error. The error is specifically at the generate jump points line, if that helps.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3725 on: January 05, 2018, 09:14:16 AM »

Ahh, right, you don't need to call setEntity() because that happens in the jumpPoint.setOrbit(orbitouter); method. Forgot about that, explains why it's not a parameter.

That said: can you make sure that commenting out this jump-point removes the crash? Looking at this again, the crash is in a CircularOrbitPointDown, not CircularOrbit, so it's entirely unrelated to the jump-point or to any jump exits the autogenerate() method might create, which would also have CircularOrbits (without PointDown).

What happens is before/after generating new jump-points, the autogen method will update the locations of all entities - in-system, and in-hyper after - by calling advance() on their orbits with a duration of 0. One of these entities has a misconfigured CircularOrbitPointDown and that causes the crash.



(Also, it's probably easier to just set the orbit like this:
jumpPoint.setCircularOrbit(hazard2 ,270, 6000, 350);
But that shouldn't matter here.)
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 #3726 on: January 05, 2018, 04:19:28 PM »

That said: can you make sure that commenting out this jump-point removes the crash? Looking at this again, the crash is in a CircularOrbitPointDown, not CircularOrbit, so it's entirely unrelated to the jump-point or to any jump exits the autogenerate() method might create, which would also have CircularOrbits (without PointDown).

What happens is before/after generating new jump-points, the autogen method will update the locations of all entities - in-system, and in-hyper after - by calling advance() on their orbits with a duration of 0. One of these entities has a misconfigured CircularOrbitPointDown and that causes the crash.

Well I'm a dumbass. I've been trying to find the star for a CircularOrbitPointDown by using a "system.getEntityById". Replacing this with just the id and nothing else fixes the problem.

Thanks Alex!

EDIT: ...aaaand now I'm back on the spawn fleets from a thing problem. I've tried using the LuddicPathFleetManager as the basis. Glancing at Histidine's SWP interstellar bounty script, and scripts from DR's Templar and Interstellar Imperium, I thought the general gist of what I was attempting should work.

I started changing the references to luddic church / luddic path / kol to the faction name.  While the weighted picker presumably looks through all the markets, it'll pick the one that is owned by the faction to spawn at. I have a planet, that has no actual market, but is owned by the faction, so presumably this should work. It didn't.  I changed the weighted picker from market ownership, to id of the market, thinking it'd search all the markets for that id, and then spawn it from that market. While the market doesn't exist, the id does. That didn't work either. Then I changed it from a market to a planet, thinking that's fix it. It didn't work. Finally, I just searched all entities for that entity (Which I think is the absolute wrongest thing to do). This, again, didn't work.

I feel on some fundamental level I am missing something important. The way I interpret it, is:

-Manager determines max number of fleets - I have this set up identical to the weightedpicker - if the planet is there, spawn 5 fleets, if not (Nexerellin), then don't
-Manager spawns fleet at a place determined by the picker
-Determines size of fleet
-Spawns the fleet for real
-Figures out whether the fleet spawns at a source (which is different from the target...?) or spawns it in hyperspace, depending how close the player is to either (???)
-Gives assignments - raid system, go to system and raid, etc.
-Figures out the target system from a weighted picker

Considering you should be able to spawn fleets from anything (even if it's not a market) using fleetfactoryv2, and it should pick the highest weighted thing (even if it's not a market) to spawn from, and everytime I tried it didn't work, then there is clearly something very wrong with how I'm looking at the problem. Could anyone take this bag of snakes and lay it out straight please?

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3727 on: January 07, 2018, 08:23:45 PM »

Is this an outdated or bugged method or do I have any errors here?

Generic:
PlanetAPI      StarSystemAPI system.addPlanet(String Id, SectorEntityToken focus, String name, String type, Float angle, Float radius, Float orbitRadius, String faction);


This implementation
:

PlanetAPI penumbros = system.addPlanet("penumbros_archeus", star, "Penumbros", "jungle", 45f, 180f, 15000f, 600f);
penumbros.setCustomDescriptionId("planet_penumbros");

Causes this error when clicking "Show Info" on any planet in the same system using the Intel Map:

**Edit** I am now 99.9% sure this is caused by attempting to cast StarSystemAPI ("star") to SectorEntityToken.

Used:         SectorEntityToken focus = (SectorEntityToken) star;
Got Error

Used:         SectorEntityToken focus = star.getOrbitFocus();
No Error

But that puts the planet in the middle of the star since presumably the star's "orbital anchor" is in hyperspace.

Searching for a workaround to still use the star as the orbital focus for the planet.


**Edit 2**: Well... nvm. >:( I must not be adding something to the planet I should be, because:

        StarSystemAPI system = sector.getStarSystem("hybrasil");
        SectorEntityToken focus = system.getCenter();
        PlanetAPI penumbros = system.addPlanet("penumbros_archeus", focus, "Penumbros", "jungle", 145, 180, 7000, 600);

- Makes the planet spawn, and even in the correct location, but I still get the crash when I try to view it on the map.

Spoiler
28316 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.NullPointerException
java.lang.NullPointerException
   at com.fs.starfarer.campaign.ui.intel.o0OO.void.return$new(Unknown Source)
   at com.fs.starfarer.campaign.ui.intel.o0OO.afterSizeFirstChanged(Unknown Source)
   at com.fs.starfarer.ui.Q.sizeChanged(Unknown Source)
   at com.fs.starfarer.ui.OO0O.set(Unknown Source)
   at com.fs.starfarer.ui.thisnew.super(Unknown Source)
   at com.fs.starfarer.ui.j.advanceImpl(Unknown Source)
   at com.fs.starfarer.ui.Q.advance(Unknown Source)
   at com.fs.starfarer.ui.OO00.advanceImpl(Unknown Source)
   at com.fs.starfarer.campaign.ui.intel.O0oO.advanceImpl(Unknown Source)
   at com.fs.starfarer.ui.Q.advance(Unknown Source)
   at com.fs.starfarer.ui.OO00.advanceImpl(Unknown Source)
   at com.fs.starfarer.campaign.ui.intel.B.advanceImpl(Unknown Source)
   at com.fs.starfarer.ui.Q.advance(Unknown Source)
   at com.fs.starfarer.campaign.ui.intel.B.Ò00000(Unknown Source)
   at com.fs.starfarer.ui.newui.if$7.actionPerformed(Unknown Source)
   at com.fs.starfarer.ui.newui.if.setCurrentTab(Unknown Source)
   at com.fs.starfarer.campaign.CampaignState.showCoreUITab(Unknown Source)
   at com.fs.starfarer.coreui.map.A.super(Unknown Source)
   at com.fs.starfarer.coreui.map.Objectsuper.processInputImpl(Unknown Source)
   at com.fs.starfarer.ui.Q.processInput(Unknown Source)
   at com.fs.starfarer.ui.V.o00000(Unknown Source)
   at com.fs.starfarer.BaseGameState.traverse(Unknown Source)
   at com.fs.state.AppDriver.begin(Unknown Source)
   at com.fs.starfarer.combat.CombatMain.main(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
[close]

I have narrowed the bug down to these two lines specifically using incremental, controlled rollbacks. The system in question is the Hybrasil system, but I don't think that makes a difference.
« Last Edit: January 07, 2018, 09:38:10 PM by Morrokain »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3728 on: January 07, 2018, 09:01:01 PM »

Considering you should be able to spawn fleets from anything (even if it's not a market) using fleetfactoryv2, and it should pick the highest weighted thing (even if it's not a market) to spawn from, and everytime I tried it didn't work, then there is clearly something very wrong with how I'm looking at the problem. Could anyone take this bag of snakes and lay it out straight please?

IIRC FleetFactoryV2 does need a market - if you don't provide one, it'll look for the nearest one of the same faction, and if that fails, I think it will abort. So if a faction doesn't have any markets, that'll be trouble.


@Morrokain: wait, uhh. "star" is a StarSystemAPI? That makes no sense, the code wouldn't even compile with that as the second parameter.

I did paste this into Hybrasil.java:

PlanetAPI penumbros = system.addPlanet("penumbros_archeus", hybrasil_star, "Penumbros", "jungle", 45f, 180f, 15000f, 600f);
penumbros.setCustomDescriptionId("planet_culann");

And it seemed to work fine - planet shows up, can click show planet info fine.
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 #3729 on: January 07, 2018, 09:49:08 PM »


IIRC FleetFactoryV2 does need a market - if you don't provide one, it'll look for the nearest one of the same faction, and if that fails, I think it will abort. So if a faction doesn't have any markets, that'll be trouble.


@Morrokain: wait, uhh. "star" is a StarSystemAPI? That makes no sense, the code wouldn't even compile with that as the second parameter.

I did paste this into Hybrasil.java:

PlanetAPI penumbros = system.addPlanet("penumbros_archeus", hybrasil_star, "Penumbros", "jungle", 45f, 180f, 15000f, 600f);
penumbros.setCustomDescriptionId("planet_culann");

And it seemed to work fine - planet shows up, can click show planet info fine.

Where is that file? How are you getting hybrasil_star?
Logged

AxleMC131

  • Admiral
  • *****
  • Posts: 1722
  • Amateur World-Builder
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3730 on: January 07, 2018, 09:58:07 PM »

Where is that file?

Code
starsector_core > data > scripts > world > systems > Hybrasil.java

Ain't you making a Total Conversion?  :P Don't tell me you don't know your way around the core files!

(Just jesting, I'm sure there's ample stuff I'm not aware of in the files, let alone the API)
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 #3731 on: January 07, 2018, 10:13:53 PM »

Where is that file?

Code
starsector_core > data > scripts > world > systems > Hybrasil.java

Ain't you making a Total Conversion?  :P Don't tell me you don't know your way around the core files!

(Just jesting, I'm sure there's ample stuff I'm not aware of in the files, let alone the API)

 :-[  ::) Omg.

Haha, no I knew at one time.

It actually had been a while since I messed with creating campaign planets (like .5 ish??) and couldn't remember where they were. I was looking in the zipped API folder when I was looking for it originally since that's where the vast majority of .java files are. Ugh I'm dying.

Honestly... forgot about that scripts directory all together and that might be the whole problem.

I was creating it by:


public class archeusGen implements SectorGeneratorPlugin {
   
    @Override
    public void generate(SectorAPI sector) {
        initFactionRelationships(sector);

        new archeusCorvusGen().generate(sector);
        new archeusHybrasilGen().generate(sector);
    }
}

It was based around an older version of Mayorate. You can apparently do this with stations but I'm now guessing not with planets. Guess I'll find out soon...
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 #3732 on: January 07, 2018, 11:05:55 PM »


I did paste this into Hybrasil.java:

PlanetAPI penumbros = system.addPlanet("penumbros_archeus", hybrasil_star, "Penumbros", "jungle", 45f, 180f, 15000f, 600f);
penumbros.setCustomDescriptionId("planet_culann");

And it seemed to work fine - planet shows up, can click show planet info fine.

Wow yup, copy-pasted my code into that file, removed the other one, and it solves the issue. Hm. So I guess I have to copy/replace each system file that I want to add things to.
« Last Edit: January 07, 2018, 11:07:26 PM by Morrokain »
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 #3733 on: January 08, 2018, 01:35:27 AM »

IIRC FleetFactoryV2 does need a market - if you don't provide one, it'll look for the nearest one of the same faction, and if that fails, I think it will abort. So if a faction doesn't have any markets, that'll be trouble.

What defines a 'market' exactly? Is it a planet? Or is it a planet with an interactable store etc.?

Histidine

  • Admiral
  • *****
  • Posts: 4661
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3734 on: January 08, 2018, 04:49:16 AM »

IIRC FleetFactoryV2 does need a market - if you don't provide one, it'll look for the nearest one of the same faction, and if that fails, I think it will abort. So if a faction doesn't have any markets, that'll be trouble.

What defines a 'market' exactly? Is it a planet? Or is it a planet with an interactable store etc.?
"Planet/station with store" (or a planet/station combination, like Jangala) is probably a sufficient player-facing description, yeah.

If you don't have or want one, you can create a fake market for the script, like so:
MarketAPI fakeMarket = Global.getFactory().createMarket("spawner_fake_market", "[market name]", [market size]);

Make sure to change your spawner code so that it doesn't try to spawn fleets at the market's location, since the fake market doesn't have one.
Logged
Pages: 1 ... 247 248 [249] 250 251 ... 706