Tennis
-
Gibbs3333
Mapper
- Posts: 89
- Joined: Wed Dec 19, 2012 2:43 pm
Where can I find the script for the new game mode "Tennis" ?

-
VladVP
Post Demon
- Posts: 1425
- Joined: Fri Dec 14, 2012 10:48 pm
Where did you hear about this "Tennis" gamemode? Do you mean football? (Which is a really funny gamemode)
It's a Christmas miracle!
-
AWhiteGuy
League Participant
- Posts: 91
- Joined: Sun Nov 11, 2012 1:35 pm


-
WindSpirit
League Participant
- Posts: 12
- Joined: Sun Feb 03, 2013 10:02 pm
hmm im not sure about the script tennis, but the sport tennis is awesome! 
"everyone is equal in the face of a bullet"
-
Sniper101
Build and Shoot's 1st Birthday
- Posts: 60
- Joined: Sun Dec 02, 2012 6:14 am
-
HoboHob
Winter Celebration 2013
- Posts: 979
- Joined: Mon Nov 05, 2012 5:02 pm
-
Handles
League Participant
- Posts: 1087
- Joined: Tue Jan 08, 2013 9:46 pm
script=awesome fun 
-
Gibbs3333
Mapper
- Posts: 89
- Joined: Wed Dec 19, 2012 2:43 pm
-
izzy
Head Admin / Co-founder
- Posts: 474
- Joined: Tue Oct 09, 2012 8:16 pm
There are a few steps to set it up properly:
- Edit ~/feature_server/config.txt
Code: Select all
"game_mode" : "tennis", "user_blocks_only" : true, "scripts" : [ "tdm" ], "kill_limit" : 200, - Save tennis.vxl and tennis.txt to ~/feature_server/maps
- Save tennis.py to ~/feature_server/scripts
Code: Select all
# tennis.py last modified 2013-03-05 13:39:41 # complements tennis.vxl # maintained by izzy from pyspades.constants import * from math import sqrt def point_distance2(c1, c2): if c1.world_object is not None and c2.world_object is not None: p1 = c1.world_object.position p2 = c2.world_object.position return (p1.x - p2.x)**2 + (p1.y - p2.y)**2 + (p1.z - p2.z)**2 def apply_script(protocol, connection, config): class TennisConnection(connection): def __init__(self, *arg, **kw): connection.__init__(self, *arg, **kw) def on_flag_take(self): self.send_chat("Intel disabled.") return False return connection.on_flag_take(self) def on_block_build_attempt(self, x, y, z): self.send_chat('Building disabled.') return False return connection.on_block_build_attempt(self, x, y, z) def on_line_build_attempt(self, points): self.send_chat('Building disabled.') return False return connection.on_line_build_attempt(self, points) def on_join(self): self.send_chat('Block destruction disabled.') return connection.on_join(self) def on_hit(self, hit_amount, hit_player, type, grenade): result = connection.on_hit(self, hit_amount, hit_player, type, grenade) if result == False: return False if result is not None: hit_amount = result dist = sqrt(point_distance2(self, hit_player)) if not grenade: if self.weapon is not SHOTGUN_WEAPON: self.send_chat('ATTENTION: Shotgun and grenades only!') return False if self.tool is WEAPON_TOOL and self.tool is not (SPADE_TOOL or BLOCK_TOOL) and self.weapon is not (RIFLE_WEAPON or SMG_WEAPON): pctint = (100 * self.protocol.shotgun_multiplier - self.protocol.shotgun_pct_per_block * dist) pct = (100 * self.protocol.shotgun_multiplier - self.protocol.shotgun_pct_per_block * dist) pct = max(0,pct)/100.0 hit_amount = int(hit_amount * pct) self.send_chat('BULLET STRENGTH: %s%%' % int(pctint)) return hit_amount return connection.on_hit(self, hit_amount, hit_player, type, grenade) class TennisProtocol(protocol): game_mode = CTF_MODE shotgun_pct_per_block = config.get('shotgun_pct_per_block', 1.8) shotgun_multiplier = config.get('shotgun_multiplier', 1.3) def on_flag_spawn(self, x, y, z, flag, entity_id): if entity_id == GREEN_FLAG: return (0, 0, 63) if entity_id == BLUE_FLAG: return (0, 0, 63) return protocol.on_flag_spawn(self, x, y, z, flag, entity_id) return TennisProtocol, TennisConnection
-
Gibbs3333
Mapper
- Posts: 89
- Joined: Wed Dec 19, 2012 2:43 pm
Thank you izzy for this awesome game mode !

-
H@nkthet@nk
Deuced Up - Posts: 145
- Joined: Thu Dec 13, 2012 5:40 pm
... LOL what? there is a tennis game mode...
Checking it out !!!!!!!!!!!!!!!
Checking it out !!!!!!!!!!!!!!!
Who is online
Users browsing this forum: No registered users and 24 guests





