Cracking the Terrority Control Code
I found something out; you cannot have more than 16 cps
^
Interesting find, although more are probably not needed.
And btw, we could have a TOW/TC map competition where the mappers can create places where the tents will be. Sort of like on team fortress 2.
Interesting find, although more are probably not needed.
And btw, we could have a TOW/TC map competition where the mappers can create places where the tents will be. Sort of like on team fortress 2.
Nice idea! I'll get on it!
Edit: misread your post XD
Edit: misread your post XD
Last edited by thepolm3 on Fri Jun 07, 2013 5:34 pm, edited 1 time in total.
Get on what, the placing of tents wherever they want? Isn't that already done on this thread by BR_?
Or are you talkinga bout the map competition?
Or are you talkinga bout the map competition?
Simple setting of cps via map extensions
Code: Select all
"""
have fun!
put the extention in this format:
"territories":[(x,y),(x,y),(x,y)]
"""
from pyspades.server import Territory
def apply_script(protocol, connection, config):
class CPProtocol(protocol):
"""game_mode=1"""
def get_cp_entities(self):
terretories=[] #default
positions=[(0,0,63)] #default
#getting positions
extensions=self.map_info.extensions
if extensions.has_key("territories"):
positions=extensions['territories']
l=len(positions)+1
#looping through positions
for i in range(l-1):
pos=positions[i]
if len(pos)>2: #if given the x,y and z
x,y,z=pos
else: #if given only x and y
x,y=pos
z=self.map.get_z(x,y)
cp=Territory(i, self, x, y, z) #creates the territory
#sets the team
if i<l/2:
cp.team=self.blue_team
elif i<l/2:
cp.team=self.green_team
else:
cp.team=None
#add the teretory to the list
terretories.append(cp)
#the end!
return terretories
return CPProtocol,connection
Attachments
CustomTerritories.py
(1.4 KiB) Downloaded 245 times
(1.4 KiB) Downloaded 245 times
Who is online
Users browsing this forum: No registered users and 18 guests