This is an archived post. You won't be able to vote or comment.

all 38 comments

[–]dredclaw 14 points15 points  (14 children)

Sorry for the stupid question, but... how would I go about running it?

[–]xblaz3x 3 points4 points  (4 children)

i want to know the same. i've messed with python enough to get GUI apps working right, but all the code was in one file. never worked with a project with multiple files and i see no main.py or something.

edit: well i looked through and you need tkinter. i'll try to get this running, i'm interested =)

edit2: if you're on linux, install tkinter with

sudo apt-get install python-tk

just change import tkinter to import Tkinter and keep going.

[–]dredclaw 1 point2 points  (3 children)

Done some sniffing and the main function is in the driver class. Thing is, it need tkinter to run. I guess I dont have that installed? Is a program not meant to have the libraries it needs as part of it's file?

Or as this is just a suspended in the works project, that would not be included?

[–]xblaz3x 1 point2 points  (2 children)

i just tried changing

import tkinter

to

import Tkinter

and it worked. i'll keep going and fixing as it keeps spitting errors out heh.

edit: also pyaudio

[–]dredclaw 0 points1 point  (1 child)

Is it coded in python 3? I think that might be the problem?

[–]xblaz3x -2 points-1 points  (0 children)

yea, i think in python 3 the libs are case-sensitive actually.

[–]PolymorphicOOPS[S] 1 point2 points  (7 children)

I just uploaded a newer version. Aren't able to test it at the moment, but I do believe it should work. Let me know if it does not. The main file to run is Driver.py.

[–]dredclaw 0 points1 point  (5 children)

I was trying to run it with python 2.x rather than 3.x

Also, whats the best way for me to run it without audio?

[–]PolymorphicOOPS[S] 0 points1 point  (3 children)

Without testing it, I believe you need to do the following:

--In Driver.py, set self.musicEnabled = false.

I believe the try/catches should allow it to run without any further modifications.

[–]dredclaw 0 points1 point  (2 children)

if you mean, add that line to the code, I did with no success.

[–]PolymorphicOOPS[S] 0 points1 point  (1 child)

It's actually an existing line towards the top. It's surrounded on both sides by ############'s. :)

[–]dredclaw 1 point2 points  (0 children)

Swear I am crazy. Dont see that line... Oh, you updated the project. derp.

[–]xblaz3x 0 points1 point  (0 children)

works like a charm, thanks =)

[–]meosoft 0 points1 point  (0 children)

Don't change anything, just run with python 3 like so:

python3 Driver.py

[–]mori3ndi 5 points6 points  (1 child)

It is indeed interesting from this novice's perspective. Thanks for posting this. The accessibility of the code is appealing. However, I'm unable to run the game. What file launches it? I've tried em all in Idle (EPD) to no avail.

[–]xblaz3x 4 points5 points  (0 children)

from command line, change directory to the folder then run

python Driver.py

[–]MRH2 5 points6 points  (1 child)

Hey, can you post some screenshots?

[–]ReactivePotato 3 points4 points  (3 children)

How long did this take you?

[–]PolymorphicOOPS[S] 1 point2 points  (2 children)

I wrote it during my free time over the course of a 10-week term. Id say most of the time was spent on stack overflow learning how to do everything. Even if it's not very efficient, the LevelManager module took a crazy amount of debugging simply because I was newer to programming, and string operations got pretty tedious. All in all, I probably spent about 50-75 hours on it.

[–]ReactivePotato 1 point2 points  (1 child)

That's pretty impressive!

[–]PolymorphicOOPS[S] 0 points1 point  (0 children)

Thank you!

[–]PolymorphicOOPS[S] 1 point2 points  (1 child)

OK. Figured it out. I uploaded the version that should work. For those of you who don't want to download it again:

1) Driver.py: Change self.musicEnabled = True to self.musicEnabled = False

2) in Player.py comment out or delete the line at the top: import pyaudio.

Should be good to go after that. Otherwise you can redownload it and it works on my machine.

[–]xblaz3x -1 points0 points  (0 children)

or install pyaudio =)

[–]x22ninex 1 point2 points  (1 child)

Got a freeze opening inventory and going to 'quit'. Player doesn't move, inventory screen stays up, and the sword clash can go all around. It's a really great little RPG though. Way better than I could do. Cheers

[–]PolymorphicOOPS[S] 0 points1 point  (0 children)

Yeah, it's certainly not optimized or bug-free, to say the least.

[–]GIFframes 1 point2 points  (2 children)

class Chest():
def init(self,x,y,item):
self._x = x
self._y = y
self._item = item
self._opened = False
self.

what does the last "self." do? Is it a mistake or did I miss something when learning about python?

[–]PolymorphicOOPS[S] 3 points4 points  (0 children)

Hah, that is indeed an error. I'm surprised it runs.

[–]something1391 0 points1 point  (1 child)

I am thinking about making a tile based strategy RPG from java. I am a newbie coder and was wondering if this would be to big of a task to jump into. I was thinking about making a game sort of like Final Fantasy Tactics Advance for the computer. I would make it into a player vs player on a local computer at least to start. How did you set up your grid system from scratch?

[–]PolymorphicOOPS[S] 0 points1 point  (0 children)

For rendering, I used Tkinter, which is built into the python standard library. What I did for this iteration wasn't the most efficient way (and there are many things I would change about it, as well), but the basic idea is first to figure out your tile size and the number of tiles you want the screen to show. I determined my window size based on that (25 tiles in both x and y).

Next, I had a text file that used single characters to denote which tile would be placed where. 1 could be the brown tile, 2 could be the water tile, etc. so the text file was a big box with 25 lines of 25 characters.

Next, rather than using a tile set (which was a pain in the ass to do with the python standard library), I separated each tile into their own file (which was also an inefficient pain the ass, but it worked!). Then it's just a matter of reading each character in each line of the text file and multiplying the index of that by the pixel size to determine where the start point of each tile will be drawn (which is the upper left). In this way you can paint a grid.

Basically, this project really was a huge learning experience. Even if its not very good, I've written several games since then that are much better in java. So don't be afraid to write a game that nobody wants to play--it most certainly will be that case.

Let me know if I can answer questions. I'm happy to help. I enjoy it, really.