So for the last two weeks, I've been out of the house.
The first week was spending time with the step brothers at my dad's house.
Now, halfway through the second week, I'm ankle deep in floppy disks from the 80's cleaning out the study of a packrat grandparent who's passed on.
On the second day here, my grandmother gave me one of her old laptops. Through the night (til about 3 am), I was installing different versions of Linux to try and breath some life into the old machine that previously used Windows 2000. I wanted something lightweight that could be used as a NAS and server. The first thing I tried was Jolicloud. In my own opinion, I have to say that it's very overrated. I felt like there was absolutely no point in having it. If you're not connected to the internet, you can't even use it. Then, when you get in, it just provides links to access different websites with their version of Chrome. This chrome that they've supplied doesn't give any access to options, so you can't install addons and such easily. I immediately wanted adblock after clicking some of their shortcuts, luckily it installed fairly automatically. Once you've got passed all that and you're ready to hear things about the OS itself, well it's been made fool-proof. By that, I mean that you don't have any access to the normal things in Linux that are so necessary to get everything working the way you want it. I'm fairly sure I couldn't access the synaptic packet manager, so I couldn't get my wireless card to work at all because I couldn't get ndiswrapper. After about half an hour of playing around with it, it slowed to an absolute crawl. I would have two or three tabs up in chrome and switching between them would take 10+ seconds. (Keep in mind, all of these experiences are relative to the machine I was on). So that was gone after an hour.
I immediately hit the web searching for more Linux distros that would fit my needs.
Along those lines, I found FreeNAS, Xubuntu, Ubuntu, and another one called Mint.
Mint is focused towards media usage. It comes with most of all necessary codecs needed to play the modern files in your library. The only problem with this, is that the computer probably isn't fast enough to really handle these formats... so that's a little pointless to me.
Next up was FreeNAS. The webUI and everything on this distro is wonderful. The only problem, is that the OS itself is meant to be headless. I'm a big fan of everything this OS does, but I don't think I can get around the fact that I can't actually use the computer itself. So that one is out (until I think I actually need to use it's capabilities).
Now, as it sounds by the name, Xubuntu and Ubuntu are fairly similar. Xubuntu is a lighter weight version of Ubuntu and is probably more of what I was looking for, but I ended up going with Ubuntu. The initial decision for this is that Ubuntu 11.04 comes with Unity. Unfortunately, I didn't realize that the laptop wouldn't even be able to utilize it lol. So now it's installed and working great. One of the biggest reasons I'm keeping it is that Ubuntu has the largest community of all linux distros out there, so it will be a lot easier to get support for it if needed.
Reviews over, on to the tutorial!
Ubuntu 11.04 makes it pretty easy to set up the SMB share.
1.) First, right click a folder you want to share and setup sharing
-It should automatically download the SMB, just say yes.
2.) Open up a terminal and type this:
sudo gedit /etc/samba/smb.conf
3.) Everything in here should already look pretty good and work fairly automatically. Go ahead and test that you can access files. If not, you may need to change the workgroup. Now is the time to setup the password!
4.) Search for the area where it says "security = user". This line will most likely have either a # or ; in front of it. This means that the line is commented out. You'll need to remove this commenting to make the line work.
5.) Now, create a new user! This new user is going to act as your credentials for logging into your shared files. Give it a password as such.
6.) Now, open up terminal again. type this: sudo smbpasswd -a <user>
Of course, replace <user> with the name of the account you just made. It will then ask you for a password for the new account.
7.) This should be all you need to do in order to access with a password. When you're connecting with Windows 7, you may need to change some of your settings on the windows side of things to stop the encryption of SMB passwords. To do this, follow the letter steps.
7b.) Winkey + R; type "gpedit.msc" and hit Run. This should open up the Group Policy editor.
Follow the nested folders to Windows Settings>Security Settings>Local Policies>Security Options.
From in here, enable "Microsoft Network Client: Send unencrypted password to..."
Also, change "Network security: LAN Manager authentication level" to "Send LM & NTLM - use..."
These settings will help the password security between windows and linux play nicer with each other.
8.) Now, you should be ready to connect (I left out some things I believe aren't needed at all, if I'm wrong, it's just 2 more steps that I can easily add later)
Open up the network window on Windows 7 and find your computer. You should see the folder you're looking for. Upon clicking it, it should now give you a login window. From here type your credentials like this: "Computername\usernamer" and password as normal. If you don't specify the computer name of the server in the login, then it will think that it should be using a user from your computer and not linux. If you did everything right (and I'm right about not needing those 2 steps), then you should be able to share files!
If you run into any problems like not being able to transfer files to the hdd, try going back to your linux box and changing around the settings on the folder itself. You might find something in permissions that mentions that you only give Read-only access to outside users. So change it around as needed. Enjoy!
Tuesday, May 24, 2011
Sunday, May 22, 2011
Prolonged absence.
What turned out as a week away from my computer has turned into two. It won't be until the end of May that I will be able get to work on anything as my laptop seems to be too slow to run UDK or UnrealEd.
So if you happen to follow me, have patience!
Til then...
So if you happen to follow me, have patience!
Til then...
Thursday, May 12, 2011
Effectively Utilizing the Random Number Generator!
So today (this morning), I felt like it would be a good idea to give a quick once-over of the Random Variables.
If you've never done any programming, you've probably never run into any of these. Well, it's time to learn! If you've ever wanted to easily pick between a set of objects or wait out a random amount of time between fire-offs, then the random number generator is for you!
Example 1: Time usage.
Let's say you've got this awesome background noise that you want to go off every now and then, for no particular reason. Going the next step, you don't want it to happen with a pattern so that your players can figure out it happens every 30 seconds. In order to do this, all we need to do is setup the usual delay. Right click on an empty space and create a new Float Variable. Under the float menu, you'll see Random Float. In the first section of the variable properties, you'll see a minimum and a maximum. This is also known as the range. If you want it to happen every 30s +/- 15, then set you minimum to 15, and your maximum to 45. Easy as that. Now, loop the completion of the event back into the start of the delay and you've got it repeating at random 30 +/- 15.
Example 2: Random Functions.
So maybe you've played a lot of pokemon and you're into the whole "random encounter" situation. Well let's say you built a button. And every time you pressed the button, you had a 1 in 6 chance of being killed. (russian roulette). In order to achieve this, you would set up your kill the player function as usual and hook it up to a comparison INT. The A value would be the Random Int with a range of 1,6. The other value would be whatever you wanted the death number to be. When A == B, death ensues!
That pretty much wraps up the basics of the Random Number Generator. If you have any questions, feel free to comment!
If you've never done any programming, you've probably never run into any of these. Well, it's time to learn! If you've ever wanted to easily pick between a set of objects or wait out a random amount of time between fire-offs, then the random number generator is for you!
Example 1: Time usage.
Let's say you've got this awesome background noise that you want to go off every now and then, for no particular reason. Going the next step, you don't want it to happen with a pattern so that your players can figure out it happens every 30 seconds. In order to do this, all we need to do is setup the usual delay. Right click on an empty space and create a new Float Variable. Under the float menu, you'll see Random Float. In the first section of the variable properties, you'll see a minimum and a maximum. This is also known as the range. If you want it to happen every 30s +/- 15, then set you minimum to 15, and your maximum to 45. Easy as that. Now, loop the completion of the event back into the start of the delay and you've got it repeating at random 30 +/- 15.
Example 2: Random Functions.
So maybe you've played a lot of pokemon and you're into the whole "random encounter" situation. Well let's say you built a button. And every time you pressed the button, you had a 1 in 6 chance of being killed. (russian roulette). In order to achieve this, you would set up your kill the player function as usual and hook it up to a comparison INT. The A value would be the Random Int with a range of 1,6. The other value would be whatever you wanted the death number to be. When A == B, death ensues!
That pretty much wraps up the basics of the Random Number Generator. If you have any questions, feel free to comment!
Friday, May 6, 2011
Creating a Warfare Gametype
This is actually a lot easier than it seems. It's just that the way to set everything up isn't nearly as intuitive as the other gametypes.
Anyway!
First, create your map and save it with the WAR- tag in front of the name, telling the game that it will run on the Warfare gametype.
Make sure to add the necessary pieces to the world. You'll need 2 PowerCore_Content and at least one PowerNode_Content. (They'll be labeled Onslaught, even though that gametype isn't actually supported in this game). Both of these can be found under Actor Classes>NavigationPoint>Objective>UTGameObjective>UTOnslaughtObjective>UTOnslaughtNodeObjective>UTOnslaughtPanelNode>UTOnslaughtPowerCore/node
Now with those in the world, you're ready to connect them. Without connecting them, the game won't know how to use them at all, so this is actually a very crucial step.
Go into View>World Properties. From here, expand the WorldInfo tab and search out the MyMapInfo section. There shouldn't be anything in here yet (unless you've already added something). Click the blue arrow next to it and select UTOnslaughtMapInfo from the dropdown. Now, go down to UTOnslaughtMapInfo and expand it. You should see "LinkSetups." Expand this, then expand the thing directly beneath it. Then expand the NodeLinks section and click the green plus.
From here, it should be pretty straight forward. Expand the [0] (FromNode....) and, with your first core selected, click the green arrow to the very right of FromNode. Now connect the ToNode to your (first/only) node going in between your powercores to the ToNode link. It's essentially going to go on like that until you've connected all the dots... Just think of that one song, "the red core's connected to the - 1st node. The first node's connected to the - second node..." so on and so forth until you hit the enemy team's core. With this done, you may need to go in and test it. It's very easy to mix up which core is which and your blue core might be in your red base.
That's just about all you need to know about the basic functions of Warfare! Come back later and I may go over the different node types and how you can benefit from their use! Go try it out and remember to fix any "core" issues you may run into!
Anyway!
First, create your map and save it with the WAR- tag in front of the name, telling the game that it will run on the Warfare gametype.
Make sure to add the necessary pieces to the world. You'll need 2 PowerCore_Content and at least one PowerNode_Content. (They'll be labeled Onslaught, even though that gametype isn't actually supported in this game). Both of these can be found under Actor Classes>NavigationPoint>Objective>UTGameObjective>UTOnslaughtObjective>UTOnslaughtNodeObjective>UTOnslaughtPanelNode>UTOnslaughtPowerCore/node
Now with those in the world, you're ready to connect them. Without connecting them, the game won't know how to use them at all, so this is actually a very crucial step.
Go into View>World Properties. From here, expand the WorldInfo tab and search out the MyMapInfo section. There shouldn't be anything in here yet (unless you've already added something). Click the blue arrow next to it and select UTOnslaughtMapInfo from the dropdown. Now, go down to UTOnslaughtMapInfo and expand it. You should see "LinkSetups." Expand this, then expand the thing directly beneath it. Then expand the NodeLinks section and click the green plus.
From here, it should be pretty straight forward. Expand the [0] (FromNode....) and, with your first core selected, click the green arrow to the very right of FromNode. Now connect the ToNode to your (first/only) node going in between your powercores to the ToNode link. It's essentially going to go on like that until you've connected all the dots... Just think of that one song, "the red core's connected to the - 1st node. The first node's connected to the - second node..." so on and so forth until you hit the enemy team's core. With this done, you may need to go in and test it. It's very easy to mix up which core is which and your blue core might be in your red base.
That's just about all you need to know about the basic functions of Warfare! Come back later and I may go over the different node types and how you can benefit from their use! Go try it out and remember to fix any "core" issues you may run into!
Sunday, May 1, 2011
Making a Take Damage trigger activate on selective damage
So today I'm going to go over something that you may or may not be able to accomplish. Apparently, there's a bug in the Unreal 3 Editor which will cause the Take Damage triggers to lose some functionality. When this happens, only splash damage weapons like the Shock Ball, Rocket, and Flak Ball will work. Unfortunately, I don't have a fix for that. The best way to make sure something will work with all weapons is to create the Take Damage trigger, alter the damage threshold, and never touch it again. As soon as you start messing with the damage types, this bug will happen.
Anyway, here's how to tell the game to differentiate between those 3 damage types I mentioned above.
So, setup your damage threshold to whatever you want. A rocket is going to do roughly 100 damage every hit. Same can be said for the flak ball, and the Shock Ball is going to do roughly half of that. So I'm going with something that factors by 100. To make it easy, I'm just going with 100.
Have your weapon-blocking actor selected and right click in Kismet to get a new event based on that actor and go to Take Damage. Once you have this, the threshold should already be at 100. Good. Now go into DamageTypes and click the green plus. This will give you a drop down menu. At this point, the bug is probably happening, so the only damage types we need to worry about taking effect are the weapons with splash damage that you're putting in your level. For me, it's flak, shock, and rocket. So I'm going to make this one a shock ball sensor. I'm going to add my shock rifle beam and shockrifle ball from the drop down of DamageTypes. Then, I'm going to add my flak and rocket damage types into the Ignored section so that they don't help get to the threshold.
Once that's done, connect a log or something that you want to happen up to it. I'm going to go off doing a custom event from here, so mine will get much more complicated after this. Make it output to screen so that you know it's working and how often it does so. Now go in game and test out your trigger. It should now only fire off if the correct weapon was used to attack it. If the object you selected to take damage isn't responding at all, make sure that it has collision and is set to at least block weapons.
Any questions or comments, feel free to leave a comment.
Anyway, here's how to tell the game to differentiate between those 3 damage types I mentioned above.
So, setup your damage threshold to whatever you want. A rocket is going to do roughly 100 damage every hit. Same can be said for the flak ball, and the Shock Ball is going to do roughly half of that. So I'm going with something that factors by 100. To make it easy, I'm just going with 100.
Have your weapon-blocking actor selected and right click in Kismet to get a new event based on that actor and go to Take Damage. Once you have this, the threshold should already be at 100. Good. Now go into DamageTypes and click the green plus. This will give you a drop down menu. At this point, the bug is probably happening, so the only damage types we need to worry about taking effect are the weapons with splash damage that you're putting in your level. For me, it's flak, shock, and rocket. So I'm going to make this one a shock ball sensor. I'm going to add my shock rifle beam and shockrifle ball from the drop down of DamageTypes. Then, I'm going to add my flak and rocket damage types into the Ignored section so that they don't help get to the threshold.
Once that's done, connect a log or something that you want to happen up to it. I'm going to go off doing a custom event from here, so mine will get much more complicated after this. Make it output to screen so that you know it's working and how often it does so. Now go in game and test out your trigger. It should now only fire off if the correct weapon was used to attack it. If the object you selected to take damage isn't responding at all, make sure that it has collision and is set to at least block weapons.
Any questions or comments, feel free to leave a comment.
Friday, April 29, 2011
Knowing the different Lighting Types in UnrealEd
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.
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.
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)