can't find a good tutorial :/
i get errors trying to load my map...
- Code: Select all
name = 'hex'
version = '1.0'
author = 'FangedBeast and CowNorris'
description = 'WIP - Have fun!.'
# script
from pyspades.constants import *
import random
# this allows setting up spawns inside buildings etc. even for maps where
# building/destruction is allowed
# example spawns
spawn_locations_blue = [
(112, 222, 57),
(112, 285, 56),
(123, 313, 56),
(123, 191, 57),
]
spawn_locations_green = [
(382, 184, 56),
(391, 215, 55),
(398, 292, 57),
(386, 319, 56),
]
def get_spawn_location(connection):
if connection.team is connection.protocol.blue_team:
x, y, z = random.choice(spawn_locations_blue)
elif connection.team is connection.protocol.green_team:
x, y, z = random.choice(spawn_locations_green)
z -= 2.4 # magic numbers
x += 0.5
y += 0.5
if connection.protocol.map.get_z(x, y) <= z:
# allows spawning lower if the ground is destroyed
return x, y, z
else:
return x, y, connection.protocol.map.get_z(x, y)
i tired to use http://code.google.com/p/pyspades/wiki/MapScripting as a format..