Page 1 of 1

GetEntityRegenTimer, DidAttack, TookDamage, DamageFlash

Posted: Sat May 13, 2017 2:39 pm
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.

Re: GetEntityRegenTimer, DidAttack, TookDamage, DamageFlash

Posted: Sat May 13, 2017 7:44 pm
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.

Re: GetEntityRegenTimer, DidAttack, TookDamage, DamageFlash

Posted: Sat May 13, 2017 8:02 pm
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.

Re: GetEntityRegenTimer, DidAttack, TookDamage, DamageFlash

Posted: Thu Jun 01, 2017 6:38 pm
by Ranakastrasz
I need to split this into sub-suggestions.