Works for both FF2 and VSH. SMX file shouldn't go into any subfolder except plugins.
Another thing I felt like coding. It teleports the hale to spawn if they take significant environmental damage. This is not an original idea...there are at least two other versions which are private. One has the flaw of teleporting the hale to spawn even for minor damage (like 3-5), the other one randomly allows backstabs to work along with airblasts, and stuns the hale allowing pyros to chain the hale into pits over and over on maps with pits near spawn. (the stun being necessary because it allowed both red and blu spawn points at all times) Neither work properly with vsh_megaman6_XX, which is ultimately why I've written this.
My version adds support for various common buffs and debuffs, stun/immobilize, megaheal to avoid the pyro problem, but it also grabs coordinates of real players at round start (versus picking a random spawn point) so that multi-maps like vsh_megaman6 can still work. It supports blacklisting so "run" maps like vsh_runblitz which poison the spawn area 1-2 minutes into the round can be left out. It allows you to set the delay time before allowing the victim to get sent to opposing spawn points.
Finally, it adds support for reducing the damage of pits and even allowing RED team members to survive, if that's what you want.
It's very configurable. Here's an example convar file:
Spoiler
Code:
# EXAMPLE CONFIG FOR Teleport to Spawn
// plugin enabled?
tts_enabled "1"
// minimum damage for environment to teleport the hale to spawn
tts_mindamage "100.0"
// should uber the hale when they teleport?
tts_uber "1"
// should make the hale invincible when they teleport?
tts_invincible "1"
// should make the hale immune to knockback, including airblasts, when they teleport? note that it also prevents stunning.
tts_megaheal "1"
// should immobilize the hale when they teleport?
tts_immobilize "1"
// stun level on teleport. 0=none, 1=fear, 2=moonshot
tts_stunlevel "0"
// duration of all the above effects on teleport
tts_effectduration "5.0"
// also teleport RED team to safety?
tts_includered "0"
// if the above is 1, factor to apply to damage to RED team
tts_redfactor "1.0"
// factor to apply to damage to BLU team. you may want to set this to 0.0, because FF2 (intentionally or not) doubles the damage from environmental traps.
tts_blufactor "0.0"
// time from the start of a round to when it's valid to teleport the hale to RED spawn as well as BLU
tts_timebeforeredspawn "60.0"
// this last one is important for many. it's a blacklist, semicolon separated.
// I strongly recommend keeping the first two entries in, which will ensure deathrun maps are not affected by this plugin.
// the rest will vary from server to server. for example TFF has some "run" maps which make RED and BLU spawns unsafe.
// these would also need to be blacklisted.
// you may also want to blacklist maps that already handle this well, like oilrig and skyhigh.
// You only need the beginning of map names, i.e. vsh_runblitz_
// This will ensure that updating maps to a newer version will still keep the blacklist going.
// Limit 2000 characters.
tts_blacklist "vsh_dr_;dr_"
// message to display to players when they get teleported. use \n for new line.
tts_message_nostun "You've been teleported safely to spawn."
// message to display if stunned or immobilized
tts_message_stun "You've been teleported safely to spawn.\nYou won't be able to move for a few seconds."
What this example does differently from the default options is immobilizes the hale, makes them knockback immune (not redundant, this'll keep velocity changes from piling up while immobile), and makes them invincible after they teleport to spawn. It also "negates" damage BLU players receive, which in reality just halves it, since FF2 applies environmental damage to players twice.
Console changes to these convars are only recognized at round start. Changes to tts.cfg are recognized when a new map starts up.
Attached are the code, smx, and a better documented default tts.cfg than would be generated otherwise.
Known Issues
- It'll also work for minions.
- Super Jump hales will still get Super Duper Jump.
- It will interfere with rages that implement the same effects, only if these effects are enabled. (overriding them, typically causing them to end more quickly)
- If you set it to teleport RED to safety and reduce damage they take, this will also include any rage that causes damage that doesn't belong to the hale. The most popular example I can think of is phatrages' Ion Attack.
UPDATES 1.0.1:
- Fixes minor issue where immobilize can interfere with rages that use MOVETYPE_NOCLIP, or other movetypes other than none. 1.0.2:
- Fixes stun not working at all.
- Fixes immobilize to throw out built up knockback when MOVETYPE_NONE is removed. 1.0.3:
- Fixes a very rare bug where projectiles from a dead player could trigger a teleport. (fail logic on my part) 1.0.4:
- Fixed a bug with minions who die from environmental damage, only to get resummoned and teleported to spawn.
OHEY YOU ALREADY MADE THE SOLUTION TO MEGAMAN MAPS I WAS GONNA ADD LUL
Hehe, coincidence of timing I suppose. VSP has had a different TTS for over a year but we just got megaman about 3 days ago. People love it. I love it...much nostalgia.
I'm not letting it go without a fight.
(though the old TTS has also caused problems with oilrig, whompfortress, and others...too...megaman of all things motivated me. funny.)
Also I ended up taking down megaman just cause of the filesize in the new map.
The maker actually contacted me about implementing a special fix for his new version of the map though.
And that one will have more optimization I think.
The new megaman is way too big, many people don't like it because of that.
As for mechanics, I just cache the spawns at round start to adt arrays or each team, and random pick from there.
Otd it's damagetype_& dmg_fall && damage > some number && attacker > maxclients && classname is trigger_hurt, reset them. It works good providing you use stripper to set pits to dmg_fall, as some maps just leave it as generic. You could mabye get away without using stripper and using a per map config with damage thresholds but it really is not good, because some mappers do stupid things like put hurts on gold piles, or make the fall pits damage only one team. Better to just fix it in stripper so it's consistent and be done with it.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
I'm wondering what I wanna do about maps like arena_aperture and vsh_killbox_8bit where after a few seconds into the round, the spawns become deathtraps forever.
Those are the only two maps that really have that problem so I figure I'd disable teleport to spawn at all on them, since there's also no death pits anyway...