Tuesday, October 9, 2012

GSP 340 Week 5

This week I had to do a couple of things that are interesting and some that I'm not sure how I got through. I had to create a Scaleform Main-menu. I have had a lot of experience in Adobe Flash and Actionscript 2.0 it is one of my most favorite programs to use when creating side projects. I also had to replace all the sound files in UDK with my own. Those two things were simple the really hard part and I'm sure I won't be able to replicate because I have tried was creating a custom game type that plays as a default. I had it working once but I tried it again for a project I was working on and it wasn't working. I must have missed something but I did it about four times and still something was wrong.

I am going to explain and walk though how to create a Flash Menu and simple UI. I will try to keep this short so I will make some assumptions that you know how to do some simple things.




Start a new Actionscript 2.0 file. Make your stage size "1280x720" Create a new layer hit F9 and type "stop();"




Select the first layer and make a box using the rectangle tool. Once you done that hit "V" in your keyboard to bring up "Selection Tool" or select the BLACK arrow. Once that is done select the entire box like you would a group of files on your desktop then hit F8. Name it something unique I named mine "SButton" Your going to make sure it is a "MovieClip" the registration won't matter for what were going to be using it for.




Now once that is done you need to name is something so that Actionscript can tell the difference from this and other things that are in the frame mine is "StartBut". Now you can either create a new layer for just your code or have it in this same frame (I am going to make a new one.) Hit F9 to bring up Actionscript and your going to want to put for your START BUTTON


Startbut.onRelease=function(){

fscommand("startgame");





The final step is to create a cursors. In the layer you have your box, create something that you want to use as your mouse pointer I used the Brush tool and made a "<" tiled upward like a mouse pointer. Now hit F8 do the same things as the box WITH the exception of the registration. This time you want it to be on the top left like a mouse would be. Name your cursor something mine is "MCur" Go to your Actionscript where you have the code of the previous step and type in a new line


onEnterFrame=function(){

MCur._x=_x+_xmouse;

MCur._y=_y+_ymouse;






As of right now this flash file will work as a very simple main menu, but you are going to run into some problems when testing this out in UDK. First your background is invisible you can fix this by adding a box in a NEW layer and placing that layer underneath all your other layers so that it is the "background." The other problem that you might and most likely face is that when you hit play AFTER you do the Kismet your game will place with some default game type and this is the part where I don't know how I got it to work the first time but not the other four times. Right now I am going to jump into UDK after I imported this flash file to it. (If you don't know how to do that please read the previous entry in this blog.)

After you have your Flash File imported to UDK create a new level. A very super simple hollowed out box will be fine just make sure it has a player start and a light. (These are the assumption I was talking about earlier) Open Kismet and create a Level Loaded Node by selecting New Event>Level Loaded. Now you are going to want to make your player not move around and also hide any HUD that is visible. Create a Toggle Cinematic Mode by selecting New Action>Toggle>Toggle Cinematic Mode.




You are now going to open the flash file by doing New Action>GFxUI>Open GFx Movie. You are going to want to make sure that "Take Focus", "Capture Input" are checked and that you have your movie applied in the "Movie" section.




If you test it now nothing will happen if you click on the box and you won't be able to get out of UDK only by hitting Ctrl+Alt+Del and ending the UDK Preview window. Now we are going to make the Box start a level. You need to create a "FsCommand" New Event>GFx UI>FsCommand. under Movie you would apply the main menu movie and under it enter the fscommand  we created earlier "startgame"




We are almost complete we just have to open up the level by adding a "Console Command" New Action>Misc>Console Command. Once that is set you need to type "open NAME OF MAP"




When your done rebuild all save your little level. and run is PC Mode and click on your box to open up your actual map. Just as I mentioned above you are going to be thrown into a default game type to fix this you will have to create your own custom game type. For more imformation take a look at the GameType Technical Guide: http://udn.epicgames.com/search/?q=gametype%20technical%20guide

No comments:

Post a Comment