Giter Site home page Giter Site logo

sm-tfdamageinfo's Introduction

TF2 DamageInfo Tools

A library that provides a few methods to generate particular forms of damage.

tf_generic_bomb wasn't enough.

Usage

The library exposes a couple of opaque handles with the information necessary to apply radius damage.

/**
 * recreate the Ullapool Caber explosion with custom damage / radius
 * assume all variables are valid
 */
CTakeDamageInfo damageInfo = new CTakeDamageInfo(owner, owner, damage,
		DMG_BLAST | DMG_SLOWBURN, stickbomb, vecShootPos, vecShootPos, vecShootPos,
		TF_CUSTOM_STICKBOMB_EXPLOSION);

CTFRadiusDamageInfo radiusInfo = new CTFRadiusDamageInfo(damageInfo, vecShootPos, radius);

radiusInfo.Apply();

delete radiusInfo;
delete damageInfo;

In the future I'd like to expose more options for both *DamageInfo handle types.

Runtime Dependencies

This project uses the memory allocation functionality provided in Source Scramble; that extension must be installed. This plugin currently targets a minimum version of 0.3.4, though the latest is preferred.

Building

This project can be built in a reproductive manner with Ninja, git, and Python 3.

For this particular project, you will also want the chevron and toml Python packages, as some SourcePawn code is automatically generated to deal with in-memory structs.

  1. Clone the repository and its submodules: git clone --recurse-submodules ...
  2. Execute python3 configure.py --spcomp-dir ${PATH} within the repo, where ${PATH} is the path to the directory containing spcomp. Verified working against 1.9 and 1.10.
  3. Run ninja. Output will be available under build/.

(If you'd like to use a similar build system for your project, the template project is available here.)

sm-tfdamageinfo's People

Contributors

nosoop avatar notnheavy avatar

Stargazers

John avatar Sandust60 avatar Mir avatar Nopied◎ avatar

Watchers

James Cloos avatar  avatar  avatar Mir avatar

sm-tfdamageinfo's Issues

Compatibility issue with latest version of CBaseNPC extension

This issue is happened by they use same name.
https://github.com/TF2-DMB/CBaseNPC/blob/master/scripting/include/cbasenpc/takedamageinfo.inc#L13

methodmap CTakeDamageInfo
{
	/**
	 * Retrieves the CTakeDamageInfo class from the given address ptr.
	 *
	 * @return		The CTakeDamageInfo.
	 */
	public native CTakeDamageInfo(Address ptr);
...
}
methodmap CTakeDamageInfo < Handle {
	public native CTakeDamageInfo(int inflictor, int attacker, float damage, int damagetype,
			int weapon, const float damageForce[3] = NULL_VECTOR,
			const float damagePosition[3] = NULL_VECTOR,
			const float reportedPosition[3] = NULL_VECTOR, int damagecustom = 0);
};

But it's too much for me to solve, so I leave this issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.