找回密码
 初始化身份识别芯片
查看: 150|回复: 15

自己搓一个星系一靠近就null崩溃怎么回事

[复制链接]

驱逐技师

发表于 2024-12-14 19:56:14 | 显示全部楼层 |阅读模式
如题

自己搓了个星系,目前游戏启动无异常,生涯进入大地图生成无异常,能在大地图上看到星系位置,开局就在星系里的时候能按tab打开星系地图,看到星系里各种星球、星系建筑、星球特性生成似乎无异常(但是因为很快就跳出崩溃了我也不确定正不正常)。
但是一旦进入或是超空间靠近星系就会崩溃掉,提示关键词是null之类的。
我好不容易搓的轮椅星系呀

驱逐技师

 楼主| 发表于 2024-12-14 19:58:15 | 显示全部楼层
星系里有星门,有三稳定点建筑,但是好像星球和星门距离太近重叠了,会是这个原因吗

势力巨擘

╭﹌☆﹌﹌﹌☆﹌╮ ∣        ∣ ∣  ●   ●

发表于 2024-12-14 20:21:33 | 显示全部楼层

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?初始化身份识别芯片

×

驱逐技师

 楼主| 发表于 2024-12-14 20:32:58 | 显示全部楼层
59595 [Thread-3] INFO  com.fs.starfarer.loading.LoadingUtils  - Loading JSON from [DIRECTORY: D:\Inperfect\Game_collects\Starsector 0.97\starsector-core\..\mods\Nexerelin (data/config/exerelin/factionSetupDefs.json)]
63832 [Thread-3] INFO  exerelin.world.factionsetup.BlueprintItem  - Adding special item: midline_package, null
64196 [Thread-3] INFO  com.fs.starfarer.api.impl.campaign.fleets.EconomyFleetRouteManager  - Added trade fleet route from Sindria    Coatl
67451 [Thread-3] INFO  com.fs.starfarer.api.impl.campaign.intel.AnalyzeEntityMissionIntel  - Created AnalyzeEntityMissionIntel:   ֮  -  ̽  , faction: Ӣ        
68089 [Thread-3] INFO  com.fs.starfarer.api.impl.campaign.fleets.EconomyFleetRouteManager  - Added trade fleet route from Asharu    Sphinx
75250 [Thread-7] INFO  sound.O  - Cleaning up music with id [miscallenous_corvus_campaign_music.ogg]
75391 [Thread-10] INFO  sound.O  - Creating streaming player for music with id [miscallenous_corvus_campaign_music.ogg]
75392 [Thread-10] INFO  sound.OooO  - Playing music with id [miscallenous_corvus_campaign_music.ogg]
76309 [Thread-3] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.NullPointerException
java.lang.NullPointerException
        at com.fs.starfarer.ui.impl.ooOO$1.createImpl(Unknown Source)
        at com.fs.starfarer.ui.impl.StandardTooltipV2Expandable.create(Unknown Source)
        at com.fs.starfarer.ui.impl.StandardTooltipV2Expandable.beforeShown(Unknown Source)
        at com.fs.starfarer.campaign.F.super(Unknown Source)
        at com.fs.starfarer.campaign.CampaignEngine.advance(Unknown Source)
        at com.fs.starfarer.campaign.CampaignState.advance(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.super(Unknown Source)
        at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

点评

从日志log文件里截了最后一段,有懂的人看看吗  详情 回复 发表于 2024-12-14 20:33

驱逐技师

 楼主| 发表于 2024-12-14 20:33:46 | 显示全部楼层
遥远繁星 发表于 2024-12-14 20:32
59595 [Thread-3] INFO  com.fs.starfarer.loading.LoadingUtils  - Loading JSON from [DIRECTORY: D:\Inp ...

从日志log文件里截了最后一段,有懂的人看看吗

驱逐技师

 楼主| 发表于 2024-12-14 20:34:51 | 显示全部楼层
以及我是不是应该清一下log日志了

驱逐技师

 楼主| 发表于 2024-12-14 20:49:34 | 显示全部楼层
难道是因为我没有给恒星设置跳跃点?

星域军阀

高级机师

发表于 2024-12-14 21:40:12 | 显示全部楼层

这种触发原版内核代码报错的log基本没有什么可读价值
我觉得你得把星系生成的码以及调用并执行星系生成的代码都发上来看看

驱逐技师

 楼主| 发表于 2024-12-14 22:40:57 | 显示全部楼层

改了一下代码,现在星系内该生成的东西都正常了,但还是null跳出崩溃

本帖最后由 遥远繁星 于 2024-12-15 08:56 编辑


package data.scripts.world.systems;

import com.fs.starfarer.api.Global;
import com.fs.starfarer.api.campaign.*;
import com.fs.starfarer.api.campaign.econ.*;
import com.fs.starfarer.api.campaign.CargoAPI.CargoItemType;
import com.fs.starfarer.api.campaign.JumpPointAPI;
import com.fs.starfarer.api.campaign.LocationAPI;
import com.fs.starfarer.api.campaign.PlanetAPI;
import com.fs.starfarer.api.campaign.SectorAPI;
import com.fs.starfarer.api.campaign.SectorEntityToken;
import com.fs.starfarer.api.campaign.StarSystemAPI;
import com.fs.starfarer.api.impl.campaign.procgen.StarSystemGenerator;
import com.fs.starfarer.api.fleet.FleetMemberType;
import com.fs.starfarer.api.impl.*;
import com.fs.starfarer.api.impl.campaign.ids.*;
import com.fs.starfarer.api.impl.campaign.procgen.*;
import com.fs.starfarer.api.impl.campaign.terrain.BaseRingTerrain.RingParams;
import com.fs.starfarer.api.impl.campaign.terrain.MagneticFieldTerrainPlugin.*;
import com.fs.starfarer.api.impl.campaign.terrain.AsteroidFieldTerrainPlugin.AsteroidFieldParams;
import com.fs.starfarer.api.impl.campaign.terrain.BaseRingTerrain;
import com.fs.starfarer.api.util.Misc;
import org.magiclib.util.MagicCampaign;
import indevo.industries.artillery.utils.ArtilleryStationPlacer;

import java.util.*;
import java.util.HashMap;
import java.util.Map;

public class LostFortess {

    public void generate(SectorAPI sector) {
        
        StarSystemAPI system = sector.createStarSystem("失落要塞");
        system.getLocation().set(-1400, -6000);
        system.setBackgroundTextureFilename("graphics/backgrounds/background4.jpg");

        PlanetAPI LF_star = system.initStar("LostFortess", "star_blue_giant", 800f, 400f);
        
        PlanetAPI LF_planet1 = system.addPlanet("LostFortess_planet1", LF_star, "要塞核心", "terran", 0f, 300f, 4500f, 372f);
        LF_planet1.setCustomDescriptionId("LostFortess_planet1");
        MarketAPI LF_planet1_market = Global.getFactory().createMarket("LostFortess_planet1_market", LF_planet1.getName(), 0);
        LF_planet1_market.setPlanetConditionMarketOnly(true);
        LF_planet1_market.addCondition("habitable");
        LF_planet1_market.addCondition("mild_climate");
        LF_planet1_market.addCondition("farmland_bountiful");
        LF_planet1_market.addCondition("stealth_minefields");
        LF_planet1_market.addCondition("ruins_vast");
        LF_planet1_market.addCondition("regional_capital");
        LF_planet1_market.addCondition("trade_center");
        LF_planet1_market.setPrimaryEntity(LF_planet1);
        LF_planet1.setMarket(LF_planet1_market);
        
        PlanetAPI LF_planet1a = system.addPlanet("LostFortess_planet1a", LF_planet1, "守望", "lava", 0f, 150f, 900f, 124f);
        MarketAPI LF_planet1a_market = Global.getFactory().createMarket("LostFortess_planet1a_market", LF_planet1a.getName(), 0);
        LF_planet1a_market.setPlanetConditionMarketOnly(true);
        LF_planet1a_market.addCondition("very_hot");
        LF_planet1a_market.addCondition("ruins_vast");
        LF_planet1a_market.addCondition("volatiles_plentiful");
        LF_planet1a_market.addCondition("organics_plentiful");
        LF_planet1a_market.addCondition("rare_ore_ultrarich");
        LF_planet1a_market.addCondition("ore_ultrarich");
        LF_planet1a_market.addCondition("stealth_minefields");
        LF_planet1a_market.setPrimaryEntity(LF_planet1a);
        LF_planet1a.setMarket(LF_planet1a_market);
        ArtilleryStationPlacer.addArtilleryToPlanet(LF_planet1a_market.getPrimaryEntity(), true);

        PlanetAPI LF_planet1b = system.addPlanet("LostFortess_planet1b", LF_planet1, "缄默", "lava", 120f, 150f, 900f, 124f);
        MarketAPI LF_planet1b_market = Global.getFactory().createMarket("LostFortess_planet1b_market", LF_planet1b.getName(), 0);
        LF_planet1b_market.addCondition("very_hot");
        LF_planet1b_market.addCondition("ruins_vast");
        LF_planet1b_market.addCondition("volatiles_plentiful");
        LF_planet1b_market.addCondition("organics_plentiful");
        LF_planet1b_market.addCondition("rare_ore_ultrarich");
        LF_planet1b_market.addCondition("ore_ultrarich");
        LF_planet1b_market.addCondition("stealth_minefields");
        LF_planet1b_market.setPrimaryEntity(LF_planet1b);
        LF_planet1b.setMarket(LF_planet1b_market);
        ArtilleryStationPlacer.addArtilleryToPlanet(LF_planet1b_market.getPrimaryEntity(), true);

        PlanetAPI LF_planet1c = system.addPlanet("LostFortess_planet1c", LF_planet1, "审判", "lava", 240f, 150f, 900f, 124f);
        MarketAPI LF_planet1c_market = Global.getFactory().createMarket("LostFortess_planet1c_market", LF_planet1c.getName(), 0);
        LF_planet1c_market.setPlanetConditionMarketOnly(true);
        LF_planet1c_market.addCondition("very_hot");
        LF_planet1c_market.addCondition("ruins_vast");
        LF_planet1c_market.addCondition("volatiles_plentiful");
        LF_planet1c_market.addCondition("organics_plentiful");
        LF_planet1c_market.addCondition("rare_ore_ultrarich");
        LF_planet1c_market.addCondition("ore_ultrarich");
        LF_planet1c_market.addCondition("stealth_minefields");
        LF_planet1c_market.setPrimaryEntity(LF_planet1c);
        LF_planet1c.setMarket(LF_planet1c_market);
        ArtilleryStationPlacer.addArtilleryToPlanet(LF_planet1c_market.getPrimaryEntity(), true);

        JumpPointAPI LF_JumpPoint = Global.getFactory().createJumpPoint("LostFortess_jump", "失落要塞跳跃点");
        LF_JumpPoint.setCircularOrbit( LF_star, 180f, 4500f, 372f);
        LF_JumpPoint.setRelatedPlanet(LF_planet1);
        system.addEntity(LF_JumpPoint);

        SectorEntityToken gate = system.addCustomEntity("LF_gate", "深渊之门", "inactive_gate", null);
        gate.setCircularOrbit(LF_star, 0f, 6000f, 372f);

        CustomCampaignEntityAPI customCampaignEntityAPI1 = system.addCustomEntity("LF_Array", "共感", "sensor_array", "neutral");
        customCampaignEntityAPI1.setCircularOrbitPointingDown(LF_star, 0f, 1800f, 372f);
        CustomCampaignEntityAPI customCampaignEntityAPI2 = system.addCustomEntity("LF_Relay", "同心", "comm_relay", "neutral");
        customCampaignEntityAPI2.setCircularOrbitPointingDown(LF_star, 128f, 1800f, 372f);
        CustomCampaignEntityAPI customCampaignEntityAPI3 = system.addCustomEntity("LF_Buoy", "连结", "nav_buoy", "neutral");
        customCampaignEntityAPI3.setCircularOrbitPointingDown(LF_star, 240f, 1800f, 372f);
        
        CustomCampaignEntityAPI IndEvo_Watchtower1 = system.addCustomEntity("IndEvo_Watchtower1", null, "IndEvo_Watchtower", null);
        IndEvo_Watchtower1.setCircularOrbitPointingDown((SectorEntityToken)LF_JumpPoint, 0f, 100f, 372f);
        CustomCampaignEntityAPI IndEvo_Watchtower2 = system.addCustomEntity("IndEvo_Watchtower1", null, "IndEvo_Watchtower", null);
        IndEvo_Watchtower2.setCircularOrbitPointingDown(system.getEntityById("LF_gate"), 0f, 100f, 372f);

        system.autogenerateHyperspaceJumpPoints(false, false);
    }
}

点评

一下午了也没整明白,彻底红温了 引用部分是复制的其他mod(指MFGA的,因为自己没正经学过java不知道怎么用) 目前除了null以外的问题主要是本应生成在跳跃点附近的工革观测站总是生成在恒星中央,怎么  详情 回复 发表于 2024-12-14 22:44

驱逐技师

 楼主| 发表于 2024-12-14 22:44:00 | 显示全部楼层
遥远繁星 发表于 2024-12-14 22:40
package data.scripts.world.systems;

import com.fs.starfarer.api.Global;

一下午了也没整明白,彻底红温了
引用部分是复制的其他mod(指MFGA的,因为自己没正经学过java不知道怎么用
目前除了null以外的问题主要是本应生成在跳跃点附近的工革观测站总是生成在恒星中央,怎么改都没用(注释掉这一段后反而进不去游戏了

点评

然而星门那里的观瞄站却能正常生成(至少看上去正常),完全不能理解 好像也不正常,我似乎改不动这个观瞄站距离轴心的距离  详情 回复 发表于 2024-12-14 22:47

驱逐技师

 楼主| 发表于 2024-12-14 22:47:10 | 显示全部楼层
遥远繁星 发表于 2024-12-14 22:44
一下午了也没整明白,彻底红温了
引用部分是复制的其他mod(指MFGA的,因为自己没正经学过java不 ...

然而星门那里的观瞄站却能正常生成(至少看上去正常),完全不能理解
好像也不正常,我似乎改不动这个观瞄站距离轴心的距离

势力巨擘

╭﹌☆﹌﹌﹌☆﹌╮ ∣        ∣ ∣  ●   ●

发表于 7 天前 | 显示全部楼层
布吉岛,可能是没有工革的炮台确有工革的观瞄站导致的吧

点评

有生成炮台啊  详情 回复 发表于 7 天前

驱逐技师

 楼主| 发表于 7 天前 | 显示全部楼层
墨语流年恰似水 发表于 2024-12-15 00:47
布吉岛,可能是没有工革的炮台确有工革的观瞄站导致的吧

有生成炮台啊

势力巨擘

╭﹌☆﹌﹌﹌☆﹌╮ ∣        ∣ ∣  ●   ●

发表于 7 天前 | 显示全部楼层
那就布吉岛了,如果只要星系的话建议直接用自定义星系mod

驱逐技师

 楼主| 发表于 7 天前 | 显示全部楼层
爆改引用,主打一个把能见到的都复制过来
还是不行

驱逐技师

 楼主| 发表于 7 天前 | 显示全部楼层
我把跳跃点的关联星球从主行星改成了恒星,现在它运行得相当稳定,至少在我短暂的测试时间内稳定,我甚至从行星缓慢航行到了跳跃点并多次进出而没有发生崩溃
但是........


对....对吗?

what can i say



本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?初始化身份识别芯片

×

本版积分规则

Archiver|手机版|小黑屋|远行星号中文论坛

GMT+8, 2024-12-22 01:19

Powered by Discuz! X3.5

© 2001-2077 Tencent Cloud | Durian Software Studio

快速回复 返回顶部 返回列表