[GUIDE] Mann vs Machine Attributes - Full Version

Turbo Lover

Fight me under Glasgow Central Station
aa
Feb 15, 2011
333
344
Yeah.

Attributes:
What are they?

Attributes are what makes the Giant Robots move so slow, they're what makes the Giant Heavy do so much damage and they're what makes the Giant Demoknights gain 100% critical hits for 3 seconds when they kill you. They are what give different weapons their own stats.

They are what the game engine reads to determine how something acts. What they will look like to you when you're using them, is a brief description of the attribute within quotes, e.g. "move speed penalty", "damage bonus", "critboost on kill"

Why use them?

These attributes, are fantastic tools to make your robot waves more unique, more challenging and more fun than your run-of-the-mill robot horde. The sheer number of options they offer you spice up your .pop file in ways just not possible by changing what class of robot spawns with what weapons.

Whether you want a Scout that moves so fast that it can get to the bomb hatch in less than 5 seconds or a Giant Heavy that shoots Sandman baseballs instead of bullets, it can be done with attributes.

How do I use them?

To begin to explain this, let's take a look at THIS.

The above link is a complete list of attributes within TF2 and includes information on what each attribute does, what weapons and classes can use it and examples of how to use it.

To begin we'll give your robot a 50% damage bonus. Look at the list provided and the very first attribute listed should read "damage bonus" this is what we're going to put in the CharacterAttributes section of the robot template or TFBot, like so:
CharacterAttributes
{
"damage bonus"
}

Next, look to the text file and look at Attribute Format, which reads: Percentage. Attributes can have 4 different formats, Percentage, Inverted Percentage, Additive Percentage and Additive. Percentages and Inverted Percentages work as multipliers, multiplying the base stat the attribute modifies. This means to achieve a 50% bonus, we need to multiply the base stat by 1.5, and that is what we will put in our template:
CharacterAttributes
{
"damage bonus" 1.5
}

You've successfully given our robot a 50% damage bonus, but why stop there, let's give him a 50% faster firing rate. Look to the list and find "fire rate bonus" and put it in your .pop like before:
CharacterAttributes
{
"damage bonus" 1.5
"fire rate bonus"
}

Now take a look at what format it uses, Inverted Percentage, so to give ourselves a 50% faster firing rate, we need to multiply the base firing rate by 0.5:
CharacterAttributes
{
"damage bonus" 1.5
"fire rate bonus" 0.5
}

In layman's terms, a Percentage will give you a positive effect if the value is greater than 1, while an Inverted Percentage will give a positive effect for values below 1.

To quickly go over the other two attribute formats, Additive Percentage is a percentage between 0 and 100 and is used to determine the chance of something happening. Additive is a flat value that will do one of two things. It will either turn an attribute on or off, 0 turning it off and any number above 0 turning it on, or specify a value for the attribute to use, e.g.:
CharacterAttributes
{
// Additive Percentage, 75% chance to slow
"slow enemy on hit" 75

// Additive type 1, sets enemies on fire
"Set DamageType Ignite" 1

// Additive type 2, regenerates 10 health per second
"health regen" 10
}

Should you forget any of this, the text file provided contains examples of every attribute in an easy-to-edit manner, which can be copied into your .pop file.

You now have the tools and knowledge to go make some crazy robots, so what're you waiting for, go make some Sandman-ball-shooting Heavies.

Notes

I'd like to give my thanks to Abex for first compiling the list of attributes to be used in his Custom Weapon Tutorial and for giving me permission to modify the list so it would be more useful to make .pop files with.

You can view the list of attributes online via Pastebin here or download the file itself here.
 

henke37

aa
Sep 23, 2011
2,076
513
It's not very additive if it doesn't result in a sum of at least two values. And I still don't like the term "inverted percentage". The labels really need to be redone from scratch.
 
Last edited:

Turbo Lover

Fight me under Glasgow Central Station
aa
Feb 15, 2011
333
344
It's not very additive if it doesn't result in a sum of at least two values. And I still don't like the term "inverted percentage". The labels really need to be redone from scratch.

These labels aren't mine, these are the labels taken from Valve: http://wiki.teamfortress.com/wiki/Attributes

Value Type: How the value of this attribute is formatted for display. Possible types are additive (flat value), percentage, additive percentage (for percentages that start from 0% instead of 100%, like chance to slow target) and inverted percentage (a positive "mult_postfiredelay" will be translated to a negative fire rate percentage)