Team Fortress 2

Team Fortress 2

Not enough ratings
Scripting in Notepad++ and properly balancing your missions (A follow up to "Making your own MVM Missions")
By Conga Lyne
Hello everyone, after receiving some feedback overtime and returning to the Mann vs Machine scene i've decided a follow up guide to "How to make your own MvM missions" was a good idea.

As the name suggests, we'll be going over how to properly script in Notepad++ in the first half of the guide; and properly going over the finer points of balancing in the second half of the guide.
There's some extremely cool attributes and tricks you can do with popfile magic i'd like to go over as well, so stay tuned for that.
Additionally images aren't too applicable for a guide like this and there's some boring things to discuss so be warned.
Without further delays, let's begin
   
Award
Favorite
Favorited
Unfavorite
(Ch1) 1. The Finer points of Notepad++
Before we start using our tools, we should get used to them.
Unlike most people of your species, you should probably learn how to use the tools you'll be using rather than just clanging them about until the work gets done.

So, what's so noteable about notepad++?

Themes
First of all, this may not seem like much to the inexperienced but changing how your scripting tool works can be a big help with various things; primarily being easier on the eyes

First, again, we want to go here:
Top bar > Settings > Style preferences

You can change quite a lot in settings alone, so take your time customizing to your likes; however important option here the theme


On "Select theme", choose anything you like; I personally went with Deep Black since it's practically a default dark theme, but there's anything you can choose from and you can obtain custom Notepad++ themes from the community.

Stay safe and you should be okay.


Shortcuts

With themes out of the way let's go over some basic shortcuts we'll be using quite a lot.
Let's start with the basic ones

Ctrl + C = Copy
Ctrl + V = Paste

Everybody knows these two, they're the two most commonly used hotkeys; right behind Save

Ctrl + S = Save
Spam this.
After everything you make, Ctrl + S.
Make it an unhealthy habit, it helps prevent random program/computer crashes/shutdowns killing both your work and fun.

Ctrl + F = search
Search can be used to search and replace, self-explanatory really.

Learn these as they're essential parts of effectively using the tool of the trade

Tab
You can press Tab to make a tab; helpful when lining everything up
Technically it can be used as a space

And that's it, nothing else really to note here; just get used to them!
Moving on
(Ch1) 2. Basic, firmer understanding
Popfiles make a lot more sense once you actually understand what everything means and you aren't just copying, pasting and editing what you understand

To illustrate this, here's an explanation to things you may wish to know
Note: due to the character limit, the script will be posted as a google drive download; I am aware websites like pastebin and hastebin exist however they don't fulfil my needs for a guide.

https://drive.google.com/open?id=1u-qybaAaOm_myAq1GwJvjoEH25BvotEN


There's a lot of hidden things in Mann vs Machine popfiles, but the important hidden thing is you have a basic understanding of triggering map brushes and entities and making sounds.

Sounds don't require a pre-placed entity and triggering a map entity/brush is the exact same as if it were an output; have fun.

I'll redirect you to sigsegv and his github links for further information on the hidden gems, go searching and learn it yourself.
https://gist.github.com/sigsegv-mvm/be4697e3d352fbe5afcc08067beb27a9



"But, wait, what does any of this mean? I could do these things all along?
Well, assuming you have some popfiles of reference or old.mvm.tf i'm sure you could figure it out swiftly but yes.
Popfiles could, in theory, be used entirely just to trigger map relays and such with dummy bot spawns.



Wait we're getting way ahead of ourselves, shouldn't I learn the basics first?
Ok, well, fair enough.

If you have some familiarity with scripting or even coding then all of this should speak for itself, however if this is your first time I could understand how it may be scary or confusing.
You have everything you need as far as descriptions go with the example pop file from earlier so let's grab a popfile I assume you have ready and open, then see what we can do.

Let's start with a few basic exercises, make a new WaveSpawn by copying and pasting a pre-existing/old one.

It's just a simple copypaste; make sure you have an even number of brackets, as each { should have a matching }.
To check this really quickly, go to the very bottom of your popfile and make sure the bottom most bracket connects with the top most one; if it does then good job, everything should be okay (or you left some weird brackets in the middle of a subwave/bot somewhere)
If they don't match up then you have a bracket problem somewhere.

It's the easiest problem to solve and easiest to find the problem with, just go to what you last worked on.

But now that we have our new Subwave, let's change things up a little bit, I suggest we start by making it a support wave

To do so, put
Support 1
before "Squad", make sure it's above it; like so:

Side note: technically you don't require a squad if it's just a single robot, but it's cleaner with it.
Double side note: Support 1 means the support will be unlimited, Support Limited means the support will be limited; also WaitForAllDead is rather misfunctional with support usually even when set to limited. The currency dropped will act as normal, depending on the number of TotalCount


Now, try messing around with the bot a bit, add attributes, maybe make more or less robots spawns or add a cool sound.

Pro tips to remember:
  • Remember to do your brackets properly
  • Sound appropriately, usually sounds have a much greater affect the less they're used
  • If you ever want to find a certain attribute from a weapon, try looking inside of your items.txt folder inside of tf/scripts/items/items_game.txt
  • Primarily, remember to get your brackets right when copy pasting; common script error
  • Learn from examples, I said this in my previous guide but if you ever see something cool you like from a popfile, try to get it and see what's inside
  • Be creative! really, try to make those insane robots you thought might never work, you can get a Thermal Thruster pyro to work with enough effort; maybe even make a custom map and do some cool relay stuff once you understand it, try your best!
(Ch1) 3. Testing and cleaning up lost parts
Now that you've made at least one new subwave, you should be able to practice this infinitely and even make whole new waves with the power of copy pasting; just remember to test frequently if applicable.

Some extremely helpful commands for doing so are here:
1. sv_cheats 1 -
This should be familiar with a lot of people, enables a lot of extra commands

2. noclip -
Easily get to the front line when needed and peek inside robot spawn, another well-known but good tool

3. currency_give -
Gives you some more money to spend, just you, nobody else.
Insert a number afterwards, as expected, and you'll obtain your desired money.
Max is 30000

4. tf_mvm_popfile -
Allows you to load a popfile through the console, the entire file name should be stated after tf_mvm_popfile; for example: "tf_mvm_popfile mvm_coaltown_robotic_buzztown" (Side note: default missions/"normal" missions are just the same as the map name, so "tf_mvm_popfile mvm_coaltown" for example)

5. tf_mvm_jump_to_wave -
Lets you jump to a certain wave, not really helpful on endurance missions but useful on all other missions, just insert a number after that and you'll jump to that wave. (Note: you won't gain money from doing so, so use currency_give to fix that) (Double note: for endurance missions, create a copy of the entire popfile and rename the new file anything else, then cut out everything you want to skip so you can get right to what you want to test.)

6. map -
type in a map's entire name afterwards to go to it, for example: "map mvm_bigrock", "map pl_upward" or even "map mvmcpctfplplrvsharenakoth_ok" (assuming that last one was a real map)

7. sv_vote_creation_timer 0;sv_vote_issue_changelevel_allowed_mvm 1 -
This is two commands at once, but put both of them in to your console so you can have no cooldown on vote times and you can vote to change maps in mvm. Is good (Just note that changing maps in mvm is a little bit buggy, so it might be better to just make a new server; your commands will still carry over until the game is closed)

Thankyou to ♓A Slightly Horny Seelpit♓ for reminding me of the following 8-11

8. bot_kill all -
Kills every bot on the map, even ones in spawn or hard to reach areas.

9. nb_player_move 0/1 -
Allows bots to move. 0 makes them stand still (they still attack!)

10. nb_stop 0/1 -
Completely stops bots from doing anything (except spawning).

11. ent_fire -
Check out what's suggested after a space to see relays. It doesn't show all of them; adding the first letter of a relay will make it show up. Useful to find spawn locations or tank paths.
Adding another space after you filled in an entity name allows you to make it act; for instance, make a door close or open by making the entity "trigger".
This is very similar to the ent_fire used in popfiles, with the addition that you can give this one variables compared to it's popfile counter part.

11. developer 1 -
Allows you to properly make use of:
"ent_messages <entity name>" - If you fill in a proper entity name you found via "ent_fire", it'll show you where it's located.
If you use "info_player_teamspawn" as string for it, it'll show all the names of the spawn locations!


The tf2 wiki has quite a lot of these, just go to the following pages sometime if you need a bit of advice:
List of useful console commands
and
Cheats

You already know how to test a mission if you looked at my previous guide or have more than 200 hours on tf2.


Now, some of you may still be confused and all I can say to that is; practice makes pefect; or at the very least good enough.

Really, there's so much to learn and i've shown you everything you need to master it all; i've instructed you on how popfiles work, i've told you how subwaves, waves and bots work, i've told you what little things you can do you probably won't know and all you have to do now is plan out your own adventure.

Your best resource will be google, before you ask anything; try googling it first or whatever search engine you prefer.

If you're struggling to understand anything, please, please give the guide a read through a few times and then ask away.
You won't learn anything if I or someone you know does all the work for you.
Now go out there, learn everything and show what amazing missions you could make!
(Ch1) Vocabulary
This is vocabulary for defining some terms used throughout the guide just in the case you're confused at any point; primarily since I sometimes use different words for the same term.

Subwave/Sub-wave/WaveSpawn: All of the same things and controls entire waves of robots

Population/WaveSchedule: Same thing, it's what tells the file to get ready for entity spawning

Robot/Bot/TFbot: A bot. except it's tailor made for Mann vs Machine

(Ch1) BONUS: Neat attributes and bots
Here i'll make a list of nice attributes you can use and some bots to demonstrate things too


"cannot pick up intelligence" = Speaks for itself, set to 1 to enable, 0 to disable; disabling is good for rocket/sticky jumpers


"generate rage on heal" = Medic shield, set to 1 for a small shield and very slow charge; 2 for a big shield and very slow charge; 20 for a big shield and constant, 24/7 uptime; requires the below Attribute to work:
Attributes ProjectileShield

"override projectile type" = 1 for bullets, 2 for rockets, 6 for flares; old.mvm.tf will be helpful in finding exactly what you want for everything else


"item_meter_charge_rate" 1
"thermal_thruster_air_launch" 1
"falling_impact_radius_stun" 1
= Is everything related to the thermal thruster, the first one affects charge rate; 2nd lets the robot use it properly, jumping mid-air and the last one stuns on hit with the thermal thruster.

holiday_restriction 0 = Putting this on any zombie-soul or halloween restricted cosmetic will make it appear all year round

use large smoke explosion 1 = This makes any explosion from grenades, sticky bombs, rockets or alike turn in to a sentrybuster explosion; use with caution as it can cause plenty of lag when spammed!

mod stun waist high airborne = If this weapon/robot hits someone who is above their waist/head, they will be stunned; the number afterwards is the duration; though they do have projectile shield so whatever.

damage penalty -2 = Fun Fact: putting ""Damage Penalty" -2" or lower on a melee weapon will cause it to heal on hit instead of damage; this may be fixed if you're reading this years in to the future

applies snare effect = Put this on to jarate or madmilk to snare enemies on hit, it works like movement speed

head scale = 0.01 means no head, 2 means a big head; speaks for itself.

damage all connected = Third degree's direct upgrade attribute, be careful with how often you use this as it's a direct nerf to medic; though they do also have a shield so whatever.
Just be careful on class-specific nerfs

torso scale = Torso scale, speaks for itself much like head scale

hand scale = Again, hand scale, speaks for itself much like torso scale

lose hype on take damage 0 = insert onto a baby faces blaster to remove their speed fragility
(Ch2) 1. Learning to balance
Alright, now that all the loose ties are tied up and no more with chapter one, we get to move to Chapter 2; balancing.

Where could I even begin?
First, making sure the mission is fun; gets priority above all else.

You can have your highs and your lows but as long as the mission is fun in the end that's all the matters.

Missions which are too easy are boring and missions which are hard are generally fine, but there's a fine line between hard and tedious.
Tedious missions usually means one boring subwave going on for eternity or having an army technically easy to kill enemies but it takes something like stalling them for an eternity, they won't actually kill you, they just need to be stalled for a while.



"Well, how do I know if my mission is fun?"
Well, do you like it?
Yes? Then you're probably on the right path!

Keep trying by looking how the robots preform yourself and if you can get some people together to test it then even better!
Remember, quality always beats quantity.
Unless, you're 30 wave I guess.


A place where a lot of people fall short early on is money, just remember, you could get a massive dps boost with $1000 by going for full reload; or a moderate boost with just around $300.

The amount of money you give you players depends on what you intend to send them in the next wave; keep that on mind since that's on you.


Additionally; Don'f make a boring mission, something which drags on forever; try to make waves all end spawning at around the same time and if a non-endurance/wave 666 wave takes longer than 4-5 minutes to beat then it's generally too long.

Short and sweet is a good way to think but long is okay too
(Ch2) 2. Learning to balance to counter cheese
Okay

Imagine this:

You make this super cool burst-fire soldier boss which does some wizard missiles and shield medics support him.
But
The medic just pops shield and his rockets do nothing; then the local gas passer pyro and EH sniper kills the medics before they can shield


Sucks, huh?
Well, if we threw some pyros in, they could flame through the medic shield.
And maybe if we had some counter snipers the Sniper and Pyro would need to be kept on their toes a bit more.

Now we have a bit more interesting of a fight than Medic shield and Sniper spam



Here's another scenario:
Imagine this:

It's wave 1, the team doesn't have enough money for full crit resist; but the only crit robots are at the very end of the subwave.
They could probably buy anti-crit by then

But what just a few crit robots were at the start, encouraging things like vaccinator or battalions backup for the crit resistance.
This probably shouldn't be done all the time but it helps make the players think about their obstacles and consider how to overcome their obstacle more properly; rather than just, doing the same old strat over and over again.




Essentially the part of this guide is to encourage you to think about the alternate non-meta weapons and upgrades players have, the gas-passer explosion always does 350 damage, medic-shield exists and the short-circuit may encourage something which isn't the wrangler.

Consider how your mission could be cheesed with a certain weapon or weapons, then think around that and how to make your players either work harder or work easier~

Maybe you just want to make your own mission and that's okay, but always consider the basics.
Master the basics and they will guide you to the finish line.
Finale
This guide hasn't been as in-depth as my previous guide, "How to make your own MvM missions", but that's because it doesn't need to be.
Since it's a followup to that guide you already have a lot of information from that one and this guide is just to introduce you to Notepad++ scripting and give you a greater insight in to balancing.

I'll still gladly answer any further questions you may have and if you have anything you feel is missing from the guide, leave a comment and i'll give credit if due.

This isn't the type of guide which is applicable for many images either but I tried my best to insert them where I could.

I trust you all to take responsibility and make some great missions, now have fun and bon voyage!

(if you want a small challenge, try using the information you learnt in A firmer understanding to make a tank which doesn't explode the hatch when they deploy the bomb)
10 Comments
Conga Lyne  [author] 24 Mar, 2021 @ 9:32pm 
They should be packed in the tf2_misc_dir.vpk file, located in the tf folder

There's a software GCFScape you'll have to download to open it
76561198827307820 24 Mar, 2021 @ 8:33am 
ye
Conga Lyne  [author] 24 Mar, 2021 @ 7:40am 
You're meant to put the missions you've already made in there

Do you mean the vanilla tf2 mvm missions?
76561198827307820 24 Mar, 2021 @ 5:35am 
i only see items and protodefs
Conga Lyne  [author] 23 Mar, 2021 @ 9:57pm 
Do you mean where you find the script file itself?
They should be stored in \common\Team Fortress 2\tf\scripts


If you mean the original guide for getting started though then: https://steamproxy.net/sharedfiles/filedetails/?id=376575386
76561198827307820 23 Mar, 2021 @ 11:24am 
sorry if this is a dumb question but where do i find the script for mvm?
Conga Lyne  [author] 10 Aug, 2019 @ 10:00pm 
Thanks, i'm not too sure why I didn't add them in initially but they're in the guide now along with the other commands
♓Seelpit♓ 10 Aug, 2019 @ 5:01pm 
Some extra commands that may be of use if you're exploring what a map can do, or testing a mission:

"bot_kill all" - Kills all the bots, even ones in spawn.
"nb_player_move 0/1" - Allows bots to move. 0 makes them stand still (they still attack!)
"nb_stop 0/1" - Completely stops bots from doing anything (except spawning).

"ent_fire" - Check out what's suggested after a space to see relays. It doesn't show all of them; adding the first letter of a relay will make it show up. Useful to find spawn locations or tank paths.
Adding another space after you filled in an entity name allows you to make it act; for instance, make a door close or open by making the entity "trigger".

"developer 1" - Allows you to properly make use of:
"ent_messages <entity name>" - If you fill in a proper entity name you found via "ent_fire", it'll show you where it's located.
If you use "info_player_teamspawn" as string for it, it'll show all the names of the spawn locations!
red⋆mits 6 Apr, 2019 @ 11:35am 
First class guide, thank you.
MrHumbleTom 6 Apr, 2019 @ 3:36am 
You're pretty good!*meeeeow*