Topic: [MOD] Teeworlds Shield mod
Hi,
Following this discussion: http://www.teeworlds.com/forum/viewtopic.php?id=3502
I have programmed this mod with some help from Rajh.
The concept:
Enjoy your regular gametype (CTF, DM, TDM and the instagib variants) with another gameplay element: an energy shield.
The gametype is named with an X appended as in eXtended .. for instance, CTF with shield is CTFX, iDM with shield is iDMX.
To enable the shield, use sv_shield_enable 1
The shield works this way:
- to switch to it, use the bind "+shield; say /shield" (the say command is there to disambiguate real player switch from a bug in the client which insists for wanted weapons even if they already had it earlier...).
- if you have the shield, it is active.
- when shield is active, its "energy" decreases .. it is represented by the ammos decreasing fast. (change with sv_shield_duration; default 3)
- when the shield isnt active, it regenerates itself. Standard rate: 1 energy point(ammo) every 0.4seconds (change with sv_shield_regentime; default 4).
- if you fire with the shield active, you get your previous weapon and automatically fire with it instead... Also, if you are being hooked at the time you fire, and the hook(s) go through the shield, the hooks are cut off and the hooking enemies are sent back a bit. This "feature" (special defensive power) might change depending on feedback, it was very hard to use but I made some changes to shield reload so it might be too powerful now! I had no one to test this final mod .
- if you let the shield deplete itself of all the energy (ammo = 0), you can't get it back until it is completely full again (4 seconds)
- the shield doesn't behave like weapons... You can switch to it at anytime (not waiting for a reload)... and switch out of it at anytime. However you cannot use it to shoot faster, all weapon reloads must complete. If you don't have shield energy left, and you switch back, you might still have to wait for your previous reload to finish (especially if you fired with a long reload weapon before, eg the laser rifle). I am still not sure which will be the final behavior (wait for reloads or can switch at anytime). The thing is, even if you can use the shield to cover almost all the time when you're not actually shooting, it costs shield energy and you might need it more later. Also, it is really tricky to do and keep yourself protected with the shield, and totally useless if your opponent isn't using the pistol or the laser .
The shield blocks PISTOL BULLETS (not shotgun) and REFLECTS lasershots (to the direction you're aiming at)... but you have to AIM with your shield to cover the angle the laser/bullet hits you!
Screenshot:
As you can see, I'm using the katana blast to act as my energy field, it's pretty cool imho and doesn't require heavy client modding.
The shield is hard to use, it is meant to be hard to use. It is not perfectly balanced yet, but it's a good start. This is a proof of concept first and a fun mod then.
HOW TO PLAY IT?
It requires a change to the protocol unfortunately (to define the new weapon). It will be ported to 0.6.0 and will not need a modded client then, but for now a modded client is required to play (as well as the server obviously). I can build it only for Linux, so if someone can build it for Windows and Mac I would be grateful.
Patchfile (patch against 0.5 svn branch, but it patches against 0.5.1 fine with patch -p0 < teeshields-0.1.patch in the root folder)
Teeworlds client linux32 binary (be careful, not compatible with other servers, so don't erase your teeworlds copy, call this one teeshields and put it in your teeworlds directory or a copy of it)
Teeworlds client windows binary built by spl0k (be careful, not compatible with other servers, so don't erase your teeworlds copy, call this one teeshields and put it in your teeworlds directory or a copy of it)
Teeworlds server linux32 binary (I guess you know what you're doing here)
Teeworlds server win32 binary built by spl0k (I guess you know what you're doing here)
Sample configuration
I'm starting a public server for testers. Because the "compatible version" works on client version and not protocol revision, to find servers, search for the X gametype ! And uncheck "compatible version". I didn't look into that so maybe someone else who actually cares can fix it.
This instagib part is based on the Instagib mod by spl0k aka Al of the HuH server (because it's the cleanest instagib mod out there imho).
Thanks to Rajh for helping me getting started, Ubuntu for all the help, o10 for feedback, matricks for making a 0.6.0 that won't need client modding... and everyone who made this idea possible.
Thanks spl0k for the windows builds.
And thanks to the most awesome Teeworlds clan, Qi, for giving me a motivation to do this mod ;p. http://qi.m0g.net/ !
If someone can make builds, please do!
Hope you guys have fun.