Garry's Mod

Garry's Mod

评价数不足
E2/Wire Prop Health & Damage
   
奖励
收藏
已收藏
取消收藏
素材类型: 插件
插件类型: 工具
插件标签: 建筑, 写实
文件大小
发表于
更新日期
258.685 KB
2022 年 4 月 27 日 下午 12:29
2023 年 2 月 27 日 下午 4:23
64 项改动说明 ( 查看 )

订阅以下载
E2/Wire Prop Health & Damage

在 WFL 的 1 个合集中
AVBS Collection
49 件物品
描述
An E2 based prop damage system, similar to extended prop damage but based almost entirely within E2. Allows props or entire contraptions to be given health and take damage, break constraints depending on damage taken, and emit particles or change colour depending on impact location.

________________________________________

E2 Functions:

entity:registerDamageMonitor() - Registers a damage monitor on an entity. This is required to set health/color etc.
entity:removeDamageMonitor() - Removes a damage monitor from an entity.

entity:getEntityDamage() - Gets the damage of the last hit on the entity.
entity:getTotalEntityDamage() - Gets the total damage done to the entity since monitoring was started.
entity:getEntityDamagePercent() - Gets the percentage of damage done that is needed to break the entity.
entity:getEntityDamagePosition() - Gets last position (vector) of damage done to the entity.
entity:getDamageInflictor() - Gets the entity that did damage to the monitored entity.
entity:getDamageInflictorPosition() - Gets the position of the entity that did damage to the monitored entity.
entity:getEntityHealth() - Gets the starting health of the entity.
entity:getEntityHealthVector() - Returns a vector of Original health/Current health/Constraint break health

entity:setDamageParticleEffect(string effect) - Sets the impact particle effect (ParticleEffect)
entity:setDamageParticleEffectThreshold(int damage, string effect) -- Sets the impact particle effect to trigger after a set damage threshold.
entity:setDamagePropHealth(int health) - Sets the entities' health, independent of it's mass.
entity:setDamagePropSound(string sound) - Sets the sound to play when the entity is destroyed.
entity:setDamagePropColor(vec color) - Sets the color for the entity to turn when being damaged.
entity:setDamageMultiplier(int multiplier) - Sets the damage multiplier for this entity to inflict on other entities.

damageEmitParticleEffect(string effect, vector position, angle direction, entity parent) - emits a particle effect at a location/direction.
________________________________________

entity:registerGlobalDamageMonitor(int health, string particleeffect, string soundeffect, vec damagecolor) - This function applies recursively to all props constrained to the entity given.

health: 1 or 0, whether the entity should have health or not. Health is set according to mass (see wpd_masshealthratio).

particleeffect: string, the particle effect to play on damage location.
soundeffect: string, the sound to play when the entity is destroyed.
damagecolor: vec, the RGB color to turn the prop as it is being damaged.

________________________________________

An example would be: Entity:registerGlobalDamageMonitor(1,"slime_splash_01","garrysmod/ui_click.wav",vec(255,0,0))

________________________________________

Gobal ConVars:

wpd_constraintbreakratio "100" - What percentage of health should constraints break, i.e. 30 would break constraints after 30% of the total health was done as damage.

wpd_masshealthratio "1" - Mass to health ratio. Defaults to 1, setting it higher gives props more health if their health is being set by their mass (see registerGlobalDamageMultiplier)


wpd_setdefault_enable <1/0>: Adds damage monitors to entites by default. 0/1
wpd_setdefault_health <number>: Sets global default health multiplier.
wpd_setdefault_particleeffect <string>: Sets global default particle effect.
wpd_setdefault_soundeffect <string>: Sets global default sound effect.
wpd_setdefault_color_r <0-255>: Sets global default damage color (red)
wpd_setdefault_color_g <0-255>: Sets global default damage color (green)
wpd_setdefault_color_b <0-255>: Sets global default damage color (blue)
wpd_destroyonbreak <1/0> Whether to delete props when they reach 0 health.
wpd_setdefault_worldeffect <string> The particle effect to play on impact with the world. Blank defaults to the prop's particle effect.
3 条留言
Kerk 2023 年 6 月 24 日 上午 11:22 
10 out of 10 addon nonetheless!
Kerk 2023 年 6 月 24 日 上午 11:21 
Should add a e2 function that resets the health of a damage monitor
Sanders 2022 年 6 月 15 日 下午 6:59 
could you change the texture to something like acf? or give us the option to least change the texture?