button_p0 button_p0

 

How to Change the Weather When a Powerup is Taken

This tutorial will cover how to create a weather change when a pickup is taken.  It’s the same effect that was used in DM-Tomac-WE. It will use snow and fog for the weather elements and the Udamage as the pickup.

You should be familiar with using the editor, material editor, importing assets into packages and a basic understanding of Kismet.

The Goal

1. When the level loads and the sky is basically clear with some blue fog around the borders of the map.

2. When the Udamage is taken, a thunder sound is played. The fog turns from blue to gray and fills the entire sky.  Then snow falls from the sky.

3. When the Udamage is used up, the snow disappears and the gray fog turns back to the normal fog setting.

Adding the Basic Elements

1. We are going to place the pickup, the snow, and the 2 fog actors.

1a. Place the pickup in your level and position as needed.

1b. Load the UN_Weather package and place the S_UN_Weather_SM_Rain_Cube static mesh in your level as an interpactor. In the same package, locate the M_UN_Weather_SM_Snow material and apply it to the interpactor (Properties -> DynamicSMActor -> StaticMeshComponent -> Rendering -> Materials)

Position and size (draw scale) and duplicate the interp actor as needed. Use the preview button to get an idea of how the snow will look.  This is very important because in the latter steps, you won’t really be able to see the snow falling in the editor. Make sure the snow is not falling through solid objects (such as a roof).  You will also need to turn off all collision, the receiving of lights, and casting of shadows.

1c. Place a HeightFog actor (Actor Browser -> Info -> HeightFog) and adjust it’s properties as needed. This will be the fog that is seen during normal game play (when the pickup is not taken).

1d. Place a second HeightFog actor and adjust it’s properties. This will be the fog that is seen during the time the pickup has been taken by a player until it disappears. Be sure there is enough differences in color, brightness, and heights of the two Height Fogs.

Setting up the Snow to Change Gradually Part 1

2. We are going to create our own snow material that will allow us to change it’s appearance gradually.

2a. In the UN_Weather package, find the M_UN_Weather_SM_Snow material. Open it up in the material editor, select all of the nodes, then copy them by pressing the Ctrl+C keys.

2b. Create a new material and select your map name as the package name.  Feel free to use a group and fill out an appropriate name (I will use “Snowing” for this tutorial). Select the OK button.

2c. A new window appears, paste the nodes you copied into the window.  Reconnect nodes in the same way as the original.

2d. Select the PreviewMaterial node and change the following:

BlendMode=BLEND_Translucent

LightingModel=MM_Unlit

TwoSided=checked

2e.  Locate the Parm ‘Opacity” node, select it and it the properties window, change the ParameterName to something unique (I called mine SnowOpacity).  Save the Material.

2f. Create a MaterialInstanceContstant and add it to the map’s internal package. Feel free to use a group and fill out an appropriate name (I will use “Snowing_MIC” for this tutorial).  Select the OK button.

2g. A new window appears.  In the Parent field, insert the copied snow material. For the scalarParameterValues, set the “Opacity” value to 0.00 (the same name you used in step 3e) and make sure the box is checked.

2h. Apply the new MaterialInstanceConstant to each of the interpactors (Properties -> DynamicSMActor -> StaticMeshComponent -> Rendering -> Materials) you added to your map for the snow falling from the sky.

2i. Add a MaterialInstanceActor (Actor Browser -> MaterialInstanceActor) somewhere in your map (the player won’t be able to see it), open up it’s properties and assign your Material Instance Constant you created in the MaterialInstanceActor -> MatInst field.

Setting up the Snow to Change Gradually Part 2

3. We are going to set up a Matinee to change the appearance of the snow from invisible to the falling snow material.

3a. Select the MaterialInstanceActor that’s in your level, go to Kismet, add a Matinee node. In the Matinee’s properties, enter an appropriate ObjComment (I entered “Snowing”).  In addition, change the PlayRate to “0.800000”.

3b. Open up the Matinee node and add a new group (I named it “Snow’), then add a new Float Material Param Track to the group.

3c. Add 2 keys to the track. For Key0, set it’s Time at 0.0 and it’s Value at 0.0, also set it’s Interp Mode to Curve.  In Key0’s properties, change the ParamName field to what ever name you choose in step 3e.  For Key1, set it’s Time at 4.0 and it’s Value at 2.0

3e. You should be able to play the Matinee and see the results in your level.

Setting up the Starting Height Fog to Change Gradually

4. We are going to set up a Matinee for the starting height fog (one that is seen during normal game play) to change it’s colors gradually.

4a. Select the height fog actor , open Kismet, add a second Matinee node.  In the Matinee’s properties, enter an appropriate ObjComment (I entered “Starting Fog”). In addition, make sure bForceStarPos is checked.

4b. Open up the Matinee node and add a New Empty Group and give it a name (I named it StartingFog).  Select this group and add a new Float Property Track.  In the Choose Property window, select HeightFogComponent0.Density and select the OK button. 

4c. Your new track will be labeled Density, select it and add 2 key frames.  Select Key1 and set it’s time at 4.0 and set it’s Value at “0.000000”.  Leave Key0’s Time and Values at their default.

4d. You should be able to play the Matinee and see the results in your level.

Setting up the Ending Height Fog to Change Gradually

5. We are going to set up a Matinee for the ending height fog (one that is seen when the pickup is taken) to change colors gradually.

5a. In Kismet, add a third Matinee node  In the Matinee’s properties, enter an appropriate ObjComment (I entered “Ending Fog).

5b. Open up the Matinee node and add a New Empty Group and give it a name (I named it EndingFog).  Select this group and add a new Float Property Track.  In the Choose Property window, select HeightFogComponent0.Density and select the OK button. 

5c. Your new track will be labeled Density, select it and add 2 key frames.  Select Key1 and set it’s Time to “4.0” and set it’s Value at “0.000000”.  Select Key0 and set it’s Value to “0.000050”.

5d. Select the height fog actor, open up Kismet, right click and select New Object Var Using HeightFog_1.  Connect this node to the group input (I called mine “EndingFog” in step 6b) on the third Matinee node.

5e. You should be able to play the Matinee and see the results in your level.

Setting up the Pickup Status Change & Level Loaded Nodes

6. We are going to start the Kismet sequence when the pickup has been taken by a player. We also need to make sure the ending height fog isn’t visible when the level starts.

6a. Select the pickup actor and open up Kismet, right click in the Kismet window and place your cursor over New Event Using UTPickupFactory_Udamage_0 (the name might be different). On the sub menu, select Pickup Status Change

6b. Add a Level Loaded And Visible node (New Event -> Level Loaded And Visible)

Setting up the Delay Nodes

7. We are going to add some delay nodes to make sure the timing is correct.

7a. In Kismet, add a Delay node (New Action -> Misc -> Delay). In it’s properties, enter an appropriate ObjComment (I entered “2 Second Delay”) and set the Duration to “2.0”.

7b. Add another Delay node (New Action -> Misc -> Delay). In it’s properties, enter an appropriate ObjComment (I entered “26 Second Delay”) and set the Duration to “26.0”.

7c. Connect the Taken output on the Pickup Status Change node to the reverse input of the third Matinee node.

7d. Insert a Level Loaded And Visible Node and connect it’s Out output to the third Matinee’s Play input.

7e. Connect the Finished output on the 26 second Delay node to the Play input on the third Matinee’s node.

Setting up the Sound Node

8. We are going to add sound that will be played when the pickup is taken.

8a. You need to create a Sound Cue and add it to your level package or use a stock one.

8b. Once it’s created, select it, open Kismet and add a Play Sound node (Action -> Sound -> Play Sound). In it’s properties, enter an appropriate ObjComment (I entered “Thunder”) and enter your sound cue in the PlaySound field.  (The sound will be heard by all players when the pickup is taken)

8c. You may also need to add a AmbientSound actor to your level and uncheck the bAutoPlay (Properties -> AmbientSound -> bAutoPlay).  This will prevent the editor from removing your sound cue, if it was added to your map’s package.

Connecting all of the Nodes in Kismet

9. Now we are going to connect all of your nodes so the sequence will play in harmony.

9a. Connect the Taken Output on the Pickup Status Change node to the Start input on the 2 Second Delay Node. Connect the Finished output on the 2 Second Delay Node to the Play on the First Matinee node.  (This will give allow the Thunder sound to play first before it starts to snow)

9b. Connect the Taken output on the Pickup Status Change node to the Start input on 26 Second Delay Node.  Connect the Finished output on the 26 Second Delay Node to the Reverse input on the first Matinee node.  (This will start the hiding of the snow right before the Udamage is gone) Connect the Finished output on the 26 Second Delay Node to the Reverse input on the second Matinee node and to the Play input on the third Matinee node.  (This will reverse the fog effects)

9c. Connect the Taken output on the Pickup Status Change node to the Play input on the Play input on the second Matinee node and to the Reverse input on the third Matinee node. (This will make the fog change when the pickup is taken)

9d. Connect the Out output on the Level Loaded And Visible Node to the Play input on the third Matinee node.

9e. Connect the Taken output on the Pickup Status Change node to the Play input on the Play Sound Node.  Connect the Finished output to the Stop input on the same Play Sound Node.

9f. Your Kismet sequence should look like this.

 

Weather Change Tutorial Pic

 

Written by Odedge

Kismet sequence by Sebastien-NOVA

 Top