idEnvironmentalDamage_Hurt_Trigger
An entity that deals damage when entering its volume. Essentially the damaging part of a hazard.
Usage
entity {
entityDef example_hurt_trigger {
inherit = "envhazard/volume/electrical_blue";
class = "idEnvironmentalDamage_Hurt_Trigger";
expandInheritance = false;
poolCount = 0;
poolGranularity = 2;
networkReplicated = false;
disableAIPooling = false;
edit = {
killerNames = {
num = 1;
item[0] = ""; // What to string display when killed by this entity
}
envDamageType = "ENVIRONMENTAL_DAMAGE_NUM";
envDamage = ""; // Uses a damage decl that will define how much damage is caused
envDamageInterval = 500; // How often the hazard will damage you in milliseconds
envWarningInterval = 500;
spawnPosition = { // Be sure to set its spawn position
x = 1;
y = 1;
z = 1;
}
spawnOrientation = { // Be sure to set its rotation
mat = {
mat[0] = {
x = 1;
y = 0;
}
mat[1] = {
x = 0;
y = 1;
}
}
}
renderModelInfo = { // The hazard would normally be invisible
model = NULL;
}
clipModelInfo = {
type = ""; // Defines what kind of shape it is
size = { // Be sure to set its scale
x = 1;
y = 1;
z = 1;
}
clipModelName = NULL;
}
}
}
}
Example
This example is an electric floor hazard.
entity {
entityDef example_electric_hazard {
inherit = "envhazard/volume/electrical_blue";
class = "idEnvironmentalDamage_Hurt_Trigger";
expandInheritance = false;
poolCount = 0;
poolGranularity = 2;
networkReplicated = false;
disableAIPooling = false;
edit = {
killerNames = {
num = 1;
item[0] = "#str_decl_damage_hazard_electrical_GHOST53193";
}
demonPlayerCanActivate = true;
deadAiCanActivate = false;
envDamageType = "ENVIRONMENTAL_DAMAGE_NUM";
envDamage = "damage/hazard/electrical_bluefx";
envDamageInterval = 500;
envWarningInterval = 500;
spawnPosition = { // Be sure to set its spawn position
x = 1;
y = 1;
z = 1;
}
spawnOrientation = { // Be sure to set its rotation
mat = {
mat[0] = {
x = 1;
y = 0;
}
mat[1] = {
x = 0;
y = 1;
}
}
}
renderModelInfo = {
model = NULL;
}
clipModelInfo = {
type = "CLIPMODEL_CYLINDER";
size = {
x = 10;
y = 10;
z = 1;
}
clipModelName = NULL;
}
}
}
}
Hurt triggers are usually invisible so you should add a particle entity on it to convey its physical dimensions.
No Comments