MapAdd Specific EntitiesNow lets cover some special entities that have been made specifically for the MapAdd system. These entities are what give the system its impressive power.
Simple TriggerA trigger similar to the brush based
trigger_once available in the Hammer Map Editor, or the
instant_trig entity available in SMOD. It essentially defines a radius from its origin, and activates when the player steps into that radius.
Here is how it looks in MapAdd code:
"mapadd_trig" {
"Origin" "x y z"
"KeyValues" {
"Radius" "50"
"OnTrigger" "Target,Input,Parameter,Delay,FireOnce"
}
}
Special KeyValues:
"Radius" - This is the radius of the trigger, measured in game units. It is projected out from the origin point of the trigger entity.
"OnTrigger" - This is an output similar to the brush-based triggers available in the Hammer Map Editor. It is only processed when the player sets off the trigger (enters its radius).
Target TriggerThis is a type of trigger which functions almost identically to the Simple Trigger, except that it has additional KeyValues which allows you to filter the type/name of the entity that can trigger it.
Here is how it looks in MapAdd code:
"mapadd_target_trig" {
"Origin" "x y z"
"KeyValues" {
"Radius" "50"
"TriggerTarget" "name"
"OnTrigger" "Target,Input,Parameter,Delay,FireOnce"
}
}
Special KeyValues:
"TriggerTarget" - This is the parameter that filters what entity can set off the trigger. Use a name here.
Remove EntityThis is a special MapAdd function which removes an entity from the map.
Here is how it looks in MapAdd code:
"removeentity" {
"classname" "name"
"targetname" "name"
"origin" "x y z"
"radius" "##"
}
Special KeyValues:
"classname" - This defines the class of entity we want to remove. This takes top priority.
"targetname" - This defines the name of the entity we wish to remove.
"origin" - Set an origin point to search for our entity from.
"radius" - Define how far from our origin point to search from.
Replace EntityAn interesting MapAdd function that will replace one entity type with another. You can also define KeyValues for your newly replaced entity!
Here is how it looks in MapAdd code:
"replaceentity" {
"classname" "name"
"newclassname" "name"
"KeyValues" {
"Key" "Value"
"Output" "Target,Input,Parameter,Delay,FireOnce"
}
}
Special KeyValues:
"classname" - This defines the entity class we want to replace!
"newclassname" - And this defines the type of entity that we will be inserting in it's place!
"KeyValues" {} - In this section you can define KeyValues and Outputs that will be inherited by our newly replaced entities.
Modify EntityA powerful MapAdd function that operates similar to an "
AddOutput" output. Basically, it will search for an entity already in the map, and allow you to change or add KeyValues on the fly.
Here is how it looks in MapAdd code:
"modifyentity" {
"Origin" "x y z"
"classname" "class"
"KeyValues" {
"Key" "Value"
"Output" "Target,Input,Parameter,Delay,FireOnce"
}
}
Special KeyValues:
"Origin" - Select an point where the entity you wish to modify is. If no entity is found here (that matches the classname) then it will search for the closest match from this point.
"Classname" - Define the entity class that you wish to modify.
"KeyValues" {} - This is the block where we place the KeyValues we wish to modify for this entity, and outputs we wish to add. This will override an entity's current KeyValue, or add the KeyValue/Output if none exists.
Custom Ammo ItemThis entity creates a Custom Ammo Item which the player can pickup. It's mainly used to give the player an additional stock of a desired type of custom ammo.
Here is how it looks in MapAdd code:
"item_custom_ammo" {
"origin" "x y z"
"angle" "p y r"
"KeyValues" {
"AmmoType" "YourAmmoType"
"EntityName" "YourAmmoPickup"
}
}
Special KeyValues:
"AmmoType" - Selects a user-defined type for this item and loads values for that class. Custom types can be defined in
.../tbsp/scripts/custom_ammo.txt; Please refer to
Scripting Documentation for more info.
EntityName - This defines what type of item pickup we will use for this custom ammo type. It is defined in the custom ammo script. Please refer to
Scripting Documentation for more info.
Custom Soldier NPCThis entity spawns a custom soldier in the map. Custom Soldiers will take all normal KeyValues as well as special unique ones described below.
Here is how it looks in MapAdd code:
"npc_custom_soldier" {
"Origin" "x y z"
"Angle" "p y r"
"KeyValues" {
"sclass" "name"
"key" "value"
}
}
Special KeyValues:
"sclass" - Selects a user-defined type for this Custom Soldier and loads values from that class. Custom types can be defined in
.../tbsp/scripts/npc_custom_soldier.txt; Please refer to Scripting Documentation for more info.