Today's tutorial is going to be how to use the different lights in Kismet. I know this is a fairly simple thing to figure out, but not everyone knows the different types of lights.
Knowing the different Lighting Types:
So first off, we have the PointLight. This is going to be your standard lighting choice and it is shortcutted to L + Left Click. These are omnidirectional and will put light out as far as the radius of the light in all direcations.
Next, we have the SpotLight. As it sounds, this is a light that starts at a location and is focused on a certain direction. Thing of it as a flashlight where the starting point is a smaller diameter than the end result which spreads out as it goes. You have change the distance and radius of the further point as well as the radius of the origin. This is useful for shining light on something that you want to emphasize against the environment.
After that comes out SkyLight. The best way to think of this would be like a sun. I generally don't recommend using these lights unless you know exactly what you're doing with the lighting. They have a high probability to wash out the lighting on your level if you use them incorrectly and can result in a lack of shadows which takes away from the altogether feel of the environment.
Up next is the DirectionalLight. This one is like a mix between the skylight and the spotlight. When you place one of these, it will take it's placement and direction and point a light coming from that direction at what it's facing. Worthy of note on this light is that it will not work in an enclosed space. Basically saying, think of this light as needing the sun as the sound and pointing where the sun should look. If you try and place one of these inside of a room with no windows or openings, the light will hit the outside walls and not illuminate the inside of the room at all.
Toggleable. Like it says, this light can be enabled and disabled at will. If you want a lightswitch to turn on the lighting in a room, it's important to use this type and not just the standard pointlight. If you try and turn a pointlight on and off without the toggleable tag, then the enable and disable will not work post-editor.
Moveable. This light type is what you'd want to use if you're making the lighting system change. Say you have an actor moving around the level and you want a lightsource around to illuminate the path instead of relying on static lights, this is what you'd need to use to tell the editor to change the lighting when the light moves.
Finally, there are pickup lights. These, you generally won't have to know. When you use the UT weapon lockers and such, the compiler will tell you that you don't have any pickup lights. Fortunately, these are so commonplace that the UnrealEd actually has a button to automatically place pickup lights where ever you have one of these pickup locations. It can be found in Tools>Add Pickup Lights.
That's pretty much all there is to know about the different kinds of lights. From here, you'll want to go into the properties of the light actor itself and change the radius, color, falloff exponent, and brightness to achieve the lighting that you're attempting.
Friday, April 29, 2011
Thursday, April 28, 2011
Forcing your bots to move to a location.
Alright, so here's another tutorial that directly follows along with my current map project :).
This time, we're going to force a bot that we spawn in the world to move to a location of our choosing. For my example, I'll use the other team's flag.
To start out, right click a place in the world and add a trigger. This is going to dump out the Pawn data into Kismet so that we can control him. With that Trigger selected, open up Kismet and right click the empty space to bring up the menu. Add a new event using trigger... > Touch.
Now that you've got the trigger setup, be sure to make a blank object variable below the trigger so that the value of the pawn is dumped somewhere. Create a new action now, New Action > AI > Move to Actor (latent). Now hook these up in the traditional left to right from Touch to In. Now pull the target input into the object variable you created. With that done, now all you need is another object for your movement target. Find something on your map that you want you pawn to go run over to and select it. Bring Kismet back up and right click on the blank input. Create Object using whatever is selected, for me it's RedTeamFlagBase_0.
Now, whenever the bot hit's our trigger, he will immediately stop what he's doing and move to the target location...
This is all well and good, but if you're going along with my example, what do you think is going to happen when the Pawn comes back over that trigger carrying the flag? What about opposing team members? With the way it's setup, any bot who hits the trigger is going to turn around and run for the flag point, so let's add in some more safety precautions.
In order to make sure that your trigger isn't going to be turning the other team away from your base, add a new action into your function. New Action > Team > Get Team Number. Connect the object variable from the trigger into the target input of this node. This will tell the process who it's checking. Next, create a new Int variable underneath the output of the Get Team Number. Now add a new item. New Condition > Comparison > Int. Connect the Int value from the team node into the A slot of the Int compare. Create another Int at B and assign it to either 0 or 1. 0, being red team and 1, being blue team. Depending on what you choose, set this up accordingly. I used 0, so I check to see if my Get Team is = 0, then I connect that output to my Move to Actor function. What this is doing is checking if the pawn who triggered the touch is going to be on Red team. If they are, then they'll be sent over to the flag. If not, then I don't have to worry about making them do anything.
Now, this may or may not be important as I haven't gone to figure out if the bots will run to the Flag or to the Flag Base... but you may want to add in another condition in there that checks whether or not the bot is carrying the flag. This would stop a bot who had the flag from triggering our event and running back to the other base to be killed. So just to be safe, I'll go ahead and add that part in.
That's about it for today. Again, if there's anything you'd like to learn in particular, just ask and I'll be happy to go over it.
This time, we're going to force a bot that we spawn in the world to move to a location of our choosing. For my example, I'll use the other team's flag.
To start out, right click a place in the world and add a trigger. This is going to dump out the Pawn data into Kismet so that we can control him. With that Trigger selected, open up Kismet and right click the empty space to bring up the menu. Add a new event using trigger... > Touch.
Now that you've got the trigger setup, be sure to make a blank object variable below the trigger so that the value of the pawn is dumped somewhere. Create a new action now, New Action > AI > Move to Actor (latent). Now hook these up in the traditional left to right from Touch to In. Now pull the target input into the object variable you created. With that done, now all you need is another object for your movement target. Find something on your map that you want you pawn to go run over to and select it. Bring Kismet back up and right click on the blank input. Create Object using whatever is selected, for me it's RedTeamFlagBase_0.
Now, whenever the bot hit's our trigger, he will immediately stop what he's doing and move to the target location...
This is all well and good, but if you're going along with my example, what do you think is going to happen when the Pawn comes back over that trigger carrying the flag? What about opposing team members? With the way it's setup, any bot who hits the trigger is going to turn around and run for the flag point, so let's add in some more safety precautions.
In order to make sure that your trigger isn't going to be turning the other team away from your base, add a new action into your function. New Action > Team > Get Team Number. Connect the object variable from the trigger into the target input of this node. This will tell the process who it's checking. Next, create a new Int variable underneath the output of the Get Team Number. Now add a new item. New Condition > Comparison > Int. Connect the Int value from the team node into the A slot of the Int compare. Create another Int at B and assign it to either 0 or 1. 0, being red team and 1, being blue team. Depending on what you choose, set this up accordingly. I used 0, so I check to see if my Get Team is = 0, then I connect that output to my Move to Actor function. What this is doing is checking if the pawn who triggered the touch is going to be on Red team. If they are, then they'll be sent over to the flag. If not, then I don't have to worry about making them do anything.
Now, this may or may not be important as I haven't gone to figure out if the bots will run to the Flag or to the Flag Base... but you may want to add in another condition in there that checks whether or not the bot is carrying the flag. This would stop a bot who had the flag from triggering our event and running back to the other base to be killed. So just to be safe, I'll go ahead and add that part in.
That's about it for today. Again, if there's anything you'd like to learn in particular, just ask and I'll be happy to go over it.
Wednesday, April 27, 2011
Creating a spawned Turret in Unreal Editor 3
If you were to make a game where you needed a turret to be spawned and attack an enemy in real time, the best way to achieve it would be using Kismet.
Before opening up Kismet at all, first decide on the area in your map where the turret is going to be placed. Right-click on the spot and add a PlayerStart actor. Add another actor close-by but not too close. (This second player start will be for the turret's bot so that there will be someone to shoot from it.) If the two points are too close together, that the bot will die on spawning due to the turret being too close to spawn point. (Ever seen a two players spawn in the same location? Needless to say, one of them usually explodes.)
Now, with your spawn points in the world, open up Kismet.
Depending on what you're using it for, you'll need a different trigger to set off our event. So for the sake of testing, I'm going to set it up on a console event. (Add Event > Misc Event > Console Event). Be sure to add a name into the ConsoleEventName space so that you can call it from game. Mine is going to be "testturret". When you activate this in-game, you'll press tab to open console and type "ce testturret".
Next, add two Actor Factories (New Action > Actor > Actor Factory). Connect the out from the event into the Spawn Actor of the actor factory. Next, connect the Finished of the first to the Spawn Actor of the second.
Now we're going to make our Object variables. With the player spawn of the turret selected, right click on the first actor factory's Spawn Point and click create object using PlayerStart_x. Do the same for the other spawn on the other actor factory. After that, right click on the Spawned part and create a blank object variable for each factory.
With the first one selected, click the blue arrow to the right of Factory. From the drop-down, select the UTActorFactoryVehicle. Then, from the VehicleClass drop-down, select UTVehicle_Turret. This is pretty much all you need to spawn the turret in the world. Go ahead and change the TeamNum value to 0 for Red or 1 for Blue if you're using it in a team game.
Now Select the second factory and do something similar. This time, select UTFactoryAI. After that, go down into the PawnClass and change him to a UTPawn. Again, change TeamIndex to either team if need be, 255 defaults to a Deathmatch bot. Go ahead and give him a PawnName if you'd like.
Our next step is to force that pawn to get into the turret we created. Create a New Action > Pawn > Enter Vehicle. Connect the finished from the second Actor Factory to the In of the Enter Vehicle. Now connect the Target to the (???) object of the second Actor Factory and the Vehicle to the (???) from the first Actor Factory. This will effectively force that bot that we created into being the targeting system for our turret. We could stop here, as this will create the turret and man it, but there's nothing keeping that bot from leaving the turret if he gets bored or finds something important to do. In order to keep him in there, we'll add a delay loop right on top of the enter vehicle. Create the new Delay from New Action > Misc > Delay. Connect the Out of the Enter Vehicle to the Start of the Delay. Now connect the Finished of the Delay to the In of the Enter Vehicle. With this in place, the pawn will be forced to get back into the turret every second, effectively making him a permanent targeting system. (or at least until someone kills him or the turret.)
This concludes the turret tutorial! Get in the game and type "ce testturret" in the console to see them spawn!
If you have any questions or comments, feel free to leave them below. If you have a specific topic you'd like me to go over, feel free to ask!
-Ken
Before opening up Kismet at all, first decide on the area in your map where the turret is going to be placed. Right-click on the spot and add a PlayerStart actor. Add another actor close-by but not too close. (This second player start will be for the turret's bot so that there will be someone to shoot from it.) If the two points are too close together, that the bot will die on spawning due to the turret being too close to spawn point. (Ever seen a two players spawn in the same location? Needless to say, one of them usually explodes.)
Now, with your spawn points in the world, open up Kismet.
Depending on what you're using it for, you'll need a different trigger to set off our event. So for the sake of testing, I'm going to set it up on a console event. (Add Event > Misc Event > Console Event). Be sure to add a name into the ConsoleEventName space so that you can call it from game. Mine is going to be "testturret". When you activate this in-game, you'll press tab to open console and type "ce testturret".
Next, add two Actor Factories (New Action > Actor > Actor Factory). Connect the out from the event into the Spawn Actor of the actor factory. Next, connect the Finished of the first to the Spawn Actor of the second.
Now we're going to make our Object variables. With the player spawn of the turret selected, right click on the first actor factory's Spawn Point and click create object using PlayerStart_x. Do the same for the other spawn on the other actor factory. After that, right click on the Spawned part and create a blank object variable for each factory.
With the first one selected, click the blue arrow to the right of Factory. From the drop-down, select the UTActorFactoryVehicle. Then, from the VehicleClass drop-down, select UTVehicle_Turret. This is pretty much all you need to spawn the turret in the world. Go ahead and change the TeamNum value to 0 for Red or 1 for Blue if you're using it in a team game.
Now Select the second factory and do something similar. This time, select UTFactoryAI. After that, go down into the PawnClass and change him to a UTPawn. Again, change TeamIndex to either team if need be, 255 defaults to a Deathmatch bot. Go ahead and give him a PawnName if you'd like.
Our next step is to force that pawn to get into the turret we created. Create a New Action > Pawn > Enter Vehicle. Connect the finished from the second Actor Factory to the In of the Enter Vehicle. Now connect the Target to the (???) object of the second Actor Factory and the Vehicle to the (???) from the first Actor Factory. This will effectively force that bot that we created into being the targeting system for our turret. We could stop here, as this will create the turret and man it, but there's nothing keeping that bot from leaving the turret if he gets bored or finds something important to do. In order to keep him in there, we'll add a delay loop right on top of the enter vehicle. Create the new Delay from New Action > Misc > Delay. Connect the Out of the Enter Vehicle to the Start of the Delay. Now connect the Finished of the Delay to the In of the Enter Vehicle. With this in place, the pawn will be forced to get back into the turret every second, effectively making him a permanent targeting system. (or at least until someone kills him or the turret.)
This concludes the turret tutorial! Get in the game and type "ce testturret" in the console to see them spawn!
If you have any questions or comments, feel free to leave them below. If you have a specific topic you'd like me to go over, feel free to ask!
-Ken
Subscribe to:
Posts (Atom)