GetEntityRegenTimer, DidAttack, TookDamage, DamageFlash

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2179
Joined: Thu Jun 12, 2014 3:05 am
Contact:

GetEntityRegenTimer, DidAttack, TookDamage, DamageFlash

Post by Ranakastrasz »

DamageFlash would flash the screen like a player just took damage, to allow for other warnings, like for mods that add food or water or other hazards. Add a color tint would be great as well. (Green is hunger, blue is oxygen, red is damage). Also could be used for an indicator when the entity has shields, which normally suppresses the warning.


Regen Timer - When did this entity last take damage/fire a weapon/built-in weapon. (Read-write) (Need access to regen rate and delay stats in Prototype)
The regen timer would let us interact with regeneration, having some events/constant actions interupt regeneration, or cause it to resume faster. If you set it to the future, it will delay, even if the entity normally has constant regeneration.


event for damage. (Include source, target, damage dealt (read-write), armor of target(Or just use the prototype data), Weapon (As item, equipment, or entity), and ammo (weapon), script (mod-name? Key?)
Register damage, and allow custom mitigation or damage models. Make an entity take damage to it's power supply, or move when it takes damage, or something. Direct damage to adjacent entities instead. Or, allow modules that alter effective armor, like a gas-mask to reduce poison damage. Maybe EMP draining modular shields instead of health damage. Custom damage filter (only deals damage to inserters? Belts are immune? Damage ignores shields?


Event For Attacks (Source, Target, projectile entity, Weapon, ammo)
Allow for custom attack effects, like a custom projectile/effect on attack/impact. Makes it easiser for scripts to interact.


Don't worry about the expensive nature of having these call events. Its the modder's responsibility to use the events efficiently.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Rseding91
Factorio Staff
Factorio Staff
Posts: 15580
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: GetEntityRegenTimer, DidAttack, TookDamage, DamageFlash

Post by Rseding91 »

Ranakastrasz wrote:Don't worry about the expensive nature of having these call events. Its the modder's responsibility to use the events efficiently.
That's not how any of this works. If something is slow we get the blame for it. That being said: these probably won't ever be implemented because of how slow they would be.
If you want to get ahold of me I'm almost always on Discord.
User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2179
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: GetEntityRegenTimer, DidAttack, TookDamage, DamageFlash

Post by Ranakastrasz »

Rseding91 wrote:
Ranakastrasz wrote:Don't worry about the expensive nature of having these call events. Its the modder's responsibility to use the events efficiently.
That's not how any of this works. If something is slow we get the blame for it. That being said: these probably won't ever be implemented because of how slow they would be.
Really? I always find that when the game is modded, its always the modders fault first.

And in any case, its not like On_Tick is any less capable of slowing down the game. If you do something really expensive in On_Tick, it will slow the game down. Same with any other event that fires off alot. Hence, I don't really see the issue.

----
That said, I can't see DamageFlash or RegenTimer as being expensive.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2179
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: GetEntityRegenTimer, DidAttack, TookDamage, DamageFlash

Post by Ranakastrasz »

I need to split this into sub-suggestions.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Post Reply

Return to “Modding interface requests”