Driveable Tanks!

Driveable Tanks! 0.7

The_Evil_Pickle

L2: Junior Member
Mar 19, 2015
60
83
Driveable Tanks! - Hammer prefab(s) and sourcemod plugin for tanks that players can drive around.

This is my attempt at making the tanks from Frontline able to be driven by players. It has two parts: a basic entity setup in the map that determines how players get into tanks, and a sourcemod plugin that makes the tanks work properly.

The final goal for this is to make some prefabs people can use in their maps, with the server mod only affecting maps that were built for it. Right now I've only just got some of the basic functions of the tanks working, but ultimately I'm planning to have the tanks operate differently depending on which class is in them, and possibly create a few new game-modes centered around controlling vehicles.

The .bsp for the example map and the .smx for the plugin are both in the zip folder, along with the decompiled versions for anyone who wants to take a look at how everything works.

Both the mod and the map are needed for this to work; the map will be glitchy if the soucemod plugin isn't running, and the sourcemod plugin only activates if the map tells it to (or if anyone gets in a bumper car. I'm planning on fixing that compatibility issue in a future version).
 

The_Evil_Pickle

L2: Junior Member
Mar 19, 2015
60
83
Is there any way to make the tank move more like a tank? So a bit slow and lumbering.
Yup! ...hopefully. I'm planning to make them pretty slow, but I still need to expirement a bit with how to do that :p

Does it uses physics and stuff? impressive though
Right now it's just using the same controls and physics bumper-cars use. I might have to do some more in-depth physics stuff to get the hitboxes and desired speed working, though.
 

Crowbar

Spiritual preprocessor
aa
Dec 19, 2015
1,455
1,297
I suggest W and S buttons moving the tank forward and back, and A and S simply rotating it over its axis. Would look exactly like a tank moving. Though it might be hard to make.
 

The_Evil_Pickle

L2: Junior Member
Mar 19, 2015
60
83
I suggest W and S buttons moving the tank forward and back, and A and S simply rotating it over its axis. Would look exactly like a tank moving. Though it might be hard to make.
It actually does work like that, thanks to the bumper car mechanics. The main issue control-wise is that it currently has the movements speed of a bumper car as well, and those things go pretty fast.
 

The_Evil_Pickle

L2: Junior Member
Mar 19, 2015
60
83
Something you might be interested in for this - particularly if you hope to drop the Smod aspect - is the Drivable Cars A Boojum Snark made here.
Hey, that's really cool! Thanks for giving me the heads-up. It works on completely different principles, so I wouldn't be able to really convert my version to a non-Smod version any time soon, but there's some useful stuff here none the less. I didn't even know logic_measure_movement was a thing, it has a lot of potential. I'll probably do some non-Smod Frontline vehicle stuff with it once the jam is over, we'll see.

Edity edit: After looking it over a bit more, it seems likely that I could recreate most of the mechanics from my mod in hammer using a few entities and tricks borrowed from ABS. There's still some stuff I don't think I can do, or can't do as reliably, but I'll probably make a simplified version of this project once the event ends that doesn't use any mods.
 
Last edited:

The_Evil_Pickle

L2: Junior Member
Mar 19, 2015
60
83
New Version! Here's the deets:
Tanks now have a limit to how fast they can move. Turning currently has no limit.

Class tank changes:
*Soldier's rocket tank now works as intended.
*Pyro also now fires a projectile from his tank. It exlodes and lights people on fire.
*Sniper's tank can shoot lasers (placeholder for bullets). This attack does more damage at long range, but the sniper-tank can also use alt-fire to drop Jarate on enemies that get too close.
*Scout's tank moves faster than the others, and Heavy's tank moves slower than the others. Spy and Pyro move slightly faster than average.
*Demoman and Scout both have a charge attack on alt-fire, which can bypass speed restrictions. Scout can cause the tank to jump by hitting the jump key.

Known issues with this version:
*Tank models sometimes spawn sideways.
*Getting in a tank while the server is waiting for players screws everything up.
*While in a tank, moving backwards doesn't work quite right. Even using the back key to slow down has a very delayed response.

Read the rest of this update entry...
 

The_Evil_Pickle

L2: Junior Member
Mar 19, 2015
60
83
Another new version:

*Fixed hundreds of random numbers being spammed in server console.
*Slightly improved issues with reversing in a tank.
*Balanced Sniper's tank's damage a bit.
*Gave Heavy's tank a minigun-style weapon (still uses placeholder lasers).
*Scout's tank now features a flak cannon (it just shoots a burst of like 30 syringes). Very low accuracy at even medium ranges, but combined with the scout-tank's speed and dash ability, it can be very deadly.
*Demoman's tank now does 2.5x more damage than normal when you dash into someone with it. This means you can kill most classes instantly by charging into them with the tank.
*Demoman's tank is now slightly slower than average when not dashing.
----------------------------
So now everyone has a fully-equipped tank except for Engy, Medic, and Spy. I've got plans for Engy and Medic, but I've still not quite decided what Spy's tank will do. If anyone has suggestions, let me know!

Read the rest of this update entry...
 

The_Evil_Pickle

L2: Junior Member
Mar 19, 2015
60
83
Two new class tanks complete!

Engineer Tank: It has a sentry gun on it. Just drive the sentry gun into enemies and watch the carnage.

Medic Tank: Has a tiny, crappy syringe cannon. But, the tank also heals nearby allies + gives them ammo, and it repairs itself over time!

Bug fix: tanks controlled by red players are now red, not green.

So now spy's the only one I don't have anything for. After I've got something for him, I'll finish up balancing/polishing all the tanks into something more presentable. There're probably some bugs that need ironing out as well, though it's just visual stuff. That might not all happen before the jam is up, but I'm hoping to at least get all 9 classes their own tank before the clock hits 0.

Read the rest of this update entry...
 

The_Evil_Pickle

L2: Junior Member
Mar 19, 2015
60
83
Spy now has a brand-new tank! It doesn't fire anything, but it has the plague ability from Mannpower mode when the player is above 200 HP.
The other feature of the spy tank is that it can turn invisible! It's bound to the player's normal cloak/decloak button, and uses their normal cloak meter. Note that this is not complete invisibility, as the particle effects from the plague ability will still show up. Still, it's useful when trying to get near enough to enemies that you can infect them!

Additionally, Demoman's tank now has 45% damage resistance against ranged attacks, and Heavy's tank now has 45% damage resistance when above 2000 HP.



Spy tank bugs:
There's currently a bug where insta-death will cause the powerup to drop, so fixing that's first on my to-do list.
Cloaking with the spy tank screws up the color of the model, making it really dark.

Read the rest of this update entry...
 

The_Evil_Pickle

L2: Junior Member
Mar 19, 2015
60
83
Mostly just updating to fix the whole metadata issue, but I did manage to fix a few spy-based bugs.

*The spy-tank no longer drops a Mannpower power-up if killed too fast. Unfortunately, this fix breaks the mod's compatibility with Mannpower mode in general, but who the heck was planning to make a Mannpower map with tanks in the first place? It would be silly. Mannpower maps will still run fine on a server using the mod, as long as those maps don't have bumper cars in them.

*Fixed the spy-tank's colors getting messed up when it turns invisible.

Read the rest of this update entry...
 

ravensbro

L1: Registered
Mar 21, 2011
1
0
plugin don't seem to be working now.i get these errors

L 07/12/2021 - 11:36:24: [SM] Exception reported: Client index 51 is invalid
L 07/12/2021 - 11:36:24: [SM] Blaming: frontlinemod.smx
L 07/12/2021 - 11:36:24: [SM] Call stack trace:
L 07/12/2021 - 11:36:24: [SM] [0] IsClientInGame
L 07/12/2021 - 11:36:24: [SM] [1] Line 73, C:\Users\server\Desktop\source mod and meta mod\sourcemod-1.9.0-git6256-windows-TF2-Jailbreak-Redux\addons\sourcemod\scripting\include\tobias_stocks.inc::GetClientSlot
L 07/12/2021 - 11:36:24: [SM] [2] Line 271, C:\Users\server\Desktop\source mod and meta mod\sourcemod-1.9.0-git6256-windows-TF2-Jailbreak-Redux\addons\sourcemod\scripting\frontlinemod.sp::OnProjectileSpawned
L 07/12/2021 - 11:36:27: [SM] Exception reported: Client index 51 is invalid
L 07/12/2021 - 11:36:27: [SM] Blaming: frontlinemod.smx
L 07/12/2021 - 11:36:27: [SM] Call stack trace:
L 07/12/2021 - 11:36:27: [SM] [0] IsClientInGame
L 07/12/2021 - 11:36:27: [SM] [1] Line 73, C:\Users\server\Desktop\source mod and meta mod\sourcemod-1.9.0-git6256-windows-TF2-Jailbreak-Redux\addons\sourcemod\scripting\include\tobias_stocks.inc::GetClientSlot
L 07/12/2021 - 11:36:27: [SM] [2] Line 271, C:\Users\server\Desktop\source mod and meta mod\sourcemod-1.9.0-git6256-windows-TF2-Jailbreak-Redux\addons\sourcemod\scripting\frontlinemod.sp::OnProjectileSpawned
L 07/12/2021 - 11:36:28: [SM] Exception reported: Entity -1 (-1) is invalid
L 07/12/2021 - 11:36:28: [SM] Blaming: frontlinemod.smx
L 07/12/2021 - 11:36:28: [SM] Call stack trace:
L 07/12/2021 - 11:36:28: [SM] [0] GetEntPropString
L 07/12/2021 - 11:36:28: [SM] [1] Line 758, C:\Users\server\Desktop\source mod and meta mod\sourcemod-1.9.0-git6256-windows-TF2-Jailbreak-Redux\addons\sourcemod\scripting\include\entity.inc::GetEntityClassname
L 07/12/2021 - 11:36:28: [SM] [2] Line 437, C:\Users\server\Desktop\source mod and meta mod\sourcemod-1.9.0-git6256-windows-TF2-Jailbreak-Redux\addons\sourcemod\scripting\frontlinemod.sp::OnTakeDamage
L 07/12/2021 - 11:37:19: [SM] Exception reported: Entity -1 (-1) is invalid
L 07/12/2021 - 11:37:19: [SM] Blaming: frontlinemod.smx
L 07/12/2021 - 11:37:19: [SM] Call stack trace:
L 07/12/2021 - 11:37:19: [SM] [0] GetEntPropString
L 07/12/2021 - 11:37:19: [SM] [1] Line 758, C:\Users\server\Desktop\source mod and meta mod\sourcemod-1.9.0-git6256-windows-TF2-Jailbreak-Redux\addons\sourcemod\scripting\include\entity.inc::GetEntityClassname
L 07/12/2021 - 11:37:19: [SM] [2] Line 437, C:\Users\server\Desktop\source mod and meta mod\sourcemod-1.9.0-git6256-windows-TF2-Jailbreak-Redux\addons\sourcemod\scripting\frontlinemod.sp::OnTakeDamage