Help needed

3 posts Page 1 of 1 First unread post
Monster_M3
Deuce
Posts: 18
Joined: Wed Apr 16, 2014 1:09 pm


How do I allocate spawn locations on voxed?
Jdrew
Mapper
Mapper
Posts: 4808
Joined: Tue Oct 30, 2012 10:48 pm


Impossible. Voxed is just an editor you would need to do it via a script and map extensions.
izzy
Head Admin / Co-founder
Head Admin / Co-founder
Posts: 474
Joined: Tue Oct 09, 2012 8:16 pm


The easiest way is to use the CTF POINTS script along with its map extensions in your map's mapname.txt file.

It's also possible to script spawn locations directly in the mapname.txt file itself. Here's an example from the Firestorm map:
Code: Select all
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)
3 posts Page 1 of 1 First unread post
Return to “Help Discussions”

Who is online

Users browsing this forum: No registered users and 3 guests