Chaosforge Forum

General => Off Topic => Topic started by: Aki on October 22, 2013, 03:26

Title: Assistance with Python - for Wiki
Post by: Aki on October 22, 2013, 03:26
So i'm trying to map some of the newer special levels for the wiki and update the older ones.

I'm using the script found here (http://doom.chaosforge.org/wiki/User:Tehtmi/Map_Colorizer) and followed the instructions to the dot.

This is the input that i'm using:

Code: [Select]
map

##############################################################################
####################......................................####################
#############.............=======...................................##########
###########............h.....======.....................h...............######
###...###.......................=====......................................###
##"...##.....g....g...............====......................................##
#.....##...................g..........h.......====#B242424B#====.....h.......#
#.....##.g....................................====#&&##&&&##====.............#
#.....##.......g..................................+....,,^.+.................#
#.>...##...............V......................====#@.,...,,#====..........h..#
#.....##...g.........g.............h..........====#.,,,\,,.#====.............#
#.....##..........................................+...,,.^.+.................#
#.....##g.......g..........g..................====#&&##&&&##====.....h.......#
#.....##...............................h......====.B242424B#====h............#
##"...##..........................====......................................##
###...###.......................=====.....................................####
###########.............h....======....................h...............#######
#############.............=======.................................############
####################......................................####################
##############################################################################

end map

. : floor
, : blood
& : blooded wall
# : stone wall
= : lava
" : agility mod pack
\ : chainsaw
^ : berserk pack
V : arena master
g : former captain
h : former human
B : baron of hell
2 : shotgun shell
4 : power cell

I keep getting this error:

(http://puu.sh/4Woj2/f607e467ff.png)

I have NO idea when it comes to these things, I tried fiddling around a little bit and got nowhere. Can anyone help?
Title: Re: Assistance with Python - for Wiki
Post by: thelaptop on October 22, 2013, 09:12
Use Python 2.7.x instead of Python 3.
Title: Re: Assistance with Python - for Wiki
Post by: Aki on October 22, 2013, 19:24
Thanks for your help.

I received this error after Installing Python 2.7.5 and trying it:

(http://puu.sh/4X0jz/5d4b66a700.png)

So I uninstalled Python 3.3.2 and tried again:

(http://puu.sh/4X0yo/8fedc661d3.png)

I have no idea what's going on here @_@
Title: Re: Assistance with Python - for Wiki
Post by: thelaptop on October 22, 2013, 21:01
Because you added a space on the end of each line of the map representation.  You should not do that.

You should also run the command as:

C:\Python27\Script>C:\python27\python.exe map.py "cc+1.txt" "cc+1color.txt"
If I remember correctly, '+' is significant on Windows and so you need to escape it.

I tried that out, works like a charm.  Here's the outcome... NOT!  You have to get it to work yourself because I'm not going to be running this all the time for you in the future.
Title: Re: Assistance with Python - for Wiki
Post by: Aki on October 22, 2013, 21:12
Tried that, and it still came up with the same error:

(http://puu.sh/4X57b/795d6b4cd1.png)

As for running it myself, i've been fiddling around with it without much success, but neither you nor anyone else are obligated to help, though your help's been much appreciated :>
Title: Re: Assistance with Python - for Wiki
Post by: thelaptop on October 22, 2013, 21:19
I call shenanigans.

sys.argv[1] will give you a list index out of range when you didn't pass the script any command line arguments.  There's no other way in which it will throw up that message.

Check your command line again!
Title: Re: Assistance with Python - for Wiki
Post by: MaiZure on October 22, 2013, 23:32
This could REALLY be more effective on IRC...
Title: Re: Assistance with Python - for Wiki
Post by: Aki on October 23, 2013, 00:53
Managed to get it to work, so closing. Thanks everyone!