
- •Index of Unreal Script
- •Unreal Script Pag. 2
- •Tutorials Pag. 111
- •FlakCannon Class Declaration
- •The Variable Declaration
- •I n t e g e r Keyword: int
- •Integer Example
- •Integers and Floats Don't Mix
- •Struct Example
- •For Loop Example
- •Do Loop Example
- •While Loop Example
- •Switch Statement Example
- •Simple Function Example
- •The Weapon Idle State
- •Default Properties Variable
- •New Variable Declarations
- •UnrealScript Language Reference
- •Introduction
- •Variables
- •Expressions
- •Functions
- •Program Structure
- •Language Functionality
- •Advanced Language Features
- •Accessing default values of variables
- •Accessing default values of variables in a variable class
- •Accessing static functions in a variable class: Static functions in a variable class may be called using the following syntax.
- •Advanced Technical Issues
- •Vectors and Rotators
- •Mod Authoring for Unreal Tournament
- •Introduction
- •The Lazy Man's Guide
- •Some Advice to Start With
- •The Three Mod Types
- •A Few Things to Watch Out For
- •Getting Dirty: Setting Up Your Project.
- •How You Build Your Package
- •Making a Mutator
- •The Anatomy of Mutator
- •Introduction to GameTypes
- •A First Look at GameInfo
- •DeathMatchPlus, a specific game type. Adding a Heads Up Display
- •Adding a Scoreboard
- •Uwindows
- •It all begins with uWindowBase?
- •It didn't compile!
- •Object Oriented Logic Tutorial
- •Introduction
- •Events:
- •Engine.Actor Functions:
- •Latent Functions:
- •Iterator Functions
- •Events:
- •Physics Modes:
- •Game Startup:
- •The Actor Class
- •Imported Data
- •The Object Class
- •Integer operators
- •Integer functions
- •Tutorials
Vectors and Rotators
function VectorRotator()
{
local rotator VectRot;
local vector SomeVector;
VectRot = Player.ViewRotation;
VectRot.Yaw = VectRot.Yaw + 8192;
SomeVector = Vector(VectRot);
}
Note that this is all assuming "Player" is an actor reference variable set equal to some PlayerPawn. Anyway, what's going on here? Well, first, VectRot is set equal to the player's view rotation. Then, 8192 (45 degrees) is added to its yaw, making it point 45 degrees to the player's right. Finally, SomeVector is set equal to "Vector(VectRot)". The Vector() function simply takes a rotator, and returns a vector pointing in the same direction as the rotator, with a length (speed) of one. So, now you have an easy way of getting a vector that points in any direction. But what about its speed? What if you want a vector with a speed of five instead of one? This is easy, too. Simply multiply the one-length vector by five. You'll get a vector pointing in the same direction, but with a length of five instead of one.
O t h e r V e c t o r O p e r a t i o n s
There are quite a few little tricks you can use to get the vector you're looking for. For instance, how the hell would you come up with a vector that points from one object to another? It's simple, really. You just have to know the trick. So, for your reading pleasure, here is the amazing and wonderful chart of useful UnrealScript vector operations.
Normal(Direction):Returns a vector pointing in the same direction as the vector you supply, but with a length of one.
VSize(Direction):Returns a floating point value equal to the length of the vector you supply.
Direction + Direction:Returns a direction vector which is equal to the bisector of the parallelogram formed by the original two direction vectors. What the bloody hell does this mean? Just take a look at the diagram.
As you can see, this is on a 2D plane, and we're talking about 3D space. If you think about it, though, two vectors in 3D space, no matter which direction they're pointing, can always be thought of as being on some 2D plane or another.
Location - Location:Gives you a direction vector which points from the second location to the first, and has a length equal to the distance between the two locations. This is not only useful for making one object move towards another, but also for determining the distance between things.
Location + Direction:Gives you a location equal to the new location an object would have after one unit of time with a velocity of the direction vector. If that made no sense whatsoever to you, think of it this way. Take the X component of the location vector, and add to it the X component of the direction vector. Do the same for the Y and Z components, and you'll end up with the location that's returned by this operation.
Mod Authoring for Unreal Tournament
Introduction
Writing mods for the Unreal engine can be an extremely rewarding task. In the current state of the games industry, there is little better a way for a skilled programmer to show the world what he is capable of. This document is intended to give interested mod authors the information they need to write a successful mod for the Unreal engine. I will include technical information as well as pointers on mod development. If you work hard, you can get some fun stuff done through mod authoring.