Description
Adds a beam following an entity (
TE_SetupBeamFollow) by classname.
Tested only in
L4D1/
L4D2/
PVKII games but may work in other games as well. (however the classnames in the data file are only based on these 3 games)
Features- Allow enabling/disabling the plugin.
- Allow setting the beam model.
- Allow setting the beam time duration.
- Allow setting the beam initial width.
- Allow setting the beam ending width.
- Allow setting the beam fade time duration.
- Allow setting a random RGB color to the beam.
- Allow setting the beam RGB color.
- Allow setting a random alpha (transparency) to the beam.
- Allow setting the beam alpha (transparency).
Preview
(PVKII game screenshot)
Cvars
A configuration file named "
beam_follow_classname.cfg" will automatically be created for you upon the first run in the "
\cfg\sourcemod\" folder.
PHP Code:
// Enable/Disable the plugin.
// 0 = Disable, 1 = Enable.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
beam_follow_classname_enable "1"
Data file (data/beam_follow_classname.cfg)
PHP Code:
// Attributes explained:
// "enable" -> Apply a beam follow to entity. "0" = Disable, "1" = Enable.
// "model" -> Beam model.
// "lifeDuration" -> Beam time duration.
// "widthStart" -> Beam initial width.
// "widthEnd" -> Beam ending width.
// "fadeDuration" -> Beam fade time duration.
// "randomColor" -> Apply a random RGB color to the beam. "0" = OFF, "1" = ON.
// "color" -> Beam RGB color. Use three values between 0-255 separated by spaces. "<0-255> <0-255> <0-255>", e.g: "255 255 255". Ignored when "randomColor" is "1".
// "randomAlpha" -> Apply a random alpha (transparency) to the beam. "0" = OFF, "1" = ON.
// "alpha" -> Beam alpha (transparency). 0-255. "0" = Invisible (0%), "255" = Fully visible (100%). Ignored when "randomAlpha" is "1".
// Note: You can overwrite the "default" attribute values inside any other section (e.g. "classnames")
"beam_follow_classname"
{
"default"
{
"enable" "1"
"model" "materials/sprites/laserbeam.vmt"
"lifeDuration" "1.0"
"widthStart" "1.0"
"widthEnd" "1.0"
"fadeDuration" "10"
"randomColor" "1"
"color" "255 255 255"
"randomAlpha" "0"
"alpha" "255"
}
"classnames"
{
/*** L4D1 and L4D2 classnames ***/
// Survivor - Throwable - Slot 3
"molotov_projectile"
{
"enable" "1"
"randomColor" "0"
"color" "255 50 0"
}
// Survivor - Throwable - Slot 3
"pipe_bomb_projectile"
{
"enable" "1"
"randomColor" "0"
"color" "200 1 1"
}
// Survivor - Throwable - Slot 3 (L4D2 only)
"vomitjar_projectile"
{
"enable" "1"
"randomColor" "0"
"color" "0 128 0"
}
// Survivor - Primary Weapon - Slot 1 (L4D2 only)
"grenade_launcher_projectile"
{
"enable" "1"
"randomColor" "0"
"color" "255 255 0"
}
// Infected - Spitter - Special Ability (L4D2 only)
"spitter_projectile"
{
"enable" "1"
"randomColor" "0"
"color" "0 255 0"
}
// Infected - Tank - Special Ability
"tank_rock"
{
"enable" "1"
"randomColor" "0"
"color" "128 128 128"
}
/*** PVKII classnames ***/
// Pirates - Skirmisher - Slot 3
"powderkeg"
{
"enable" "1"
"randomColor" "0"
"color" "255 0 0"
}
// Pirates - Captain - Slot 2 + Special
"projectile_rocketball"
{
"enable" "1"
"randomColor" "0"
"color" "255 0 0"
}
// Pirates - Captain - Slot 3
"npc_parrot"
{
"enable" "1"
"randomColor" "0"
"color" "255 0 0"
}
// Pirates - Sharpshooter - Special
"projectile_powderhorn"
{
"enable" "1"
"randomColor" "0"
"color" "255 0 0"
}
// Vikings - Huscarl - Slot 3
"throwaxe"
{
"enable" "1"
"randomColor" "0"
"color" "0 255 0"
}
// Vikings - Gestir - Slot 3
"javelin"
{
"enable" "1"
"randomColor" "0"
"color" "0 255 0"
}
// Vikings - Bondi - Slot 2
"atlatl"
{
"enable" "1"
"randomColor" "0"
"color" "0 255 0"
}
// Vikings - Bondi - Slot 3 / Slot 3 + Special
"flatbow_arrow"
{
"enable" "1"
"randomColor" "0"
"color" "0 255 0"
}
// Knights - Archer - Slot 2
"crossbow_bolt"
{
"enable" "1"
"randomColor" "0"
"color" "0 0 255"
}
// Knights - Archer - Slot 3 / Slot 3 + Special
"arrow"
{
"enable" "1"
"randomColor" "0"
"color" "0 0 255"
}
// Knights - Man-at-Arms - Slot 3
"crossbow_bolt_maa"
{
"enable" "1"
"randomColor" "0"
"color" "0 0 255"
}
// Knights - Assassin - Slot 2
"crossbow_pistol_bolt"
{
"enable" "1"
"randomColor" "0"
"color" "0 0 255"
}
// Knights - Assassin - Slot 3
"projectile_pouch"
{
"enable" "1"
"randomColor" "0"
"color" "0 0 255"
}
// Knights - Assassin - Slot 3
"projectile_caltrops"
{
"enable" "1"
"randomColor" "0"
"color" "0 0 255"
}
// Knights - Assassin - Special
"projectile_smokebomb"
{
"enable" "1"
"randomColor" "0"
"color" "0 0 255"
}
}
}
Admin Commands
- sm_beam_follow_config_reload => Reload the beam follow configs. (z flag required)
- sm_print_cvars_beam_follow_classname => Print the plugin related cvars and their respective values to the console. (z flag required)
Change Log
Known Supported Games
- Left 4 Dead 1
- Left 4 Dead 2
- Pirates, Vikings, and Knights II
Notes
- Using bigger values may crash the game.
- The engine has a limitation on how many temp entities (plugin beams) can be rendered at the same time, usually 32.
- If you don't see a trail try changing the "model" attribute to "materials/sprites/laser.vmt". (your game may not have the default plugin model)
Related Plugins
Post Reply
- Any feedback, bug reports, fixes, improvements, translations or suggestions for the plugin are welcome.
Installation
- Put the "beam_follow_classname.cfg" file in your "\addons\sourcemod\data\" folder.
- Put the "beam_follow_classname.smx" file (click Get Plugin) in your "\addons\sourcemod\plugins\" folder.