ReikaKalseki / Reika_FactorioMods_Issues

The issue tracker for all of my Factorio mods - EndgameCombat, NauvisDay, Geothermal, Oreverhaul, and the rest.
5 stars 1 forks source link

Game crashing. Not sure why. Error while running event EndgameCombat::on_entity_damaged (ID 103) Target must have health. #431

Open Thorsdragon12 opened 8 months ago

Thorsdragon12 commented 8 months ago

I'm getting this error which causes the game to crash:

The mod Endgame Combat (1.152.1) caused a non-recoverable error. Please report this error to the mod author.

Error while running event EndgameCombat::on_entity_damaged (ID 103) Target must have health. stack traceback: [C]: in function 'create_entity' EndgameCombat/functions.lua:445: in function 'doRetaliation' EndgameCombat/control.lua:590: in function <EndgameCombat/control.lua:556>

I have a bunch of mods installed. This autosave happened seconds before the crash. Please let me know if you need anymore info. :) _autosave1.zip

VincePayne42 commented 8 months ago

I"m getting the same error, one of the things that's triggering it is the AAI ironclad mortar doing friendly fire, but I know my friends who are on the same server have triggered it a few different ways. Hope this helps.

MegaCoreRoy commented 8 months ago

Got the same issue, always when under attack. Not using AAI.

MegaCoreRoy commented 8 months ago

Hmm, just figured out it is triggered when radar damages biters through the discharge defence tech. Hope this helps.

Dargrotek commented 7 months ago

Just to add to this, error also occurs when construction Robots are hit. Was attacking a nest, robots deployed to pick up Alien Tissue, got hit and crashed. Error identical to OPs except for the control.lua line

The mod Endgame Combat (1.152.1) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event EndgameCombat::on_entity_damaged (ID 103)
Target must have health.
stack traceback:
    [C]: in function 'create_entity'
    __EndgameCombat__/functions.lua:445: in function 'doRetaliation'
    __EndgameCombat__/control.lua:588: in function <__EndgameCombat__/control.lua:556>
Thorsdragon12 commented 2 months ago

Thanks for the info!


From: yatesjj @.> Sent: Thursday, April 18, 2024 8:03 PM To: ReikaKalseki/Reika_FactorioMods_Issues @.> Cc: Thorsdragon12 @.>; Author @.> Subject: Re: [ReikaKalseki/Reika_FactorioMods_Issues] Game crashing. Not sure why. Error while running event EndgameCombat::on_entity_damaged (ID 103) Target must have health. (Issue #431)

I used the following to fix a smilar issue with the EndGame Combat mod.

Factorio mod Space Exploration was crashing during a Coronal mass ejection event with the EndgameCombat mod installed. The error was: Error while running event EndgameCombat::on_entity_damaged (ID 103) Target must have health.

Couldn't find a fix online so made a guess and I think fixed it by inserting this line in EndgameCombat function doRetaliation in the function.lua file: lvl == nil then return end --No Health Level

I haven't had an issue with it since.

Error that was beaing produced: 236.957 Error MainLoop.cpp:1404: Exception at tick 32383121: The mod Space Exploration (0.6.128) caused a non-recoverable error. Please report this error to the mod author.

Error while running event space-exploration::on_tick (ID 0) The mod Endgame Combat (1.152.1) caused a non-recoverable error. Please report this error to the mod author.

Error while running event EndgameCombat::on_entity_damaged (ID 103) Target must have health. stack traceback: [C]: in function 'create_entity' EndgameCombat/functions.lua:445: in function 'doRetaliation' EndgameCombat/control.lua:590: in function <EndgameCombat/control.lua:556> stack traceback: [C]: in function 'create_entity' space-exploration/scripts/solar-flare.lua:276: in function 'tick_flare' space-exploration/control.lua:1644: in function 'callback' space-exploration/scripts/event.lua:20: in function <space-exploration/scripts/event.lua:18>

Original code from function.lua file Pre.Editing.funtion.lua.file.for.Endgame.Combat.png (view on web)https://github.com/ReikaKalseki/Reika_FactorioMods_Issues/assets/10118533/99dbc8e3-7c91-4d0b-97f1-c36c751bf36c

function doRetaliation(attacker, raw, target, type) local force = target.force if attacker.force == force then return end--friendly fire local lvl = getRetaliationLevel(force, type) if lvl <= 0 then return end local amt = RETALIATIONS[type][lvl].func(raw, attacker.prototype.max_health) --game.print("Found level " .. lvl .. " for type " .. type .. ": " .. raw .. " > " .. amt) attacker.surface.createentity{name = "shockwave-beam", position = target.position, source = target, target = attacker, force = force} for ,player in pairs(game.players) do player.play_sound{path="shockwave-sound", position=attacker.position, volume_modifier=1} end attacker.damage(amt, force, "electric") end

Added this line to the doRetalation function in the function.lua file: if lvl == nil then return end --No Health Level

Example: Post.Editing.funtion.lua.file.for.Endgame.Combat.png (view on web)https://github.com/ReikaKalseki/Reika_FactorioMods_Issues/assets/10118533/0ccf056f-b571-42e0-9800-70b53bc7104a

function doRetaliation(attacker, raw, target, type) local force = target.force if lvl == nil then return end --No Health Level if attacker.force == force then return end--friendly fire local lvl = getRetaliationLevel(force, type) if lvl <= 0 then return end local amt = RETALIATIONS[type][lvl].func(raw, attacker.prototype.max_health) --game.print("Found level " .. lvl .. " for type " .. type .. ": " .. raw .. " > " .. amt) attacker.surface.createentity{name = "shockwave-beam", position = target.position, source = target, target = attacker, force = force} for ,player in pairs(game.players) do player.play_sound{path="shockwave-sound", position=attacker.position, volume_modifier=1} end attacker.damage(amt, force, "electric") end

— Reply to this email directly, view it on GitHubhttps://github.com/ReikaKalseki/Reika_FactorioMods_Issues/issues/431#issuecomment-2065615785, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BDP2FU76C3RIH6ILRIGIOMTY6B3PTAVCNFSM6AAAAAA6NUJ6BGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRVGYYTKNZYGU. You are receiving this because you authored the thread.Message ID: @.***>