Help needed
Posted: Sun Apr 20, 2014 1:07 pm
How do I allocate spawn locations on voxed?
Ace of Spades / OpenSpades
http://www.buildandshoot.com/forums/
http://www.buildandshoot.com/forums/viewtopic.php?f=56&t=10820
name = 'Firestorm'
version = '1.1'
author = 'SLoW'
description = ('A remix of the classic Tribes 2 map Firestorm.')
extensions = { 'water_damage' : 25 }
protected = ['B5', 'G4']
fog = (232, 128, 5)
# scripting
from random import randrange, choice
from pyspades.constants import *
from pyspades.server import ServerConnection
from commands import say
def get_entity_location(team, entity_id):
if entity_id == BLUE_FLAG:
# puts only the blue flag in the blue base
#z = team.protocol.map.get_z(109, 274)
return (96, 274, 25)
if entity_id == BLUE_BASE:
# puts only the blue flag in the blue base
#z = team.protocol.map.get_z(113, 315)
return (83, 274, 25)
if entity_id == GREEN_FLAG:
# puts only the green flag in the green base
#z = team.protocol.map.get_z(392, 306)
return (413, 232, 29)
if entity_id == GREEN_BASE:
# puts only the blue flag in the blue base
#z = team.protocol.map.get_z(408, 330)
return (426, 232, 29)
def get_spawn_location(connection):
if connection.team is connection.protocol.blue_team:
x, y, z = ServerConnection.get_spawn_location(connection)
positions = (79, 273)
xdif = randrange(-30, 30)
ydif = randrange(-30, 30)
x, y = positions
newx = max(0, min(511, x + xdif))
newy = max(0, min(511, y + ydif))
newz = connection.protocol.map.get_z(newx, newy)
return (newx, newy, newz)
if connection.team is connection.protocol.green_team:
x, y, z = ServerConnection.get_spawn_location(connection)
positions = (430, 232)
xdif = randrange(-30, 30)
ydif = randrange(-30, 30)
x, y = positions
newx = max(0, min(511, x + xdif))
newy = max(0, min(511, y + ydif))
newz = connection.protocol.map.get_z(newx, newy)
return (newx, newy, newz)