1 / 25

CSE4MOD Advanced bits n’ pieces

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

fagan
Télécharger la présentation

CSE4MOD Advanced bits n’ pieces

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSE4MOD Advanced bits n’ pieces Paul Taylor 2009

  2. 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

  3. Vector from Rotator Var rotator myRot; Var vector myVect; myRot = rot(32767.5, 0,0) // Upside down myVect = vector(myRot) // Or adding magnitude myVect = 100* vector(myRot)

  4. Vector Size Var vector A; Var float B; A = vect(0, 20, 0); // Magnitude of vector A B = VSize(A);

  5. Normalising Vectors Var vector myVect; Var vector myNorm; myVect = (21345,1234,4343); myNorm = Normal(myVect);

  6. 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);

  7. 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

  8. 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; varArrayObject ObjectNo1; Class ArrayObject extends Object; VarArrayObjectNextObject;

  9. Enumerating Objects VarArrayObject Element; For (Element= ObjectNo1; Element!=none; Element= ObjectNo1.Next) { // Do something }

  10. 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

  11. Adding to the Front = Easy TempElement.next = ObjectNo1; ObjectNo1 = TempElement;

  12. Adding to the back = Almost as Easy VarArrayObject Element; Element= ObjectNo1 While(Element.Next != none) Element= ObjectNo1.Next; Element.Next = TempElement; TempElement.next= None; // Not really needed!

  13. Adding to the middle = hardest VarArrayObject Element; For (Element= ObjectNo1; Element!=none; Element= ObjectNo1.Next) { // Check if this is the element we want to insert after break; // Stop at this point } tempElement.Next = Element.Next; Element.Next = tempElement; // Done!

  14. Removing Objects VarArrayObjectdoomedObj; For (Element= ObjectNo1; Element!=none; Element= ObjectNo1.Next) { if (Element.Next == doomedObj) { Element.Next= doomedObj.Next; return true; } } Return false;

  15. 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

  16. 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

  17. 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 • xDomPointAxDomPointB, etc • You can use xMonitor->xDOMMonitorA / B to create monitors which show who is controlling the area

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

  19. Onslaught = Sweet • Power Cores • Vehicles • Teleport Pads • Power Nodes • Link Setup Must be exported to UnrealEd from In-Game

  20. 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

  21. Assault = Difficult • Set Up Objectives • Player Spawn Management • Intro and Ending Scenes

  22. Objectives • TriggeredObjective • HoldObjective • DestroyableObjective • ProximityObjective

  23. PlayerSpawnManagers • You need two for each objective • Attackers • Defenders • Team Numbers are used on the PlayerSpawnPoints to identify their associated Manger and thus Objective.

  24. The End

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

More Related