Skip to content
 
 

Latest commit

 

History

31 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Usage

Include the tankextensions_main script file and the tank script files of your choosing. This is done through a RunScriptCode output on bignet or added to your own mission script file if you have one.

// For including the main script and two tank scripts.
InitWaveOutput
{
	Target bignet
	Action RunScriptCode
	Param
	"IncludeScript(`tankextensions_main`, getroottable())
	IncludeScript(`tankextensions/paratank`, getroottable())
	IncludeScript(`tankextensions/tankdozer`, getroottable())"
}

Then set the Name keyvalue of any tank in the popfile to one of the possible tank names from the included scripts.
More basic usage can be found in the example popfile. Tank names and script functions are listed further down this readme.
If you want to make a new tank type, refer to the example tank script.

Path Maker

Path Maker allows for quickly creating paths without the need for going around the map using getpos or opening the hammer editor.
After loading tankextensions_main use this command: ent_fire !activator runscriptcode "TankExt.PathMaker(self)"
Replace ent_fire with sm_ent_fire if on a testing.potato.tf server.

Axis nodes are your placed path nodes, a yellow outlined node is the last placed node and can be deleted with the secondary fire.
Blue guides are path nodes that already exist in the map, their targetname will be shown above them and point towards their next path node.
The purple guide is the best position for your last path node for a tank deploying a bomb.
Once finished, you can print all your path nodes in the format of TankExt, PopExt+, or Rafmod to console.
Note that using TankExtensions's CreatePaths function will merge the last node to a node in the map if they share the same position.

Tank Combiner

Any tank made via TankExtensions can be combined into one; providing all the functionality of the chosen tanks at once.
Usage is by adding multiple tank names separated by ^ into the tank's Name keyvalue. (i.e. Name "painttank|255 127 0^stickytank^paratank^fireringtank")
Also note that custom keyvalues defined in NewTankType, besides OnSpawn and OnDeath, will only apply once when iterating through the tanks. For example, "redtank^painttank|255 0 0" will apply the Red Tank model but not the Paint Tank model, vice versa if the names are swapped around.

Tank Types

This list provides details on what can go into a tank's Name keyvalue.
Suffixes is text that can be appended to the tank's name for different effects. tankName + _suffix1 + _suffix2 == tankName_suffix1_suffix2
Parameters are separated by | and can modify certain aspects of the tank type. tankName with 2 parameters is tankName|parameter1|parameter2
Quick Keyvalues allow for making slight modifications to the tank, the same keyvalues as the NewTankType function. The beginning of the keyvalues is denoted with $, the values of the keys separated with |, and the keyvalues themselves separated with ^. tankName$color|0 0 0^teamnum|2^scale|0.5 would result in a black tank on red team at half scale.
Here is a tank name with everything combined, including when using Tank Combiner, Name "paratank^combattank_nolaser|minigun|rocketpod$teamnum|2^noscreenshake|1" (The tank's final targetname will be paratank^combattank_nolaser|minigun|rocketpod)
ScriptFunctions can be ran by firing a CallScriptFunction input on the tank with the param being the script function name.

Script File Preview Tank Names Suffixes # of Parameters ScriptFunctions Description
bannertank.nut bannertank _backup
_buff
_conch
_noselfeffect
0 AddBannerBackup
AddBannerBuff
AddBannerConch
RemoveBannerBackup
RemoveBannerBuff
RemoveBannerConch
Applies the selected banner effects to all teammates within a 540hu radius. The tank can apply the same buffs to itself, toggleable through the _noselfeffect suffix.
blimp.nut blimp 0 Same as a normal tank but it traverses the sky.

Blimp model by Glitch

chewchewtank.nut chewchewtank 0 Li'l Chew Chew from pl_frontier but in tank form. Each bite deals 1000 damage and does not effect giants.
combattank.nut combattank _nolaser 2 ToggleUber Weaponized tank. The tank will need to be prevented from reaching the last path node because it does not have a deploy sequence. Create a looping path or set the tank speed to 0 when it gets close to the last path to prevent this from occurring. This comes with its own script files for each weapon within tankextensions/combattank_weapons/. Load those scripts like you would with tanks; the weapon names go into either of the tank's parameters.
Script File Weapon Names
fireball.nut fireball
minigun.nut minigun
railgun.nut railgun
rocketpod.nut rocketpod
rocketpod_homing
ToggleUber makes the tank invulnerable until ToggleUber is used again. The _nolaser suffix prevents the laser beam from appearing when detecting an enemy.

Tank and weapon models by Charlie

drilltank.nut drilltank 0 Adds a big drill at the front of the tank. Deals 50 damage to the victim every 0.33 seconds (150 dps) that applies bleed and 75% movement stun for 1 second. Deals no damage while in the bomb deploy sequence.

Drill model by KrazyZark

exampletank.nut exampletank 0 Used to show the basics in making a tank type
fireringtank.nut fireringtank 0 Every 0.5 seconds will activate a trigger around the base of the tank that ignites enemies.

Concept by Bazooks

frontlinecart.nut frontlinecart _crit 2 Small mobile turret that shoots a chosen projectile at 5 angles. Allows 2 parameters of: rocket, grenade, jarate, milk, gas. First parameter is the normal projectile type and the second parameter is the close range projectile type. The second parameter can be left blank to not switch to close ranged projectiles. The _crit suffix makes all projectiles crit.

Cart model from the Frontline Supply Drop

hammertank.nut hammertank 0 Adds a giant Necro Smasher onto the tank. Activates when an enemy is within a 256hu radius from its smashing position. Deals 2500 damage to enemies within a 128hu radius or pushes enemies away within a 384hu radius upon smashing. Has a 2.6 second cooldown after smashing.

Concept from Sntr's Lost Valley

jumptank.nut jumptank 0 Jump Causes the tank to jump high in the air periodically. When the tank is falling it will crush enemies beneath it, instantly killing them. When landing it will push enemies away. Set JUMPTANK_JUMP_COOLDOWN to a value below 0 to disable automatic jumping for all jumptanks.
painttank.nut painttank 1 A tank model that allows for more colors much like adding paints for hats. First parameter is the color. (i.e. "painttank|255 127 0" results in an orange tank)

Tank model by CTriggerHurt

paratank.nut paratank 0 Adds a parachute to the tank. If there's no floor underneath the tank then it will move towards path nodes similarly to a blimp until there's ground again. This will usually require a custom tank path so the tank's descent doesn't look unnatural.

Parachute model from PenolAkushari's Silent Sky

redtank.nut redtank 0 Changes the tanks team to red and swaps the tank model with a red textured version. Useful when combined with other tank types that don't have custom models.
scaletank.nut scaletank 1 Tank will resize itself as its health gets lower. First parameter is the resulting scale when at low health.
sentrytank.nut sentrytank 0 Adds 2 invincible level 3 sentries ontop of the tank. The sentries cannot attack enemies that are directly beside the tank. Sappers destroy themselves after 8 seconds if placed on either of the sentries, Red-Tape Recorder does not degrade their levels.
speedtank.nut speedtank 1 Tank will alter its speed as its health gets lower. First parameter is the resulting speed when at low health.
stickytank.nut stickytank 0 Fires a barrage of non-crit and crit stickies in front of the tank. Stickies detonate 7 seconds after the tank began firing.

Concept by Hell-met
Tank turret model from the Frontline Supply Drop

tankdozer.nut tankdozer _nosentry 0 An "armored" tank with 4 breakable sides and a big level 2 sentry ontop. The breakables have 2000 health each and the sentry has 9000 health. Players can get stuck inside of the tanks armor then crushed if they get too close. Sappers destroy themselves after 10 seconds when placed but deal extra damage to the sentry (500 health across 10 seconds.)

Concept by Sntr's Rust Valley

targetank.nut targetank
targetank_color
0 Charges similarly to demo's shields. The tank slows down to 15hu/s on the first 2 seconds then speeds up to 300hu/s for 3 seconds. Has a recharge duration of 10 seconds. Hitting an enemy deals 75 damage and high knockback. targetank_color sets the model to the PaintTank, the color reflects the tank's current charge meter (oranger when about to start a charge and redder after completing the charge.)

Concept by PDA Expert

teletank.nut teletank 0 Places a fake teleporter ontop of the tank that teleports spawned bots that have the bot_teletank tag. Teleported bots will spawn with 5 seconds of ubercharge.

Concept by dexc34

ubertank.nut ubertank 2 ToggleUber Has the ability to become invulnerable for a defined amount of time. First parameter is the amount of time after spawning until the tank becomes ubered and the second parameter is the duration of the uber. Setting either parameter to -1 will disable that parameter's functionality. ToggleUber flips the uber state, if a duration is set then it will automatically toggle back off after the given time.

Tank model by Bazooks

vactank.nut vactank _bullet
_blast
_fire
0 Adds any combination of the Vaccinator's uber effects to the tank. Adding a suffix will resist the chosen damage type.

Vaccinator bubble model by Tumby and Izotope

Functions

Always prepend TankExt. to any of these functions when using them. (i.e NewTankType() becomes TankExt.NewTankType())

Function Signature Description
AddTankIcon void AddTankIcon(integer tankCount, string tankIcon, string tankName, integer index = null) Adds a custom tank icon to the wavebar. The tank name parameter accepts wildcards.
AddThinkToEnt void AddThinkToEnt(handle entity, string FuncName) Wrapper for AddThinkToEnt. If the entity is a tank then it will add the think function to its think table. If PopExt+ is loaded then it will use the renamed native function.
ApplyTankTableByName void ApplyTankTableByName(handle tank, handle path, string tankType) Looks for a tank type that matches the inputted tank's name then applies what is given by the table.
ApplyTankType void ApplyTankType(handle tank) Called by any path_track entity. First checks for any quick keyvalues, then runs ApplyTankTableByName.
ApproachAngle float ApproachAngle(float target, float input, float speed) Rotates the inputted value by the speed value towards the target value. The returned angle value is normalized.

From the TF2 VScript Examples page

Clamp float Clamp(float input, float low, float high) If the input is below the low value, returns the low value. If above the high value, returns the high value.
CreateLoopPaths void CreateLoopPaths(handle table) Similar to CreatePaths except it can make paths loop forever. The last node of each path must use the same position as a previously defined node.
CreatePaths void CreatePaths(handle table) Can create multiple paths.
DelayFunction void DelayFunction(handle entity, handle scope, float delay, handle function) Delays a function and calls it after the specified time. If an entity is defined then it will use its ScriptScope and can only call when the entity exists. The used scope can be overriden by the second parameter. The first two parameters can be left null if neither are needed.
DispatchParticleEffectOn void DispatchParticleEffectOn(handle entity, string name, string attachment = null) Spawns a particle and attaches it to the entity. Can be placed on a model's attachment if defined.
ExtraTankKeyValues void ExtraTankKeyValues(handle tank, handle path, handle table) Used by ApplyTankType and ApplyTankTableByName to implement the keyvalue functions listed in NewTankType.
GetMultiScopeTable handle GetMultiScopeTable(handle scope, string tankType) Returns the scope of a tank type within its MultiScope table. Returns null instead if MultiScope doesn't exist or if the name isn't in the MultiScope
HasTankPathOutput bool HasTankPathOutput(handle path) Returns true if the entity has TankExtensions's required path output. This is used automatically and won't need to be used manually.
IntersectionBoxBox bool IntersectionBoxBox(Vector origin1, Vector mins1, Vector maxs1, Vector origin2, Vector mins2, Vector maxs2) Returns true if the first bounding box intersects with the second bounding box.
IterateIcons void IterateIcons(handle callback) Allows for easier reading and writing of the wavebar icon netprops. The inputted function needs 4 parameters (iIndex, sNames, sCounts, sFlags). Returning true will break the loop.
IsPlayerStealthedOrDisguised bool IsPlayerStealthedOrDisguised(handle player) Returns true if the player is fully cloaked or has a disguise except when burning, jarated, or bleeding. Always returns false if the entity is not a player.
NewTankType void NewTankType(string name, handle table) Adds the inputted table with the specified name to the TankScripts or TankScriptsWild table which get ran when a tank with a matching name spawns.
List of Keyvalues
Keyvalue Description
Color Colors the tank, treads, and bomb mechanism. "255 127 0" would result in an orange tank.
DisableBomb Set to 1 to only hide the bomb mechanism.
DisableChildModels Set to 1 to hide the tank tracks and bomb mechanism.
DisableOutline Hides the tank outline that is normally visible through walls.
DisableSmokestack Hides the smokestack that comes out of the tank's exhaust pipe.
DisableTracks Set to 1 to only hide the tank tracks.
EngineLoopSound Accepts a sound path string to replace the tank's looping sound. Normally this sound is for the rumbling of the engine and the movement of the tank tracks.
Model Accepts a single model path string or a table of multiple model path strings. The keyvalues for a table are: Tank, Damage1, Damage2, Damage3, LeftTrack, RightTrack, Bomb.
NoDestructionModel Set to 1 to hide the tank's explosion animation. Does not get rid of the explosion particle.
NoScreenShake Disables the screenshake effect that occurs when standing near the tank.
OnSpawn Calls this function within its own tank type scope, comes with variables: self, sTankName, hTankPath. You can add a think function to the tank by defining a function named Think(). Think functions also come with variables: flTime, vecOrigin, angRotation, iTeamNum, iHealth, iMaxHealth.
OnDeath Calls this function when the tank dies, similar to how SetDestroyCallback works.
PingSound Accepts a sound path string to replace the tank's ping noise that occurs every 5 seconds.
Scale Sets the tank's model scale.
TeamNum Sets the team of the tank.
NormalizeAngle float NormalizeAngle(float angle) Converts an angle value to be within the usual boundaries of an angle. The physical angle will not change. -180 < x ≤ 180

From the TF2 VScript Examples page

PathMaker void PathMaker(handle player) Outputs paths for CreatePaths or CreateLoopPaths to console. Read the Path Maker section above for more info.
PrecacheParticle void PrecacheParticle(string name) Precaches a particle. This is only useful if a particle isn't precached when using DispatchParticleEffect or DispatchParticleEffectOn
PrecacheSound void PrecacheSound(string soundName) Wrapper for PrecacheSound. Detects if the sound is a file or a soundscript.
SetDestroyCallback void SetDestroyCallback(handle entity, handle callback) When the inputted entity dies, calls the inputted function.

From the TF2 Script Functions page

SetEntityColor void SetEntityColor(handle entity, int r, int g, int b, int a) Sets the entity's color and alpha. Alternatively, use a color/alpha input via AcceptInput to achieve the same effect.

From the SDK VScript Examples page

SetParentArray void SetParentArray(handle arrayChildren, handle parent, string attachment = null) All the entities listed in the array will be parented to the defined parent. Can be parented to one of the parent's attachments if defined.
SetPathConnection void SetPathConnection(handle path1, handle path2, handle pathAlt = null) Connects the first path_track to the second path_track. Optionally adds an alternative, toggleable path_track to the first path_track.
SetTankColor void SetTankColor(handle tank, string rgb) Colors the tank, treads, and bomb mechanism. "255 127 0" would result in an orange tank.
SetTankModel void SetTankModel(handle tank, handle model) Accepts a single model path string or a table of multiple model path strings. The keyvalues for the table are: Tank, LeftTrack, RightTrack, Bomb.
SetValueOverrides void SetValueOverrides(handle table) Overrides any values that are allowed to be customized within the available tank types.
SpawnEntityFromTableFast void SpawnEntityFromTableFast(string classname, handle keyvalues) Experimental function to spawn entities without a perf warning. Has only been tested on entities with a model.
VectorAngles QAngle VectorAngles(Vector input) Converts the Vector to a QAngle. The QAngle is the angle towards the Vector.

From the TF2 VScript Examples page

About

a VScript library for custom tank implementation

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors