this event could include the same attributes as the on_entity_damaged, minus the final damage:
- entity :: LuaEntity
- damage_type :: LuaDamagePrototype
- damage_amount :: float
- cause :: LuaEntity (optional): The entity that did the attacking if available.
- force :: LuaForce (optional): The force that did the attacking if any.
Would allow mods to get any entity details prior to the damage being done. But not interfere in the game's calculation of damage as I know other events don't offer interference in core game mechanics.
For example in a Nuke Immunity mod, it would get a player's shield level and health before they suffer 10,000 damage from a nuke. Then the mod could return their health and shield to the exact previous level.
Add on_pre_entity_damaged event
- Muppet9010
- Filter Inserter
- Posts: 279
- Joined: Sat Dec 09, 2017 6:01 pm
- Contact:
Re: Add on_pre_entity_damaged event
Sorry but no.
Adding the entity_damaged event was already controversial. Adding another event which 99% of the mods would never use is not going to happen unless someone finds a *much* better reason for wanting the event.
Adding the entity_damaged event was already controversial. Adding another event which 99% of the mods would never use is not going to happen unless someone finds a *much* better reason for wanting the event.
If you want to get ahold of me I'm almost always on Discord.
- Muppet9010
- Filter Inserter
- Posts: 279
- Joined: Sat Dec 09, 2017 6:01 pm
- Contact:
Re: Add on_pre_entity_damaged event
If anyone wanted to do their own damage logic in Lua, etc.
I wanted to also use it to get the player health and shield prior to vehicle impact. So I could undo the vehicle impact affect exactly.
Fair enough.
I wanted to also use it to get the player health and shield prior to vehicle impact. So I could undo the vehicle impact affect exactly.
Fair enough.
Re: Add on_pre_entity_damaged event
+1
Not the first time my ideas fail to the fact that my shields decrease the event's parameters to 0
Not the first time my ideas fail to the fact that my shields decrease the event's parameters to 0
mods.factorio.com/user/ownlyme
My requests: uiAbove||Grenade arc||Blueprint allies||Creeps forget command/ don't get removed||Player Modifiers||textbox::selection||Better Heat IF||Singleplayer RCON||tank bug w/ min_range >= projectile_creation_distance
My requests: uiAbove||Grenade arc||Blueprint allies||Creeps forget command/ don't get removed||Player Modifiers||textbox::selection||Better Heat IF||Singleplayer RCON||tank bug w/ min_range >= projectile_creation_distance
- Muppet9010
- Filter Inserter
- Posts: 279
- Joined: Sat Dec 09, 2017 6:01 pm
- Contact:
Re: Add on_pre_entity_damaged event
Ownlyme, I made a follow on request to try and give similar usability without the negatives Rseding listed. It hasn't had any view passed on its suitability so far. Not sure if it would cover your usage thoughts.
viewtopic.php?f=28&t=70010&p=425637#p425637
viewtopic.php?f=28&t=70010&p=425637#p425637