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/

help meh with coding

Having problems creating a map? Ask around in here.

help meh with coding

Postby Fangedbeast » Sat Aug 11, 2012 8:07 pm

really confused.
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..
VOTE YES FOR A BUDDY SYSTEM AND FIRST PERSON SPECTATION!
http://bit.ly/HoykPd

IGN: FangedBeast@Sw

Stormwind's CTF Server:
aos://483394606:32887

Stormwind's Melee Server:
aos://483394606:32885

Image
Image
Fangedbeast
Member
 
Posts: 101
Joined: Wed Mar 28, 2012 3:59 pm

Re: help meh with coding

Postby PXYC » Sat Aug 11, 2012 8:19 pm

Well it would help if you told us the errors.
Image

<+laserlamp> lil b is my fav
User avatar
PXYC
Local Mod
 
Posts: 1068
Joined: Wed Dec 14, 2011 2:52 am
Location: Near Philadelphia, PA

Re: help meh with coding

Postby Fangedbeast » Sat Aug 11, 2012 11:33 pm

Yeah, i thought you needed that... I was in a rush at the time of posting - ill post results tomorrow but when i open run.exe it flashes the cmd box really fast :/

Also, it's probably coded wrong right? I only want to set the spawns (so far)
VOTE YES FOR A BUDDY SYSTEM AND FIRST PERSON SPECTATION!
http://bit.ly/HoykPd

IGN: FangedBeast@Sw

Stormwind's CTF Server:
aos://483394606:32887

Stormwind's Melee Server:
aos://483394606:32885

Image
Image
Fangedbeast
Member
 
Posts: 101
Joined: Wed Mar 28, 2012 3:59 pm

Re: help meh with coding

Postby PXYC » Sun Aug 12, 2012 2:01 am

You have to open run.bat if you want to see the errors.
Image

<+laserlamp> lil b is my fav
User avatar
PXYC
Local Mod
 
Posts: 1068
Joined: Wed Dec 14, 2011 2:52 am
Location: Near Philadelphia, PA

Re: help meh with coding

Postby Fangedbeast » Sun Aug 12, 2012 11:25 am

oh right...


Code: Select all
c:/users/(censored)/desktop/dist/run.exe
traceback:
file "run.py" line 33 in module
file "json\__init.pyo", line 278, in load
file "json\__init.pyo",  line 326, in load
file "json\decoder.pyo", line 366, in decode
file "json\decoder.pyo", line 328, in raw_decode
value error: expecting , delimiter: line 17 column 9 (char 703)


it's either the hex.txt file i tried to script or it's my config right?

but the hex.txt is wrong aswell because i tried to do /map hex + /advance and it gave me an error on the cmd


Code: Select all
!2012-08-12 11:22:41+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: Non-ASCII character '\xff' in file ./maps\hex.tx
t on line 1, but no encoding declared; see http://www.python.org/peps/pep-0263.h
tml for details (hex.txt, line 1)

VOTE YES FOR A BUDDY SYSTEM AND FIRST PERSON SPECTATION!
http://bit.ly/HoykPd

IGN: FangedBeast@Sw

Stormwind's CTF Server:
aos://483394606:32887

Stormwind's Melee Server:
aos://483394606:32885

Image
Image
Fangedbeast
Member
 
Posts: 101
Joined: Wed Mar 28, 2012 3:59 pm

Re: help meh with coding

Postby Fangedbeast » Sun Aug 12, 2012 11:54 am

i think i've fixed the problem with the config.txt - i think i added stuff to the MOTD...

now i think all the problems left is with the hex.txt
VOTE YES FOR A BUDDY SYSTEM AND FIRST PERSON SPECTATION!
http://bit.ly/HoykPd

IGN: FangedBeast@Sw

Stormwind's CTF Server:
aos://483394606:32887

Stormwind's Melee Server:
aos://483394606:32885

Image
Image
Fangedbeast
Member
 
Posts: 101
Joined: Wed Mar 28, 2012 3:59 pm

Re: help meh with coding

Postby colorpinpoint » Sun Aug 12, 2012 5:03 pm

Can you post the hex.txt file.
Image
Image
IGN:Colorpinpoint
Ki11aWi11 Server Thread
First Map:Here
User avatar
colorpinpoint
Member
 
Posts: 451
Joined: Thu Apr 05, 2012 11:22 pm

Re: help meh with coding

Postby Fangedbeast » Sun Aug 12, 2012 5:18 pm

colorpinpoint wrote:Can you post the hex.txt file.

it's at the top..
VOTE YES FOR A BUDDY SYSTEM AND FIRST PERSON SPECTATION!
http://bit.ly/HoykPd

IGN: FangedBeast@Sw

Stormwind's CTF Server:
aos://483394606:32887

Stormwind's Melee Server:
aos://483394606:32885

Image
Image
Fangedbeast
Member
 
Posts: 101
Joined: Wed Mar 28, 2012 3:59 pm

Re: help meh with coding

Postby PXYC » Sun Aug 12, 2012 10:47 pm

The first problem was with the config, you had forgotten a comma.
Image

<+laserlamp> lil b is my fav
User avatar
PXYC
Local Mod
 
Posts: 1068
Joined: Wed Dec 14, 2011 2:52 am
Location: Near Philadelphia, PA

Re: help meh with coding

Postby Fangedbeast » Mon Aug 13, 2012 10:53 am

PXYC wrote:The first problem was with the config, you had forgotten a comma.

what with the MOTD?

is it meant to be like:

MOTD:
(X),
(Y),
(Z)

?

so can anyone help me with the hex.txt then?
VOTE YES FOR A BUDDY SYSTEM AND FIRST PERSON SPECTATION!
http://bit.ly/HoykPd

IGN: FangedBeast@Sw

Stormwind's CTF Server:
aos://483394606:32887

Stormwind's Melee Server:
aos://483394606:32885

Image
Image
Fangedbeast
Member
 
Posts: 101
Joined: Wed Mar 28, 2012 3:59 pm

Re: help meh with coding

Postby Fangedbeast » Mon Aug 13, 2012 2:40 pm

nvm, joejoe_stinky helped me... all is fine - for now.
VOTE YES FOR A BUDDY SYSTEM AND FIRST PERSON SPECTATION!
http://bit.ly/HoykPd

IGN: FangedBeast@Sw

Stormwind's CTF Server:
aos://483394606:32887

Stormwind's Melee Server:
aos://483394606:32885

Image
Image
Fangedbeast
Member
 
Posts: 101
Joined: Wed Mar 28, 2012 3:59 pm


Return to Mapping Help



Who is online

Users browsing this forum: No registered users and 7 guests

cron