cse4mod advanced bits n’ pieces

25
CSE4MOD Advanced bits n’ pieces Paul Taylor 2009

Upload: fagan

Post on 22-Feb-2016

30 views

Category:

Documents


0 download

DESCRIPTION

CSE4MOD Advanced bits n’ pieces. Paul Taylor 2009. Vectors and Rotators. Vector: Float X Y Z Network Replication: 16bit int (- 32768-32767) Rotator: Integer Pitch Yaw Roll (16bit U-Sig) Network Replication: 8bit ints (>>8) Unrealscript uses radians 2Pie = 360 Degrees = 65535 - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: CSE4MOD  Advanced bits n’ pieces

CSE4MOD Advanced bits n’ pieces

Paul Taylor 2009

Page 2: CSE4MOD  Advanced bits n’ pieces

Vectors and Rotators

• Vector: Float X Y Z– Network Replication: 16bit int (- 32768-32767)

• Rotator: Integer Pitch Yaw Roll (16bit U-Sig)– Network Replication: 8bit ints (>>8)

• Unrealscript uses radians– 2Pie = 360 Degrees = 65535

• Degrees = Rad * 180/Pie• Radians = Deg / 180 * Pie• UUnits = Rad * 32767.5 / Pie• Radians = Uunits / 32767.5 * Pie

Page 3: CSE4MOD  Advanced bits n’ pieces

Vector from Rotator

Var rotator myRot;Var vector myVect;myRot = rot(32767.5, 0,0) // Upside downmyVect = vector(myRot)// Or adding magnitudemyVect = 100* vector(myRot)

Page 4: CSE4MOD  Advanced bits n’ pieces

Vector Size

Var vector A;Var float B;A = vect(0, 20, 0);// Magnitude of vector AB = VSize(A);

Page 5: CSE4MOD  Advanced bits n’ pieces

Normalising Vectors

Var vector myVect;Var vector myNorm;myVect = (21345,1234,4343);myNorm = Normal(myVect);

Page 6: CSE4MOD  Advanced bits n’ pieces

Dot Products

• These are used for the angle between two vectors

Var vector A, B;Var float angle;A = vector(10,1234,1234);B = vector(0,0,324);Angle = Normal(A) dot Normal(B);

Page 7: CSE4MOD  Advanced bits n’ pieces

Modifying Rotators in existing Classes

• After creating your rotation, you MUST use SetRotation();

• This is the same as movement, using SetLocation(); or Move(); etc

• All defined in Actor.uc

Page 8: CSE4MOD  Advanced bits n’ pieces

Linked Lists

• These are your replacement for dynamic arrays, which are not available in UnrealScript

This is a 2 part solution, we have a handler, and an Array Object

Class ArrayContainer extends Actor;var ArrayObject ObjectNo1;

Class ArrayObject extends Object;Var ArrayObject NextObject;

Page 9: CSE4MOD  Advanced bits n’ pieces

Enumerating Objects

Var ArrayObject Element;For (Element= ObjectNo1; Element!=none;

Element= ObjectNo1.Next){

// Do something}

Page 10: CSE4MOD  Advanced bits n’ pieces

Adding to the Array

Class Object:TempElement = New (none) class‘ArrayObject’;

Actor Object:TempElement = Spawn(class’ArrayObject’)

Depends on which type of object your list is made of

Page 11: CSE4MOD  Advanced bits n’ pieces

Adding to the Front = Easy

TempElement.next = ObjectNo1;ObjectNo1 = TempElement;

Page 12: CSE4MOD  Advanced bits n’ pieces

Adding to the back = Almost as Easy

Var ArrayObject Element;Element= ObjectNo1While(Element.Next != none)

Element= ObjectNo1.Next;

Element.Next = TempElement;TempElement.next = None; // Not really

needed!

Page 13: CSE4MOD  Advanced bits n’ pieces

Adding to the middle = hardest

Var ArrayObject Element;For (Element= ObjectNo1; Element!=none; Element=

ObjectNo1.Next){

// Check if this is the element we want to insert afterbreak; // Stop at this point

}tempElement.Next = Element.Next;Element.Next = tempElement;// Done!

Page 14: CSE4MOD  Advanced bits n’ pieces

Removing ObjectsVar ArrayObject doomedObj;For (Element= ObjectNo1; Element!=none; Element=

ObjectNo1.Next){

if (Element.Next == doomedObj){Element.Next = doomedObj.Next;return true;}

}Return false;

Page 15: CSE4MOD  Advanced bits n’ pieces

Game Types and Limitations

Deathmatch Games• All you need are weapons, PlayerStarts and a

good navigation network• This encompasses Team DM, Last Man

Standing, etc• Anything that has the only real goal of Kill or

be Killed• xGame.xDeathMatch, xGame.TeamGame

Page 16: CSE4MOD  Advanced bits n’ pieces

CTF (Capture The Flag)

• Two teams Only supported• One flag per team (multiples will fail)• xGame.xCFTGame– You must have an xBlueFlagBase and

xRedFlagBase.• Symmetry / A-Symmetry is required as there is

no team-swap mid game

Page 17: CSE4MOD  Advanced bits n’ pieces

Double Domination

• Teams must ‘control’ two points on a map for 10 seconds to score a point

• Level needs to have two points or more– xDomPointA xDomPointB, etc– You can use xMonitor->xDOMMonitorA / B to

create monitors which show who is controlling the area

Page 18: CSE4MOD  Advanced bits n’ pieces

Bombing Run

• This game type requires 3 objects– xBombSpawn actor– Two xBombDelivery actors• With Team->Team set to 0 and 1

Page 19: CSE4MOD  Advanced bits n’ pieces

Onslaught = Sweet

• Power Cores• Vehicles• Teleport Pads• Power Nodes

• Link Setup Must be exported to UnrealEd from In-Game

Page 20: CSE4MOD  Advanced bits n’ pieces

Linking Power Nodes and Power Cores

• Start your ONS map– Press esc, select the Map button– Click on Link Designer– Create your links then click on the ‘Export to

UnrealEd button.• This copies the info into the cut-paste ram.

– Right click in the level editor and select paste.– An eagle head will appear labelled

ONSPowerLinkOfficialSetup

Page 21: CSE4MOD  Advanced bits n’ pieces

Assault = Difficult

• Set Up Objectives• Player Spawn Management• Intro and Ending Scenes

Page 22: CSE4MOD  Advanced bits n’ pieces

Objectives

• TriggeredObjective• HoldObjective• DestroyableObjective• ProximityObjective

Page 23: CSE4MOD  Advanced bits n’ pieces

PlayerSpawnManagers

• You need two for each objective– Attackers– Defenders

– Team Numbers are used on the PlayerSpawnPoints to identify their associated Manger and thus Objective.

Page 24: CSE4MOD  Advanced bits n’ pieces

The End

Page 25: CSE4MOD  Advanced bits n’ pieces

Referecnces

• http://chimeric.beyondunreal.com/tutorials.php