Unreal Kismet (nonfiction): Difference between revisions

From Gnomon Chronicles
Jump to navigation Jump to search
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 4: Line 4:


=== Toggle materials ===
=== Toggle materials ===
==== Ralph Fortin ====


Convert a lamp mesh so it has a Material with an Emissive feature and an alternative Material with no Emissive feature, creating the illusion of a lamp being turned on and off.
Convert a lamp mesh so it has a Material with an Emissive feature and an alternative Material with no Emissive feature, creating the illusion of a lamp being turned on and off.
Line 13: Line 15:
* [https://www.youtube.com/watch?v=OXZ4dsERgDU How to animate a material with Kismet/Matinee in UDK] by Ralph Fortin @ YouTube
* [https://www.youtube.com/watch?v=OXZ4dsERgDU How to animate a material with Kismet/Matinee in UDK] by Ralph Fortin @ YouTube


=== Commentary ===
==== Hourences ====
 
Create a new material, and add a TextureSampleParameter2D (=Parm2D) expression instead of a regular TextureSample. Fill in your texture into Parm2D expression, as if it were a regular TextureSample, and also be sure to set a ParameterName. The name will be used to identify all the expression in Kismet and the Material Instance later, so pick something descriptive.
 
Next, create an Instanced Material, as only Instanced Materials can be accessed via Kismet. Rightclick an empty space in the Generic Browser, and pick New MaterialInstanceConstant.
 
Once it has been created, open up its properties, and set the Parent property to the material you’ve just created, and enable the TextureParameterValue of choice (enable the tickbox), and enter the same texture again. In this tutorial example, both my original material as this instanced material use the Wallbarsvari1 texture. Visually this changes nothing at all, yet.
 
Apply the Instanced Material to the Staticmesh of choice (or any other actor: characters, vehicles, interface, lightfunctions, etc.)
Open Kismet, and add two Set TextureParam’s.
 
Preferably also add a Trigger actor, or Triggervolume, to the level, and also add it to Kismet. Set the whole thing up like shown in following screenshot.
 
Be sure to set the Material Instance (MatInst), the NewTexture property (add a different texture than the original here), and the ParamName, so it knows which expression to change.
The second Set TextureParam is similar, but it uses the original texture as its NewTexture.
 
If you were walk into the trigger, the material would change to the new texture, and change back to the original as soon as you leave the trigger’s radius again.
 
The trigger should also have its MaxTriggerCount set to 0, so it is infinitive.
 
You can use this technique for just about anything. You could delete the second Set TextureParam so it only changes the texture just once. You could hook up a timer so you can time exactly when to change the texture. You could base the switch on whether or not the player is carrying the CTF flag. Etcetera.
 
* [http://www.hourences.com/ue3-triggering-materials/ UE3 Triggering Materials] @ Hourences
 
=== Static mesh actors ===


"You can't change the material applied to a static mesh actor during play. If you use an InterpActor, then the Set Material action in Kismet should do what you want. Or you could use a material with a TextureSampleParameter and the Set Material Param action should allow you to change that in Kismet. There are other ways as well, but I think one of those should work in most cases."
"You can't change the material applied to a static mesh actor during play. If you use an InterpActor, then the Set Material action in Kismet should do what you want. Or you could use a material with a TextureSampleParameter and the Set Material Param action should allow you to change that in Kismet. There are other ways as well, but I think one of those should work in most cases."


https://www.3dbuzz.com/forum/threads/170279-How-can-I-change-Material-Instance-with-Matinee
https://www.3dbuzz.com/forum/threads/170279-How-can-I-change-Material-Instance-with-Matinee
=== Teleportation ===
* [https://www.youtube.com/watch?v=-AT_EoVqwTo How To - Build a Kismet Teleporter] by ChapmanGameDev @ YouTube


== Materials ==
== Materials ==

Latest revision as of 11:04, 4 September 2020

Kismet is a scripting engine for the Unreal game engine.

Examples

Toggle materials

Ralph Fortin

Convert a lamp mesh so it has a Material with an Emissive feature and an alternative Material with no Emissive feature, creating the illusion of a lamp being turned on and off.

Use the Set Material actions in Kismet to set the material of a surface.

This only changes the Material on a mesh: it does not the light cast in the scene. Use PointLightToggleable to provide light that toggles.

Hourences

Create a new material, and add a TextureSampleParameter2D (=Parm2D) expression instead of a regular TextureSample. Fill in your texture into Parm2D expression, as if it were a regular TextureSample, and also be sure to set a ParameterName. The name will be used to identify all the expression in Kismet and the Material Instance later, so pick something descriptive.

Next, create an Instanced Material, as only Instanced Materials can be accessed via Kismet. Rightclick an empty space in the Generic Browser, and pick New MaterialInstanceConstant.

Once it has been created, open up its properties, and set the Parent property to the material you’ve just created, and enable the TextureParameterValue of choice (enable the tickbox), and enter the same texture again. In this tutorial example, both my original material as this instanced material use the Wallbarsvari1 texture. Visually this changes nothing at all, yet.

Apply the Instanced Material to the Staticmesh of choice (or any other actor: characters, vehicles, interface, lightfunctions, etc.) Open Kismet, and add two Set TextureParam’s.

Preferably also add a Trigger actor, or Triggervolume, to the level, and also add it to Kismet. Set the whole thing up like shown in following screenshot.

Be sure to set the Material Instance (MatInst), the NewTexture property (add a different texture than the original here), and the ParamName, so it knows which expression to change. The second Set TextureParam is similar, but it uses the original texture as its NewTexture.

If you were walk into the trigger, the material would change to the new texture, and change back to the original as soon as you leave the trigger’s radius again.

The trigger should also have its MaxTriggerCount set to 0, so it is infinitive.

You can use this technique for just about anything. You could delete the second Set TextureParam so it only changes the texture just once. You could hook up a timer so you can time exactly when to change the texture. You could base the switch on whether or not the player is carrying the CTF flag. Etcetera.

Static mesh actors

"You can't change the material applied to a static mesh actor during play. If you use an InterpActor, then the Set Material action in Kismet should do what you want. Or you could use a material with a TextureSampleParameter and the Set Material Param action should allow you to change that in Kismet. There are other ways as well, but I think one of those should work in most cases."

https://www.3dbuzz.com/forum/threads/170279-How-can-I-change-Material-Instance-with-Matinee

Teleportation

Materials

See Unreal Materials (nonfiction).

General tutorials

  • Kismet @ 3dbuzz.com - free to registered users

In the News

Fiction cross-reference

Nonfiction cross-reference

External links