Introduction to Half Life 2 Modding ● Seminar Eight – The story so far: ● Creating a mod via Source SDK ● Introduction to Hammer ● Hammer techniques ●

Slides:



Advertisements
Similar presentations
Escape Sequences \n newline \t tab \b backspace \r carriage return
Advertisements

Lists Chapter 4 Carrano, Data Structures and Abstractions with Java, Second Edition, (c) 2007 Pearson Education, Inc. All rights reserved X.
Container Classes A container class is a data type that is capable of holding a collection of items. In C++, container classes can be implemented as.
MWD1001 Website Production Using JavaScript with Forms.
Lecture # 21 Chapter 6 Uptill 6.4. Type System A type system is a collection of rules for assigning type expressions to the various parts of the program.
Lists CSE 1310 – Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington 1.
Conditional Statements Introduction to Computing Science and Programming I.
Lists Introduction to Computing Science and Programming I.
19-Jun-15 Access to Names Namespaces, Scopes, Access privileges.
Programming with Collections Grouping & Looping - Collections and Iteration Week 7.
Checking for Collisions Ellen Yuan Under the direction of Professor Susan Rodger at Duke University June 2014.
What is RobotC?!?! Team 2425 Hydra. Overview What is RobotC What is RobotC used for What you need to program a robot How a robot program works Framework.
11 Values and References Chapter Objectives You will be able to: Describe and compare value types and reference types. Write programs that use variables.
Copyright 2007, Information Builders. Slide 1 Maintain & JavaScript: Two Great Tools that Work Great Together Mark Derwin and Mark Rawls Information Builders.
Iteration. Adding CDs to Vic Stack In many of the programs you write, you would like to have a CD on the stack before the program runs. To do this, you.
Timers in Unreal By Todd Brown. Setting up a timer Add ‘simulated function Timer()’ to your class Within this function, put the code for whatever you.
SharePoint document libraries I: Introduction to sharing files Sharjah Higher Colleges of Technology presents:
1 2.2 Selection Logical Operators. 2 Learning Objectives Explain how the logical operator AND Boolean statements works.
Project 1 Due Date: September 25 th Quiz 4 is due September 28 th Quiz 5 is due October2th 1.
IMPLEMENTING ARRAYLIST – Part 2 COMP 103. RECAP  Abstract Classes – overview, details in 2 nd year  Implementing the ArrayList: size(), get(), set()
Rob Miles. Creating a Working MoodLight We know that colours in XNA are stored as values which represent the amount of red, blue, green and transparency.
26/10/ Selection Nested If structures & Complex Multiple Conditions.
Variables and Functions. Open your Encoder program Let’s begin by opening the “Labyrinth Auto Straight” code. Save this file as Labyrinth with variables.
11 Adding Tomato Targets Session Session Overview  We now have a game which lets a player bounce a piece of cheese on a bread bat  Now we have.
 A Collection class is a data type that is capable of holding a group of items.  In Java, Collection classes can be implemented as a class, along with.
Making Decisions (True or False) Relational Operators >greater than =greater than or equal to
Topics Sending an Multipart message Storing images Getting confirmation Session tracking using PHP Graphics Input Validators Cookies.
Introduction to Half Life 2 Modding ● Seminar Seven – The story so far: ● Creating a mod via Source SDK ● Introduction to Hammer ● Hammer techniques ●
OOP in Java : © W. Milner 2005 : Slide 1 Java and OOP Part 2 – Classes and objects.
Introduction to Java Java Translation Program Structure
CS 376b Introduction to Computer Vision 01 / 23 / 2008 Instructor: Michael Eckmann.
Copyright © Curt Hill More Components Varying the input of Dev-C++ Windows Programs.
C++ / G4MICE Course Session 2 Basic C++ types. Control and Looping Functions in C Function/method signatures and scope.
INTRODUCTION TO DATABASE USING MICROSOFT ACCESS 2013 Part 5.2 November 16, 2014.
Decision Structures, String Comparison, Nested Structures
15. WRITING LARGE PROGRAMS. Source Files A program may be divided into any number of source files. Source files have the extension.c by convention. Source.
CHAPTER 14 Classes, Objects, and Games XNA Game Studio 4.0.
GROUPING OBJECTS CITS1001. Lecture outline The ArrayList collection Process all items: the for-each loop 2.
Lecture 8: Advanced OOP Part 2. Overview Review of Subtypes Interfaces Packages Sorting.
GameDevClub CODE CHEAT SHEET NOTE: ALL OF THE CODE IS CASE-SENSITIVE AND THE SYNTAX IS STRICT SO A LOT OF YOUR ERRORS WILL PROBABLY COME FROM TYPOS If.
11 Adding a Bread Bat Session Session Overview  We have created a cheese sprite that bounces around the display  We now need to create a bread.
SharePoint document libraries I: Introduction to sharing files Why document libraries? Sharing files with others is essential to getting things done nowadays.
Algebra Expanding Brackets. Algebra So far we have looked at simplifying expressions like 3x + 2y + 2x + 4y collecting the like terms to make 5x + 6y.
Dr. Abdullah Almutairi Spring PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages. PHP is a widely-used,
Python: File Directories What is a directory? A hierarchical file system that contains folders and files. Directory (root folder) Sub-directory (folder.
CMSC 202 Lesson 26 Miscellaneous Topics. Warmup Decide which of the following are legal statements: int a = 7; const int b = 6; int * const p1 = & a;
Classes CS 162 (Summer 2009). Parts of a Class Instance Fields Methods.
Chapter 8: Understanding Collections Textbook: Chapter 4.
Introduction to Decision Structures and Boolean Variables
Unit 9.1 Learning Objectives Data Access in Code
Matlab Training Session 4: Control, Flow and Functions
IF statements.
Chapter 5 Classes.
Namespaces, Scopes, Access privileges
Prof. Neary Adapted from slides by Dr. Katherine Gibson
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.
File Handling Programming Guides.
Data structures in C++.
Packages and Interfaces
Classes.
How to organize and document your classes
COP 3330 Object-oriented Programming in C++
Java Programming Language
Data Structures & Algorithms
Life is Full of Alternatives
Classes, Objects and Methods
CIS125GA Week 4 Logical Beginnings
Solving Linear Equations
COMPUTING.
This presentation document has been prepared by Vault Intelligence Limited (“Vault") and is intended for off line demonstration, presentation and educational.
Presentation transcript:

Introduction to Half Life 2 Modding ● Seminar Eight – The story so far: ● Creating a mod via Source SDK ● Introduction to Hammer ● Hammer techniques ● Importing custom art content ● Starting with code manipulation – This week: ● Adding an item via code

Starting point ● Files available from – Includes example code for adding an item ● Create a new folder in the 'dlls' folder of the source directory – place the cpp file there. – Add the file to the server project – Also includes models, materials and an FGD ● What else could this code be used for? – 'Relic' style pickups? – QuadDamage? ● We'll look at making a QuadDamage pickup

Making a QuadDamage pickup ● The theory: – Once the player touches our pickup we want to set a flag so that any further damage done by that player is multiplied ● We need a way of setting a flag ● We need a way of checking for the flag when damage is caused ● If the flag is set, we need to multiply the damage done

Making a QuadDamage pickup ● The practice – Adding a flag to the player ● Open hl2mp_player.h and put the following below the line that reads “DECLARE_DATADESC” // private class members cannot be accessed from outside the class private: // bool variables are either true or false (boolean values) bool m_bQuad; // public class members can be accessed from anywhere (inside or out of the class) public: // IsQuadded returns a boolean value bool IsQuadded() { return m_bQuad; } // SetQuad takes a boolean but doesn't return anything at all void SetQuad(bool value) { m_bQuad = value; }

Making a QuadDamage pickup ● Multiplying the damage – In hl2mp_player.cpp find OnTakeDamage ● Insert the following before the return statement: // cast from CBaseEntity to CHL2MP_Player CHL2MP_Player *pAttacker = dynamic_cast (inputInfo.GetAttacker()); // check pointer validity if ( pAttacker ) { // copy inputInfo CTakeDamageInfo newInfo = inputInfo; // multiply the damage value by 4. newInfo.SetDamage(newInfo.GetDamage() * 4.0f); // replace the standard return with our new multipled damage version return BaseClass::OnTakeDamage( newInfo ); }

Making a QuadDamage pickup ● Final touches – Ensure the player can't spawn with the quad damage effect ● In CHL2MP_Player::Spawn – Set m_bQuad to false ( SetQuad(false) ) – Activate the effect when we pickup the quad damage item ● Put the following code into our items “MyTouch” function before the return call ● // set the players quad flag to true. pHL2Player->SetQuad(true); – Create a suitable entry in the FGD file (use the flag example as a basis) remember to add the FGD when you open hammer!

Expanding on the pickup ● How you could expand this system: – Setup a timer (look at CHL2MP_Player::PostThink) to control the duration of the quad effect ● gpGlobals->curtime will give you the current time – You could store a time value when the quad is collected (current time + duration) and compare that against the current time in PostThink – Make more pickup items that have different effects ● Increase health, boost speed, reduce damage (this ones easy!) ● Create custom art content for each pickup you make!