Sega 500 More on Possession and Using Stuff Jeff “Ezeikeil” Giles

Slides:



Advertisements
Similar presentations
First of all – lets look at the windows you are going to use. At the top you have a toolbar, with all your various tools you can use when customising your.
Advertisements

Global On Line Assessment (The GOLA Exams) Coping with Complex Questions Presented by Norman Leaver Learnatrade Ltd. ©Norman Leaver.
TEST-TAKING STRATEGIES FOR THE OHIO ACHIEVEMENT READING ASSESSMENT
Getting started with LEGO NXT Mindstorms software This is intended to be a short introduction to the LEGO Mindstorms software and programming the LEGO.
BROWNSBURG BASKETBALL
Princess & Dragon – Version 2 By Michael Hoyle under the direction of Professor Susan Rodger Duke University July 2012 Part 3: Billboards, Events, Sounds,
1. Tuesday: Halloween Shoot due TOMORROW. You must make a contact sheet of your photos and print it from my computer tomorrow. -5 pts for every day I don’t.
Exponential Functions Logarithmic Functions
Address Your posture looks pretty good here. Basically, with perfect posture, that line I drew should go through the balls of your feet, the tips of your.
CS 106 Introduction to Computer Science I 09 / 25 / 2006 Instructor: Michael Eckmann.
Mr Barton’s Maths Notes
Second Grade English High Frequency Words
Programming – Touch Sensors Intro to Robotics. The Limit Switch When designing robotic arms there is always the chance the arm will move too far up or.
Lesson 4: Percentage of Amounts.
Alice Learning to program: Part Two by Ruthie Tucker and Jenna Hayes Under the direction of Professor Susan Rodger Duke University, July 2008.
Random Stuff Colors Sizes CSS Shortcuts. Learning Objectives By the end of this lecture, you should be able to: – Identify the 3 most common ways in which.
Offensive Line Play and Drills. Philosophy to Coaching Offensive Line 1. Developing Players Individually Breeds Success Instead of Failure. 1. Give the.
Databases with PHP A quick introduction. Y’all know SQL and Databases  You put data in  You get data out  You can do processing on it very easily 
In.  This presentation will only make sense if you view it in presentation mode (hit F5). If you don’t do that there will be multiple slides that are.
How to make Space Invaders
Sega 500 Intro to Bot AI Jeff “Ezeikeil” Giles
Making a Boat Racing Game in Alice By Jenna Hayes Under the direction of Professor Susan Rodger Duke University, July 2010.
Nachos Phase 1 Code -Hints and Comments
.:::The EA FEAR Division Presents:. When you download FEAR you should be able to load it pretty quickly, so if it’s taking long consider the problems.
Geo II ch 5 Edited 10/14/05 1 GPS- Collecting Data Now that you have your data dictionary loaded, let’s configure the unit and take it outside! RECOMMENDED:
Programming with Alice Computing Institute for K-12 Teachers Summer 2011 Workshop.
Mathematics as a Second Language Mathematics as a Second Language Mathematics as a Second Language Developed by Herb Gross and Richard A. Medeiros © 2010.
Sega 500 Close Combat weapons Jeff “Ezeikeil” Giles
Instructor: Chris Trenkov Hands-on Course Python for Absolute Beginners (Spring 2015) Class #002 (January 17, 2015)
A Christmas Story. On the last day before Christmas, I hurried to go to the supermarket to buy the gifts I didn't manage to buy earlier. When I saw all.
Sega 500 More replication Jeff “Ezeikeil” Giles
Sega 500 Placing target boxes on the HUD Jeff “Ezeikeil” Giles
The Awesomest Powerpoint Game Ever! (Quest #1) Awesomely Created By Lucy Dowell New Player Returning Player.
Sight words.
Moving Around in Scratch The Basics… -You do want to have Scratch open as you will be creating a program. -Follow the instructions and if you have questions.
Click your mouse for next slide Dreamweaver – Inserting and Formatting Text Inserting text is just as easy as inserting pictures If you wish to type text.
MA 1128: Lecture 17 – 6/17/15 Adding Radicals Radical Equations.
EQ: How can we learn the basics of formatting a college research paper in Microsoft Word? Mini Unit: Typing a Paper Diogene Date: 4/20/2015 Course: ELA-Grade.
Game Maker – Getting Started What is Game Maker?.
Grade Book Database Presentation Jeanne Winstead CINS 137.
Geo 3 ch 5 Collecting Data Edited 10/14/05 1 GPS- Collecting Data Now that you have your data dictionary loaded, let’s configure the unit and take it outside!
Alice Learning to program: Part Two Writing Your Own Methods by Ruthie Tucker and Jenna Hayes Under the direction of Professor Susan Rodger Duke University,
Build-It-Yourself.com BLENDER 3D LESSON 3 BLENDER 3D LESSON 3.
CS 106 Introduction to Computer Science I 09 / 26 / 2007 Instructor: Michael Eckmann.
SCHOOL BUS & ROAD SAFETY. Hi friends, I am Buddy. I travel by the school bus everyday. I understand the importance of school-bus safety in our lives.
Sight Words.
Sega 500 Scripted events and Sequences Jeff “Ezeikeil” Giles
1 Day 2 Logging in, Passwords, Man, talk, write. 2 Logging in Unix is a multi user system –Many people can be using it at the same time. –Connections.
Sega 500 Combo Mutator Jeff “Ezeikeil” Giles
Programming Fundamentals. Topics to be covered Today Recursion Inline Functions Scope and Storage Class A simple class Constructor Destructor.
COLD READING UNIT. WHAT DO YOU THINK ABOUT WHEN YOU HEAR “COLD READING?”
You can do this as a nice warm up to get the players minds working. These simple ideas are designed to get (forces) players to look away from the ball.
Repetition everywhere – comparing while in a method and as an event Susan Rodger Duke University July 2010.
Working with Coaches and Players. Although nobody can tell you how to deal with every situation your personal strengths will aid you when working with.
Working with Coaches and Players. Although nobody can tell you how to deal with every situation your personal strengths will aid you when working with.
Instructor: Chris Trenkov Hands-on Course Python for Absolute Beginners (Spring 2015) Class #003 (February 14, 2015)
Introduction to Exceptions in Java CS201, SW Development Methods.
This I Believe Essay Writer’s Workshop: Introductions, Juicy Details, & Conclusions 8 th ELA St. Joseph School.
Algebra Geek Patrol The Pocket Protectors of Algebra.
Troubleshooting Dashhawk Issues. Here's what you have to do to have the DashHawk run properly Go to the ACTUAL PROGRAM file (not the short cut)
Game Maker Tutorials Introduction Clickball IntroductionClickball Where is it? Shooting Where is it?Shooting.
Mr Barton’s Maths Notes
Mr F’s Maths Notes Number 7. Percentages.
Sentinel logic, flags, break Taken from notes by Dr. Neil Moore
Unreal Engine and C++ We’re finally at a point where we can start working in C++ with Unreal Engine To get everything set up for this properly, we’re going.
Sentinel logic, flags, break Taken from notes by Dr. Neil Moore
CIS 488/588 Bruce R. Maxim UM-Dearborn
Mr Barton’s Maths Notes
Presentation transcript:

Sega 500 More on Possession and Using Stuff Jeff “Ezeikeil” Giles

Review So yesterday we covered the basics of how possession works and looked at how the Redeemer and the Bulldog do their thing. We also created our own pawn class for our mortar and set it up so that our pawn can take possession of it.

Today We’re going to finish off the basic functionality for our mortar and then expand on this functionality. Hopefully leaving nothing but a few tweeking and polish issues.

The Goal Were going to set up our mortar so that the player can do the following The player freely possess and unpossess it at will. Fire shells Rotate the pawn with the mortar If the players original pawn dies, the player restarts.

Building on Yesterday We’ve covered the basics of the set up, got the mortar in with it’s “sensor” trigger and we can possess it just fine. But we can’t ever unpossess it. We’re locked in. So lets fix that first.

Building on Yesterday Logic has it that if we created a function to swap our possession over to the new pawn (mortar) that we should be able to simply repeat the process for our old pawn. Well…yeah….fundamentally, that’s what we do.

Building on Yesterday So if we just do the following: userPC.bBehindView=false; userPC.UnPossess(); userPC.Possess(userPawn); userPC.GotoState('PlayerWalking'); userPawn=none; Repossess our old pawn Return the controller to walking Reset the user pawn, no one is using the mortar

Building on Yesterday And yeah! This will work…that’s not the odd thing. But let me ask you…where do we call this from?

Building on Yesterday Well, can’t we just use the same function name that the driving state uses?

Building on Yesterday In theory, yes. In practice, nope, afraid not. That functionality is specific to vehicles and done with all sorts of flags. Have a look in state playerdriving for the exit command.

Building on Yesterday How the vehicle knows to toss the player our and reset the controllers. // check for 'jump' to throw the driver out. if(InJump && Role == ROLE_Authority) { DrivenVehicle.bGetOut = true; return; }

Building on Yesterday On the surface, this looks like a bad thing…but really it’s not. Actually, it gives us a really good hint on what needs to be done. Remember, that code snippet came from the playerdriving state in player controller.

Building on Yesterday These vehicle flags are all set from the player controller in the driving state and these tell the vehicle what actions to perform. In other words, we need a new controller to deal with our states which are specific to the mortar.

A New Controller Fundamentally, what we want to do here is create a new controller which will play nice with our new object. So we create one off of xPlayer class ArtyPC extends xPlayer;

A New Controller And now inside here, we have the option of creating new functionality for our player… However the game has to know about it first.

A New Controller Thus, we are now limited to three options for telling the game to use our controller as opposed to the default xPlayer. Via Mutator, game type or mortar itself.

A New Controller Starting with the game type, which should be review, it’s simple a matter of redefining which player controller to use in our game. PlayerControllerClassname="Rnl.ArtyPC"

A New Controller Got to love the one liners. This will of course require the appropriate *.int file so that the player can select the new game type.

A New Controller Personally, I feel that this case warrants a new game type as it has a considerable impact on the game play. Not to mention the fact that we are introducing new items into a level which will only function with the appropriate controller.

A New Controller Now, as we mentioned, it’s also possible to change the controller that the game uses via a mutator. This is not hard and may well be appropriate in some cases. Say for example if the mortar is deployable as opposed to static.

A New Controller So we derive a new mutator class off of Mutator: And, this one is not much harder to implement either… class MortMut extends Mutator;

A New Controller Set the new controller via PreBeginPlay. event PreBeginPlay() { super.PreBeginPlay(); Level.Game.PlayerControllerClassName="Rnl.ArtyPC"; }

A New Controller And set up the defaults so that we can access it from the menus DefaultProperties { IconMaterialName="MutatorArt.nosym" ConfigMenuClassName="" GroupName="Meet Morty" FriendlyName="Meet Morty" Description="Steel rain" }

A New Controller And then there’s option number three. Which is to have the mortar tell the game type to use the new controller. Simple have a function in the mortar class notify the game when it’s initialized

A New Controller Like the mutator, this can also be done via the PreBeginPlay. event PreBeginPlay() { super.PreBeginPlay(); Level.Game.PlayerControllerClassName="Rnl.ArtyPC"; } In this case I placed the functionality in the MortTrigger class.

A New Controller This method is nice in the sense that the usage of a specific controller is transparent to the player / designer. If the mortar is in the level, it takes care of itself. However, this could cause problems if there are several items in need of different controllers.

A New Controller And from here we’re good to go. However, this method feels a bit dangerous to me. But, it seems to function just fine. Doesn’t even log any errors to file.

A New Controller So which ever method you choose to use to init your controller is up to you, there are valid arguments for all three. Just be aware of the pitfalls…

Making it Work Right, so now that our controller is in place, we can safely make our mortar do stuff. Starting with the release of the player back to it’s original pawn.

Making it Work So wrapping up all the previously discussed functionality into a function called: function Release() { userPC.bBehindView=false; userPC.UnPossess(); userPC.Possess(userPawn); userPC.GotoState('PlayerWalking'); userPawn=none; }

Making it Work We can now call this from the new controller we created. But first, we need a state to call it from. state artycontrol

Making it Work Inside this state, we’ll create a function that will call the release method in the mortar. For now, I’m just going to use the altfire method. exec function AltFire(optional float F) { local Mort mt; mt = Mort(Pawn); mt.Release(); return; }

Making it Work And TA-DA! The player can now freely get “into” and “out of” the mortar.

Making it Work At this point, this is pretty much what our whole state looks like. state artycontrol { ignores SeePlayer, HearNoise, Bump; exec function AltFire(optional float F) { local Mort mt; mt = Mort(Pawn); if(mt != None) { mt = Mort(Pawn); mt.Release(); }

Making it Work But doing it this way is kind of lame since I could quite, realistically want to use the alt fire for something like ….well…shooting for one! Using the jump key might be just a bit more appropriate.

Making it Work Rooting around some of the other states, we find that PlayerMove is really common. And guess what? It handles all the player movement…Go figure?

Making it Work function PlayerMove( float DeltaTime ) { local Mort mt; mt = Mort(Pawn); if(mt != None) { if(bPressedJump) { mt = Mort(Pawn); mt.Release(); } If effect, we move the body of the function from the alt fire, over to this one and check it against the bPressedJump to see if the button was pressed.

Making it Work But there’s a method to my madness here. This is the ideal place to update the pawns rotation so that it’s the same as the mortars.

Making it Work function PlayerMove( float DeltaTime ) { local rotator rot; …. if(bPressedJump) { rot.Yaw = Rotation.Yaw; mt.userPawn.SetRotation(Rot); mt = Mort(Pawn); mt.Release(); } UpdateRotation(DeltaTime, 2); } All I need to do is grab the rotation of the view axis (Yaw) and stuff it into rot And update my pawn.

Making it Work And thus, our pawn turns with the mortar and can “jump” out of it at any time.

Bringing Down the Steel Rain Well, an artillery piece if not really much good if it doesn’t shoot anything. Time to blow up some stuff.

Bringing Down the Steel Rain The goal here is just to get it to fire in an approximatly accurate fashion. Proper alignment and velocity can be done later. Here I’m just after getting a reasonable velocity and direction.

Bringing Down the Steel Rain So, that being said…lets blow stuff up! As you my have guessed, we need a method for our controller to call which will allow our mortar to fire. You guessed it, done in the player controller.

Bringing Down the Steel Rain Nothing really new here. Same methodology, make sure our pawn is valid and call one of it’s methods. exec function Fire(optional float F) { local Mort mt; mt = Mort(Pawn); if(mt != None) { mt.Fireone(); }

Bringing Down the Steel Rain And actually the FireOne method is pretty simple, very little newness here. function Fireone() { local vector FireLocation, FireOffset; local flakshell R; FireLocation = Location + (FireOffset >> Rotation); PlaySound(sound'WeaponSounds.P1RocketLauncherAltFire'); R = spawn(class'xWeapons.flakshell', Instigator,, FireLocation, userPC.Rotation); //userPC.SetViewTarget(R); //uncomment for a nose cam view gotostate('reload'); }

Bringing Down the Steel Rain With the exception for where we fire our shell from FireLocation = Location + (FireOffset >> Rotation); Where we spawn the shell Right rotation operator

Bringing Down the Steel Rain This operator is kind of a handy little toy. In effect, it allows us to offset our fire location relative to our mortar.

Bringing Down the Steel Rain Which is to say that if I want my fire location to be offset to my right, by an absolute amount, I can use the >> operator to rotate it right around the location. For example:

Bringing Down the Steel Rain This will cause the shell to be spawned 128 units to my right. This spawn location then rotates around my location as I rotate. Staying a distance of 128 units. FireOffset.y=128; FireLocation = Location + (FireOffset >> Rotation);

Bringing Down the Steel Rain The shell spawns about here 128 units

Bringing Down the Steel Rain Think of this another way, if you hold a pen in your right hand and stick your arm straight out, no matter how you turn in place, that pen will be the same distance from your head. The same thing is happening here. There are also left shift operations as well.

Bringing Down the Steel Rain So right now, our mortar fires just fine…as quickly as you can hit the fire button as a matter of fact. That’s a little lame on the game play side of things, so taking a page from the reloading weapons, we go to state reload. gotostate('reload');

Bringing Down the Steel Rain Which we define as: state reload { function Fireone() {} begin: sleep(1); userPC.SetViewTarget(self); gotostate(''); } Nothing fancy. While reloading, disable FireOne wait for X amount of time to pass then return to the default state.

Bringing Down the Steel Rain And now we can really bring down some pain and suffering with our steel rain.

Bringing Down the Steel Rain So the last thing we have to do is check to see if our user pawn gets kill off. Because as it stands, we’ve transferred our “consciousness” to the mortar and, unless we check the pawn, we’re functionally immortal… until we try to leave the mortar that is.

Bringing Down the Steel Rain So we need to check if our pawn is still alive…frequently. And nothing gets checked more frequently than tick.

Bringing Down the Steel Rain So still in our mortar class, I override the tick method to check our pawn’s life status. Once your read it, it’s quite simple…

Bringing Down the Steel Rain function Tick(float DeltaTime) { super.Tick(DeltaTime); if(userPawn != none) { if(userpawn.Health <=0 || userPawn.IsInState('Dying')) { userPC.SetViewTarget(userPawn); Release(); userPC.gotostate('Dead'); } So what does it do?

Bringing Down the Steel Rain

Here’s the bit that does the work. if(userpawn.Health <=0 || userPawn.IsInState('Dying')) { userPC.SetViewTarget(userPawn); Release(); userPC.gotostate('Dead'); } Look at my corpse Release possession of the mortar…can’t take it with me Tell the controller to act dead Any signs of life?

Bringing Down the Steel Rain And there you have it! One functional fixed mortar pit that covers all the bases…just needs some polish for some of the finer details.

That’s a Warp There you go, your first steps towards using items in UT2003. You now have all the tools required to get started building your vehicles, security cams, static guns, psychic powers and what not.

That’s a Warp I hope you found this interesting and remember, it’s true for UT as it is for the legal system... Possession is 9/ 10 th of the law