Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 50 51 [52] 53 54 ... 72

Author Topic: The Roguelike Development Megathread  (Read 245594 times)

Rex_Nex

  • Bay Watcher
    • View Profile
Re: The Roguelike Development Megathread
« Reply #765 on: October 17, 2012, 05:26:38 am »

Most tutorials fail to come down to the bottom bottom superbottom base level knowledge - like opening IDLE and hitting 'ctrl-n' to start.  Most tutorials are like "now put this in and run it" and I'm like "put it where?!"
I'm so glad I took basic C++ programming in high school; the class was entirely boring, easy, and slow, but it was really nice to not have to deal with basic tutorials online that fail to explain the little stuff. I haven't really done anything with what I learned, but it's nice to have that in the back of my head and use it as a way to get started.
Logged

Girlinhat

  • Bay Watcher
  • [PREFSTRING:large ears]
    • View Profile
Re: The Roguelike Development Megathread
« Reply #766 on: October 17, 2012, 07:50:24 am »

Flipping tiles/libtcod import didn't help.  I should be on the latest Python, unless it updated like last week, which is... 2.7.3, and libtcod 1.5.1.  The confusing thing is that I can F5 both of them and they run, but when I try to import one into the other then it fails.

dennislp3

  • Bay Watcher
    • View Profile
Re: The Roguelike Development Megathread
« Reply #767 on: October 17, 2012, 02:51:27 pm »

Flipping tiles/libtcod import didn't help.  I should be on the latest Python, unless it updated like last week, which is... 2.7.3, and libtcod 1.5.1.  The confusing thing is that I can F5 both of them and they run, but when I try to import one into the other then it fails.

You using 64bit python or 32 bit? I have heard 64 bit does not like to work well with libtcod. Perhaps that's worth looking into?
Logged

falconne

  • Bay Watcher
    • View Profile
Re: The Roguelike Development Megathread
« Reply #768 on: October 17, 2012, 06:25:54 pm »

I downloaded your files and tried running your main and it worked for me too (well, gave me an SDL error but the imports worked). Have you tried running from the command line as

Code: [Select]
python.exe main.py
If that works, then perhaps it's your IDE doing something weird?

EDIT: I commented out the custom font line and everything ran fine, bringing up your window with the green map on it, so I don't think the code is the issue. Either you may have done an accidental change to your local files after uploading them, or it's the IDE. I don't dabble much in Python but I have done a little and I seem to recall this problem happening if I have a circular dependency in the imports. I can't see how your code can cause that, but maybe try stepping through the debugger from the tiles.grass() line and see if its getting into an import loop for some reason.
« Last Edit: October 17, 2012, 08:16:00 pm by falconne »
Logged
Utility plugins for DFHack, for improving Dwarf Fortress' user interface.

alexandertnt

  • Bay Watcher
  • (map 'list (lambda (post) (+ post awesome)) posts)
    • View Profile
Re: The Roguelike Development Megathread
« Reply #769 on: October 17, 2012, 07:32:30 pm »

Are you trying to run this from within IDLE? When I did that, it just crashed IDLE. Only ran when executing through console. (For reference, I am using 2.6.6 win32, and the VS version of libtcod)

Try what falconne recommended and see what happens.
Logged
This is when I imagine the hilarity which may happen if certain things are glichy. Such as targeting your own body parts to eat.

You eat your own head
YOU HAVE BEEN STRUCK DOWN!

Girlinhat

  • Bay Watcher
  • [PREFSTRING:large ears]
    • View Profile
Re: The Roguelike Development Megathread
« Reply #770 on: October 17, 2012, 08:51:00 pm »

Ok, how would I run it through the console? :v

And yeah, I've got a few things left in that just need to be snipped, like the UTF-8 bit.  I was trying to use unicode but libtcod doesn't play nice with it, so I gave up.

alexandertnt

  • Bay Watcher
  • (map 'list (lambda (post) (+ post awesome)) posts)
    • View Profile
Re: The Roguelike Development Megathread
« Reply #771 on: October 17, 2012, 10:40:32 pm »

Ok, how would I run it through the console? :v

And yeah, I've got a few things left in that just need to be snipped, like the UTF-8 bit.  I was trying to use unicode but libtcod doesn't play nice with it, so I gave up.

Usually, when I am creating something in Python, I place a run.bat or something similar with the lines

Code: [Select]
MyFile.py
pause

So that I can run it in console by just double clicking the bat file. The "pause" statement means if it crashes the console just won't close automatically, allowing me to actually read the error.
Logged
This is when I imagine the hilarity which may happen if certain things are glichy. Such as targeting your own body parts to eat.

You eat your own head
YOU HAVE BEEN STRUCK DOWN!

Girlinhat

  • Bay Watcher
  • [PREFSTRING:large ears]
    • View Profile
Re: The Roguelike Development Megathread
« Reply #772 on: October 17, 2012, 10:41:14 pm »

I don't know how to do a .bat :v

da dwarf lord

  • Bay Watcher
    • View Profile
Re: The Roguelike Development Megathread
« Reply #773 on: October 17, 2012, 10:50:01 pm »

Simplest way is to open notepad, put the text in and save it as a .bat file extension, but remember to change the file type dropdown to all files
Logged

dudims

  • Escaped Lunatic
    • View Profile
Re: The Roguelike Development Megathread
« Reply #774 on: October 17, 2012, 10:52:23 pm »

I don't know how to do a .bat :v
Just create any .txt file (like notepad), write that inside then change the extension by renaming the .txt to .bat

edit: damn ninja'ed
Logged

Girlinhat

  • Bay Watcher
  • [PREFSTRING:large ears]
    • View Profile
Re: The Roguelike Development Megathread
« Reply #775 on: October 18, 2012, 06:44:42 am »

Alright, attempted that, but it gives the same error.  Also it wants to save my file as a "file" with no extension so I have to go in and rename it to .py every time I save, which is rather less convenient than hitting F5.

EDIT: HOKAY this is an irritant...  Apparently when I use IDLE and I save a file, it generates a .py sometimes... and sometimes it just generates a generic file with no extension.  Upon suggestion, I stopped using IDLE, and looked closer.  I had a "tiles" and a "tiles.py" in my folder.  When I saved the file using IDLE, it saved to "tiles" while my main code was trying to import "tiles.py" and "tiles.py" was an older version of the file before I "include libtcod" in it.

Fix: Right click "tiles.py" -> Open with Notepad.  If I'm using a .bat to run the code, then IDLE appears to be buggy and do nothing impressive.
« Last Edit: October 18, 2012, 06:51:46 am by Girlinhat »
Logged

falconne

  • Bay Watcher
    • View Profile
Re: The Roguelike Development Megathread
« Reply #776 on: October 18, 2012, 02:23:52 pm »

Fix: Right click "tiles.py" -> Open with Notepad.  If I'm using a .bat to run the code, then IDLE appears to be buggy and do nothing impressive.

I've used PyCharm before which I've found to be great, but it's not free. You could try PyDev for Eclipse, which I expect is pretty good as well. Both are feature rich IDE's; I've never used IDLE but my understanding was that it's comparatively minimalist.
Logged
Utility plugins for DFHack, for improving Dwarf Fortress' user interface.

Girlinhat

  • Bay Watcher
  • [PREFSTRING:large ears]
    • View Profile
Re: The Roguelike Development Megathread
« Reply #777 on: October 18, 2012, 02:40:05 pm »

From what I can tell, for these purposes, IDLE is Notepad with some colors (that don't always work) and the ability to compile via hotkey.  Notepad does the same thing, except for coloring the words and it doesn't do auto-indent, but that hardly hurts me.  Using a .bat to run it even gives the same error report onto console as IDLE gives on-screen, so nothing lost there.

Otherwise: http://www.bay12forums.com/smf/index.php?topic=117712.msg3706199#msg3706199

Mephansteras

  • Bay Watcher
  • Forger of Civilizations
    • View Profile
Re: The Roguelike Development Megathread
« Reply #778 on: October 18, 2012, 02:46:09 pm »

I'd go with Notepad++, personally.
Logged
Civilization Forge Mod v2.80: Adding in new races, equipment, animals, plants, metals, etc. Now with Alchemy and Libraries! Variety to spice up DF! (For DF 0.34.10)
Come play Mafia with us!
"Let us maintain our chill composure." - Toady One

da dwarf lord

  • Bay Watcher
    • View Profile
Re: The Roguelike Development Megathread
« Reply #779 on: October 18, 2012, 03:57:19 pm »

I personally have never had any problems with IDLE, and the only things I really want in an IDE are syntax colouring and easy compiling, so I'm no help there :D. The only thing is when you first save a file you have to save it with the .py extension, from then on the file will automatically save it as a .py and compile it the right way.
Logged
Pages: 1 ... 50 51 [52] 53 54 ... 72