Not logged inGosu Forums
Forum back to Help Search Register Login
Up Topic Gosu / Gosu Exchange / Probleme with Ruby Interpreter when load an Image
- - By grifdail Date 2011-07-16 23:43

I am a beginner with ruby and gosu
I got a problem since a few day.
All was fine untill  I try a new map without touching the code
Now I sometime got that kind of error for variouse thing

it says that "Ruby interpretor has stopped working"

I managed to find the buged line and it was a very simple like that:

@fond =$window, "Graphique/Game Over.png", true)

I can't find why does that error come but it very irritating

Sorry for my bad english : As you have saw I 'm french and english it not my language
Parent - - By jlnr (dev) Date 2011-07-17 18:03
Does it always happen in this line? Are you playing sound effects too?
Parent - By grifdail Date 2011-07-17 19:34 Edited 2011-07-17 19:39
It not always that line but it always a
When I try, for testing, to delete this line, the bug happen at the next image load but some Image already have been load (and draw) before.
I think it may be because i have too many Image loaded!

I dont play sound effect for now.
Parent - - By RavensKrag Date 2011-07-17 20:17
Are you getting any error messages printed to the console?

If you are using ruby 1.9, then it could be that your filepath is "Graphique/Game Over.png" instead of "./Graphique/Game Over.png".  Notice the "./" in front.  I believe I had a similar problem when I switched from 1.8 to 1.9.
Parent - - By grifdail Date 2011-07-17 20:32
No: absolutly no error message in the console. It the reason why i have decide to post here!
I also had to use "special trick" to find the buged line

I try your advice but it dont work anymore!
Parent - - By RavensKrag Date 2011-07-17 20:43
I had assumed as much, just checking ^_^;

What directory are you running the game from? I had assumed you were in the base directory for your project.  By "not working" do you mean it fails to execute at all? Perhaps you are in the wrong directory then.

If you put the following line at the top of your main file, your program should run in the correct directory.
Dir.chdir File.dirname(__FILE__)
Parent - - By grifdail Date 2011-07-18 18:57
I think it not a directorie probleme: Some Image, located in the same directorie are loaded without probleme!
Parent - By RavensKrag Date 2011-07-18 18:58
Ah, sorry about that then.  Hopefully you'll get your problem solved.
Parent - - By jlnr (dev) Date 2011-07-18 17:58
Hmmmm, you can try to use Gosu 0.7.29 (gem uninstall gosu, gem install gosu -v 0.7.29). Gosu 0.7.30 started to use a different image library. If the problem goes away, it is really an issue with the image loading.
Parent - - By grifdail Date 2011-07-18 18:55
It dont work: it apparently not a loading issue
I also forget to precise an importante thing: I Use texplay (but for only for the get_pixel methode)
Parent - - By lol_o2 Date 2011-07-18 19:26
I also had such issue with TexPlay, but not with get_pixel. Maybe try to disable it to check if it's the problem?
Parent - By grifdail Date 2011-07-18 19:36
If I disable it nothing wont work because I use it for my map systeme! (The map is a litle image that a few line of code converte to a level)
My game can't work without it
Parent - By jlnr (dev) Date 2011-07-19 10:39
Can you show us that part of the code? Is it possible that you don't keep a reference to the Gosu::Image, so it will be garbage-collected while TexPlay still references it?
- By grifdail Date 2011-07-21 10:50
Sorry for haven responde since your message. But I have tryed to rewrite my code for it to dont need texplay! (I am that that my last phrase is correct)
But i have minort erore not related to gosu that i have to fix first.
So i wont be able to tell you if the "texplay-less" version work, before!

I will update this message when as soon i can!
Up Topic Gosu / Gosu Exchange / Probleme with Ruby Interpreter when load an Image

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill