Note: This forum is merely an archive. It is no longer possible to register or post. - StackOverflow
New Ace of Spades Forums: http://buildandshoot.com/

Spawn Location

For all bug reports and game-related issues

Spawn Location

Postby LinktersHD » Sun Jul 01, 2012 1:02 pm

I need help with Spawn locations.
I want some one to make the Blue team spawn in 263,187,59 and have their intel and base in 263,187,59
For Green i want them to spawn in 265,317,59 and have their intel and base in 265,317,59
Thanks.
Can you just send me the code for it.

Here is the code and it doesnt work:
Code: Select all
name = 'Nuketown'
version = '1.0'
author = 'LinktersHD'
description = 'Remake of the Call of Duty map Nuketown'

# scripting

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

def get_entity_location(team, entity_id):
    if entity_id == BLUE_FLAG:
        return (263,187,59)
     
    if entity_id == BLUE_BASE:
        return (263,187,59)
     
    if entity_id == GREEN_FLAG:
        return (265,317,59)

    if entity_id == GREEN_BASE:
        return (265,317,59)

def get_spawn_location(connection):
 
    if connection.team is connection.protocol.blue_team:
        x, y, z = ServerConnection.get_spawn_location(connection)
        return ServerConnection.(connection, (263,187,59))   

    if connection.team is connection.protocol.green_team:
        x, y, z = ServerConnection.get_spawn_location(connection)
        return ServerConnection.(connection, (265,317,59))


This is the error:
Code: Select all
2012-07-01 13:10:21+0100 [-] Unhandled Error
        Traceback (most recent call last):
          File "run.py", line 1027, in <module>

          File "twisted\internet\base.pyo", line 1169, in run

          File "twisted\internet\base.pyo", line 1178, in mainLoop

        --- <exception caught here> ---
          File "twisted\internet\base.pyo", line 800, in runUntilCurrent

          File "run.py", line 728, in set_map_name

          File "run.py", line 741, in get_map

          File "map.pyo", line 43, in __init__

          File "map.pyo", line 58, in load_information

        exceptions.SyntaxError: invalid syntax (nuketown.txt, line 28)
Nuketown map is out!:
viewtopic.php?f=67&t=11021]

Image
Image
User avatar
LinktersHD
Member
 
Posts: 1356
Joined: Fri Mar 30, 2012 2:41 pm
Location: Reigate, England

Re: Spawn Location

Postby topologist » Sun Jul 01, 2012 2:53 pm

Code: Select all
def get_spawn_location(connection):
  if connection.team is connection.protocol.blue_team:
    return 263, 187, 59
  elif connection.team is connection.protocol.green_team:
    return 265, 317, 59
  return connection.team.last_spawn.get_spawn_location()
REDACTED
topologist
[SPQR] Member
 
Posts: 216
Joined: Sun Dec 11, 2011 9:58 am
Location: boop


Return to Game help



Who is online

Users browsing this forum: No registered users and 3 guests

cron