I have set up a simple test map consisting of a slab of BSP, a
skylight, a playerstart, a skydome, and a directional light.
I will only be using default editor assets which can be found
in the EditorMeshes and EditorMaterials
packages.
I added the default mesh cube as a static mesh to the map. Now,
in offline, single-player, mode, I have noticed that static
meshes can take damage and fire take damage events. However,
I have a suspicion that this will not work as well in mulitplayer
online - I think the mesh would need to be an interpactor instead.
This does also work with physics/KActors, but I would image
there might be netowkring problems with these online. Or maybe
not - I don't know. For now, I will convert the StaticMesh to
an Interpactor and continue from there...
SetUp: Select the Interpactor/Mover in a viewport,
and open Kismet. Right-Click anywhere and select 'New Event
Using InterpActor -> Take Damage, as in the screenshot below:
|
|
Now we have our take damage event that will fire when the interpactor
receives damage. Let's look at some of the properties...
|
|
• bEnabled allows you to control if the event is active
by default, or turned on later using a toggle.
• bPlayerOnly will control if damage is recorded if the
damage originates only from the player, or from anyone/thing
in the level, for example bots/NPCs.
• Damage Threshold is the total amount of damage the actor
can receive before the event will fire off. The node labeled
'Damage Taken' on the bottom of the Kismet Entity (I think)
overrides this value and can therefore be set 'on the fly' via
set variable commands.
• DamageTypes are the specific types of damage the asset
will register as damage. For example, if you want the damage
to only register from explosions, but not small arms fire, you
would specify the explosive weaponry here - of course these
will vary from engine to engine. Click on the grey area, and
then on the green button to add a line. Then you'll be able
to designate the damage type. Likewise, clicking the double-brackets
will delete the lines and clear the field again.
• IgnoreDamageTypes is pretty much the opposite of DamageTypes.
This is where you can designate damage that you want the asset
to ignore - like in the previous example, small arms fire types
would be added here.
• MaxTriggerCount controls the maximum amount of times
the event is allowed to fire.
• MinDamageAmount is the minimum amount of damage the
asset is allowed to register.
Uses: There could be many uses for the 'take
damage' event. For example, as an objective door, you could
designate it to take X amount of damage before it is destroyed,
thus allowing the player into the next area. Or, in a multiplayer
map, you could set a door to open when it takes damage - thus
allowing the player to open the door before reaching a trigger,
or a button. Or you could set up a button that activates an
mover to also activate the mover when the button is shot - not
just pressed. There are many uses for this.
|