I cant set the spawns on my map

1 post Page 1 of 1 First unread post
Bbig Boss
Deuced Up
Posts: 27
Joined: Sat Jun 21, 2014 9:06 pm


The problem that I have is that i cant set the spawns of my map. I made the .TXT file with the meta data editor of blockman2D. the tent and the flag sets properly, but the spawns are still on the default random positions.

The problem is that i tried to use that script that is "spawn_locations_blue/green" (i only used 1 spawn location for each team, i dont know if this is wrong) and the pysnip says "cant find spawn rectangles" so I dont know what to do. The .TXT file is this

## GENERATED WITH BLOCKMAN2D v0.2.5.0
name = 'battlecity'
version = '0.75'
author = 'Big Boss'
description = ''
extensions = { 'water_damage' : 100 }

from pyspades.constants import *
from pyspades.server import ServerConnection
import random

def get_entity_location(team, entity_id):
if entity_id == BLUE_FLAG:
return (152, 227, 16)
if entity_id == GREEN_FLAG:
return (331, 285, 16)
if entity_id == BLUE_BASE:
return (150, 220, 16)
if entity_id == GREEN_BASE:
return (323, 283, 16)

SPAWN_RECTANGLES = [[(310,337,272,292)], [(140,164,212,234)]]

def get_spawn_location(connection):
if SPAWN_RECTANGLES is not None:
if connection.team is connection.protocol.green_team:
x1, x2, y1, y2 = random.choice(SPAWN_RECTANGLES[0])
elif connection.team is connection.protocol.blue_team:
x1, x2, y1, y2 = random.choice(SPAWN_RECTANGLES[1])
x, y = random.randint(x1,x2), random.randint(y1,y2)
z = connection.protocol.map.get_z(x, y)
if x is not None and y is not None and z is not None:
return ServerConnection.set_location_safe(connection, (x, y, z))
else:
return ServerConnection.get_spawn_location(connection)



I dont know WTF is wrong D:
1 post Page 1 of 1 First unread post
Return to “Help Discussions”

Who is online

Users browsing this forum: No registered users and 8 guests