[TF2] Bumper Cars
Before you give a suggestion, read the TODO list. It's probably already there.
Description:
This plugin adds the /car command to toggle riding in bumper cars on themselves.
Admins can also force toggle it on others.
This plugin also does some other fixes.
- Precaches everything related to carts so they work on any map.
- In sd_doomsday_event, your cart is removed during the jarate swimming spell and returned afterwards.
- Can set infinite charge boost.
- Can enable the ability to prematurely stop boosting by pressing +back
- Can make everyone always spawn in a car.
- Can make the /car command only usable by one team.
- Can make only one team always spawn in a car.
- Can fix the head resizing to always be normal.
- Can enable suicide console commands while driving, which Valve recently disabled.
- Fixes the bug where changing teams while in a bumpercar will let you switch teams without dying and respawning.
- Read the changelist below for more!
Happy Hallofrog! Frog. Frog frog.
Sorry, I've never tried using Updater before, and I've been making fast updates to this thing.
Commands:
sm_car <noparam|#userid|name> <noparam|on|off>
Toggles bumper car on all targets or self.
Examples:
/car -> client toggles car on themselves
/car @me -> same as above
/car username -> admin toggles car on that player
/car @all -> error, you need to say ON/OFF if you multi-target
/car @blue on -> admin toggles car to be on, on all blue players
/car @blue -> error, you need to say ON/OFF if you multi-target
/tele @!cars -> admin teleports everyone who is not driving
/slay @cars -> this is broken, because of valve, so you have to do the commands below
sm_car <target> off; sm_slay <target> -> remove their car and then slay them
By default, anyone can target themselves.
Admins with access to ADMFLAG_CHEATS can target others.
If it's single-target, not specifying ON or OFF will simply toggle the target.
(Actually, specifying on/off when toggling it on yourself is messed up right now and will just always toggle).
If you multi-target, you MUST specify ON or OFF.
Also: sm_bumpercar -> Does the same as above.
You can also target @cars and @!cars to affect people in cars, or not in cars.
Convars:
sm_cvar tf_halloween_kart_boost_duration Default: "1.5"
-1.0 = Infinite charge duration. Any other negative value means 0 charge duration. 0 = 0 charge duration. Anything higher is your new charge duration. Does not affect boost pads in maps.
sm_cvar tf_halloween_kart_boost_recharge Default: "5.0"
How long it takes for your boost to recharge after activation. Less than or equal to 0 is instant.
cv_bumpercar_version Default: "0x0X" - Bumper Car Version (DO NOT CHANGE)
cv_bumpercar_teamonly Default: "0" - Which team can use car command when targeting themselves?
0 = Anyone can enter bumper cars via command | 2 = Only red | 3 = Only blu | Anything else = Anyone can. - This can negate the effects of setting cv_bumpercar_respawn to 2 so it only works for one team.
cv_bumpercar_headscale Default: "3.0" - Head scale for when you're in a bumper car.
Min 0.1; Max 3.0
cv_bumpercar_respawn Default: "1.0"
1 = Keep car on respawn | 0 = Lose car after death | 2 = Everyone automagically spawns in a car all the time every time they respawn
cv_bumpercar_suicide Default: "1"
1 = people in car can suicide | 0 = cannot suicide
cv_bumpercar_spawntoggle Default: "1"
1 = have to respawn to enter/exit car | 0 = can enter/exit car at any time - don't need to respawn
cv_bumpercar_backstop Default: "1"
1 = +back cancels speed boost | 0 = +back does not cancel speed boost
cv_bumpercar_blockplayerdmg Default: "1"
1 = enable damage block for non-drivers attacking drivers | 0 = no damage block, non-drivers can damage and kill drivers
cv_bumpercar_percent Default: "-1"
-1 = (anything negative) car damage acts like it normally does | 0+ (anything non-negative) car damage percentage stays at this integer all the time
cv_bumpercar_initpct Default: "0"
An amount of damage cars start with on spawn. Only applies if cv_bumpercar_percent is -1.
Admin Overrides:
adm_bumpercar_self - (Default: Anyone)
Admin flag check for whether or not clients can toggle bumper cars on themselves
adm_bumpercar_target - (Default: Cheats)
Admin flag check for whether or not clients can toggle bumper cars on others
Installation:
Make sure you have Sourcemod.
Get Plugin below.
bumpercar.smx goes in tf/addons/sourcemod/plugins/
plugin.bumpercar.cfg will be auto-generated in tf/cfg/sourcemod/
bumpercar.sp is only needed for programmers.
You can use /rcon sm plugins load bumpercar to enable the plugin mid-game. unload to remove it. reload to update it if you change or reupload bumpercar.smx
After it's loaded, edit tf/cfg/sourcemod/ch.bumpercar.cfg to your settings.
Changelist:
Quote:
0x0C (11/7/2014 | 12:31AM)
* Being removed from your car removes the KartDash and KartCage
conditions
* Fixed players not being oriented with their spawn points on spawn
* Removed the halloween gates, kept the movement prevention
* Fixed falling off the map not killing drivers
Older Changes:
Spoiler
0x0B (11/1/2014 | 1:01AM)
* Reimplemented charge regen time handling for infinite charge times.
Can no longer hold +back and +attack2 while infinite charge is enabled
to constantly lose/gain boost. Upon ending infinite boosts, your charge
meter only comes back after 2.5s
Probably messes up something related to boost pads again though <.<
(E.g., introduces inconsistent handling of boost regen).
* Added fix for spawning on the ground generating a constant smashing
sound in maps.
* Added cvar to disable non-drivers from being able to damage/kill
drivers.
* Added cvar to force bumper car damage percentage to never change.
* Re-removed (lol) the bumpercar 2x damage thing.
* Attempted fix for merasmus thriller taunt and h'ween ghostmode.
* Fixed sound precaching. Finally?
* Renamed stuff back just cuz it's my style ;v
* Renamed ch_cars.* filenames to bumpercar.* * Renamed plugin.cars.cfg to ch.bumpercar.cfg - Check your settings.
0x0A (10/31/2014 | 9:56PM)
* Update made by FlaminSarge!
* Fixed view snap so you don't spawn facing backwards and other weird angles.
* Renamed all cvars/config/filenames to ch_cars.
* Removed boost cvar in favor of tf_halloween_kart_boost_duration.
* Fixed movement on round start so it'll actually be blocked.
* Fixed Chdata's ⑨-tier counting skills.
v⑨ (10/31/2014 | 1:26PM)
* Renamed file to car.* instead of bump.*
* Fixed 'always cart' setting not being cleared when a player disconnects.
* Fixed changing teams allowing you to instantly respawn on the other team.
* Added cvar to allow suiciding (Thanks McKay, yes I copied your method, just changed slightly).
* Added cvar to only allow entering a car after respawning, as opposed to as soon as you use the command.
* Changing cv_bumpercar_teamonly mid-game now removes people's bumpercars if they're on the wrong team.
- Warning: Does NOT check for sd_doomsday_event minigames yet!
0x08 (10/30/2014 | 7:41PM CDT)
* Fully fixed precaching materials used by the kart.
* Fixed some part carticles. (If they were broken, at least).
* Dead players can now be toggled to respawn with a bumper car.
0x07 (10/30/2014 | 7:26PM CDT)
* Fixed a bug when targeting others to become a car, setting yourself to their settings instead of everyone else you targeted.
* Fixed the respawn cvar not to override the team only cvar setting.
0x06 (10/30/2014 | 12:12PM)
* Added cv_bumpercar_respawn to allow respawning in a bumpercar
* Fixed sounds not being precached
0x05 (10/30/2014 | 7:09AM)
* Disabled faulty code for right clicking to disable infinite boosts.
* Fixed OnTakeDamage error spam.
0x04 (10/30/2014 | 6:59AM)
* Added cv_bumpercar_headscale - Set the scale of your head while in a bumper car
0x03 (10/30/2014 | 6:01AM)
* If you fall out of the map while in a car, you are killed. * Drivers do 2x damage to non-drivers.Broken.
* Added cv_bumpercar_boosttime for varied/disabled/infinite boost time.
* Small attempt at fixing the boosting SFX, doesn't really work for me, need input.
0x02 (10/30/2014 | 3:36AM)
* Car is removed when the jarate swimming spell activates
* Car is returned if you were driving beforehand
* Fix /car @me saying you can't target yourself
0x01 (10/30/2014 | 3:00AM)
* Initial release!
TODO: (High priority)
Quote:
Priority:
* At X percent car damage, the car just explodes.
* Add a cooldown on the alternative suicide method.
Priority except slightly less:
* Fix for /slay and similar scenarios being unable to kill cars.
* Admins toggling car on others can bypass cv_bumpercar_spawn
* Fix weapons not always being hidden when entering a bumper car (try holy mackeral for example).
* Prevent bumper car toggle in sd_doomsday_event during the bumper car minigames.
* Fix forced taunts not re-entering the car when finished.
* Fix wrong team colored cars.
TODO: (As I get to it)
Spoiler
Other:
* Fix /car @me <on|ofF>
* Fix for carts being unable to cap
* Cars take SSBBrawl styled damage from non-drivers instead of having you be killable.
* Cvar to make various options only apply when put into a kart via /car as opposed to via the map.
* Cart absorb HP. Aka, dying = you only lose your cart.
* Investigate custom models and whether or not we can do something about that
* Fix cart HUD?
* Fix for cv_bumpercar_boosttime not to override boost pad boost times
* Investigate setting NoBlock on cars
* Fix for area portals in maps
* Drift sliding / turn controls
* Fix thirdperson skewing
3:52 PM - |Tf2Ĥăts-λ| Ƥhoton-Ƥhoenix: the glitches or bugs you wanted me to list were only because players weren't stripped of their weapons/items before being in the cart
3:52 PM - |Tf2Ĥăts-λ| Ƥhoton-Ƥhoenix: like spies cloaking before typing !car
3:53 PM - |Tf2Ĥăts-λ| Ƥhoton-Ƥhoenix: to get their car to be invisible
3:53 PM - |Tf2Ĥăts-λ| Ƥhoton-Ƥhoenix: cloak and dagger spies
3:54 PM - |Tf2Ĥăts-λ| Ƥhoton-Ƥhoenix: The other was Medics being able to heal bumper cars and Conch Soldiers/Normal medics healing having a passive heal rate making them slightly OP compared to other classes in bumper cars
Credits:
Dr. McKay who made the first kart plugin.
FlaminSarge who gave coding contributions and suggestions.
Wanna support me?
Post suggestions (read the TODO list first) and...
Join TF2Data, play on our servers, or donate! ;p
(See siggy for links!)
Want support?
Post questions and...
Join TF2Data if you have questions not related to this plugin.
Test with custom models. I think there are some bugs. If you die with say, a static prop equipped, or a custom model that is missing certain animations sequences, every client on the server drops.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
L 10/30/2014 - 194:21: [SM] Displaying call stack trace for plugin "bump.smx":
L 10/30/2014 - 194:21: [SM] [0] Line 518, C:\Users\Otokiru\SM\scripting\include\tf2_sto cks.inc::TF2_IsPlayerInCondition()
L 10/30/2014 - 194:21: [SM] [1] Line 132, bump.sp::OnTakeDamage()
L 10/30/2014 - 194:21: [SM] Native "GetEntProp" reported: Property "m_nPlayerCondEx2" not found (entity 0/worldspawn)
I have a problem on Mariokart2 map where the general music and disco music does not work. I haven't tracked down yet if it is Valve's update last night, this plugin or spells (which I enabled at the same time) causing it, but I did notice in the server window that none of the bumperkart sounds are precached and it's spewing errors. Not sure if it's related, but is it possible to precache them along with the models?
Hmm.... I've been getting weird problems with the sounds precaching... e.g., the two I bothered to precache still don't play for me.
And I don't see any errors for any other sounds, while my friends have been reporting them.
Quote:
Originally Posted by MrBen
Hi Chdata. Thank you very much for this.
I have a problem on Mariokart2 map where the general music and disco music does not work. I haven't tracked down yet if it is Valve's update last night, this plugin or spells (which I enabled at the same time) causing it, but I did notice in the server window that none of the bumperkart sounds are precached and it's spewing errors. Not sure if it's related, but is it possible to precache them along with the models?
Thanks again for the great plugin!
This sounds like a bug with Soundscapes which has known to been broken since this update.
Well. Frog.
Updated with fix for sound precaching and added respawning with car.
Yeah - the kart engine sound plays for some people and not for others. It appears to be random though as I heard it the first time I joined the server and not when I returned.
I can see in the server console that there are a lot of bumperkart sounds that are not precached.
Now that you mention it I can remember problems with the Mariokart2 map in the past after a big update, so it wouldn't suprise me if it was soundscape related.
I've been watching our two servers that use your plugin all afternoon. The Kart model also seems to randomly dissapear at times, but overall you have made a lot of players very happy on Mariokart. I've heard some actually squealing with delight - just thought you'd like to know :-)
Edited to add: Thanks for the update - trying it out now!