User:Windolon/PopExtensionsPlus Documentation: Difference between revisions
(Add customattributes.nut doc) |
m (Resolve melee cleave attack todo) |
||
Line 168: | Line 168: | ||
| melee cleave attack | | melee cleave attack | ||
| On Swing: Weapon hits multiple targets | | On Swing: Weapon hits multiple targets | ||
| Set it to 64 for fair results. | | The input value controls how big the cleave/splash radius is, in hammer units. Set it to 64 for fair results. | ||
|- | |- | ||
| mod teleporter speed boost | | mod teleporter speed boost |
Revision as of 06:42, 9 February 2025
This is the documentation for PopExtensionsPlus, a VScript library for use in
Team Fortress 2.

Constants
- See this page for a full list of constants available from the library.
Custom attributes
PopExt attempts to recreate many of what Rafmod, a potato.tf server-side mod does in terms of fully custom player and weapon attributes.
The following table is similar to the item attributes table found on the TF2 wiki, which lists:
- Name: Internal name of the attribute.
- Description: The hud hint text that displays when the user inspects the weapon with the attribute. "
%s1
", "%s2
" and so on are replaced with the value of the attribute.
Unless otherwise stated, all values are formatted additively for display, i.e. by their flat value.
Name | Description | Notes |
---|---|---|
add cond on hit | applies cond %s1 to victim on hit | Accepts both an integer value and a length-2 array of an integer and a float. The float controls how long the cond will last. |
add cond when active | when active: player receives cond %s1 | |
alt-fire disabled | Secondary fire disabled | |
always crit | Weapon always crits | |
arrow ignite | arrows are always ignited | |
build small sentries | Sentries are 20⁒ smaller, have 33⁒ less health, take 25⁒ less metal to upgrade | |
can breathe under water | Player can breathe underwater | |
can headshot | Crits on headshot | |
cannot be headshot | Immune to headshots | |
cannot headshot | weapon cannot headshot | |
cannot upgrade | Weapon cannot be upgraded | |
collect currency on kill | bots drop money when killed | |
crit when health below | Player is crit boosted when below %s1 health | |
custom kill icon | Custom kill icon: %s1 | The input should be a string of the name of the kill icon, for example "megaton" . The full list can be found here.
|
custom projectile model | Fires custom projectile model: %s1 | The input should be a string of the directory to the model, for example "models/empty.mdl" .
|
dmg bonus while half dead | damage bonus while under 50% health | |
dmg penalty while half alive | damage penalty while above 50% health | |
dont count damage towards crit rate | Damage doesn't count towards crit rate | |
![]() |
Fires explosive rounds that deal %s1 damage | Obsolete. Use explosive bullets ext instead.
|
explosive bullets ext | Fires explosive rounds that deal %s1 damage in a radius of %s2 | The input should be a table of keyvalues:
"explosive bullets ext":
{
// the values here are defaults, modify at will
damage = 150
radius = 150
team = player.GetTeam() // player is the owner of the weapon with this attribute
model = ""
particle = "mvm_loot_explosion"
sound = "weapons/pipe_bomb1.wav"
killicon = "megaton"
}
Here, %s1 is the damage value, and %s2 is the radius value in hammer units. |
fire full clip at once | weapon fires full clip at once | ![]() |
fire input on hit | fires custom entity input on hit: %s1 | The input should be a string of EntFire inputs excluding the activator , separated by the ^ symbol. The target can also be !self . (The player who wields the weapon with this attribute.)
Example usage: "fire input on hit": "BigNet^RunScriptCode^printl(\`Someone got hit 2 seconds ago!\`)^2" The |
fire input on kill | fires custom entity input on kill: %s1 | The input should be a string of EntFire inputs excluding the activator , separated by the ^ symbol. The target can also be !self . (The player who wields the weapon with this attribute.)
Example usage: "fire input on kill": "BigNet^RunScriptCode^printl(\`Someone got killed 2 seconds ago!\`)^2" The |
fires milk bolt | Secondary attack: fires a bolt that applies milk for %s1 seconds. Regenerates every %s2 seconds. | The input should be a table of keyvalues:
"fires milk bolt":
{
// the values here are defaults, modify at will
duration = 10.0
recharge = 20.0
}
|
immune to cond | wielder is immune to cond %s1 | Accepts a simple integer input, or an array of integers. Array length has no limit. The attribute will remove all from the array. The inspection text displays accordingly. |
is invisible | Weapon is invisible | |
is miniboss | When weapon is active: player becomes giant | ![]() |
last shot crits | Crit boost on last shot. Crit boost will stay active for %s1 seconds after holster | |
melee cleave attack | On Swing: Weapon hits multiple targets | The input value controls how big the cleave/splash radius is, in hammer units. Set it to 64 for fair results. |
mod teleporter speed boost | Teleporters grant a speed boost for %s1 seconds upon exiting | |
mult building scale | building scale multiplied by %s1 | |
mult crit dmg | crit damage multiplied by %s1 | |
mult dmg vs airborne | damage multiplied by %s1 against airborne targets | |
mult dmg vs giants | Damage vs giants multiplied by %s1 | |
mult dmg vs same class | Damage versus [player's own class] multiplied by %s1 | |
mult dmg vs tanks | Damage vs tanks multiplied by %s1 | |
mult max health | Player max health is multiplied by %s1 | |
mult projectile scale | projectile scale multiplied by %s1 | |
mult swim speed | Swimming speed multiplied by %s1 | |
mult teleporter recharge rate | Teleporter recharge rate multiplied by %s1 | ![]() |
mvm sentry ammo | Sentry ammo multiplied by %s1 | ![]() |
no damage falloff | Weapon has no damage fall-off or ramp-up | |
noclip projectile | projectiles go through walls and enemies harmlessly | |
old sandman stun | Uses pre-JI stun mechanics | |
passive reload | weapon reloads when holstered | |
projectile gravity | projectile gravity %s1 hu/s | |
projectile lifetime | projectile disappears after %s1 seconds | |
radius sleeper | On full charge headshot: create jarate explosion on victim | |
reloads full clip at once | This weapon reloads its entire clip at once. | |
remove cond on hit | Remove cond %s1 on hit | |
replace weapon fire sound | Weapon fire sound replaced with%s1 | Sound name can be raw filename or soundscript as this uses EmitSoundEx. |
rocket penetration | rocket penetrates up to %s1 enemy players | |
self add cond on hit | applies cond %s1 to self on hit | Accepts both an integer value and a length-2 array of an integer and a float. The float controls how long the cond will last. |
self add cond on kill | applies cond %s1 to self on kill | Accepts both an integer value and a length-2 array of an integer and a float. The float controls how long the cond will last. |
set damage type | Damage type set to %s1 | Combinable damage types. See Constants.FDmgType for a full list. |
set damage type custom | Custom damage type set to %s1 | Only one custom damage type may be set. See Constants.ETFDmgCustom for a full list. |
set turn to ice | On Kill: Turn victim to ice. | |
special item description | %s1 | A purely cosmetic attribute used to give extra description. |
stun on hit | Stuns victim for %s1 seconds on hit | The input should be a table of keyvalues:
"stun on hit":
{
// the values here are defaults, modify at will
duration = 5
type = 2
speedmult = 0.2
stungiants = true
}
The |
teleport instead of die | %s1⁒ chance of teleporting to spawn with 1 health instead of dying | The value is formatted as a percentage, so setting to 0.75 means a 75% chance of escaping death. |
uber on damage taken | On take damage: %s1⁒ chance of gaining invicibility for 3 seconds | The value is formatted as a percentage, so setting to 0.75 means a 75% chance of getting uber. |
wet immunity | Immune to jar effects when active |
Mission attributes
PopExt also recreates Rafmod’s mission-wide attributes.
Robot tags
Utility functions
In implementing the functionalities of the library, a lot of utility script functions have been created. These are available for use under the table PopExtUtil
. For example, to call IsLinuxServer()
, you should do PopExtUtil.IsLinuxServer()
.