-but i've noticed that I always spawn the wrong way around (out towards the sea), how do i fix this?
-also, my spawn area isn't flat so sometimes and sometimes i spawn from quite a height and land on water; losing about 20-30hp, how do i make it so i spawn immediately on a flat surface and not a set height?
Code: Select all
I've copied the code/structure from 'Trenches' by kiwi... but this is what i have so far# script
from pyspades.constants import *
import random
def get_entity_location(team, entity_id):
if entity_id == BLUE_FLAG:
x, y, z = 403, 256, 54
return (x, y, z)
if entity_id == GREEN_FLAG:
x, y, z = 107, 256, 54
return (x, y, z)
if entity_id == BLUE_BASE:
x, y, z = 409, 256, 54
return (x, y, z)
if entity_id == GREEN_BASE:
x, y, z = 98, 256, 54
return (x, y, z)
def get_spawn_location(connection):
if connection.team is connection.protocol.blue_team:
x = random.randrange(379,393)
y = random.randrange(183,330)
z1 = 54
return (x, y, z1-1)
if connection.team is connection.protocol.green_team:
x = random.randrange(116,138)
y = random.randrange(179,331)
z1 = 54
return (x, y, z1-1)Thanks :)




