Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2

Author Topic: 2D mode "Display not found" (another linux issue) - solved, ty!  (Read 3095 times)

Toxicshadow

  • Bay Watcher
    • View Profile
    • github
2D mode "Display not found" (another linux issue) - solved, ty!
« on: February 04, 2021, 09:26:01 pm »

I can't run text mode because it gives me a buffer overflow in a certain scenario. I can run DF in 2D if I run it as a regular, non-admin user, however then DF doesn't have permissions to write files. I don't use sudo I just switch to root with su -, but trying to run DF as the root user gives me "Display not found and PRINT_MODE not set to TEXT, aborting." This wouldn't be an issue if I was content playing the game in the terminal but the buffer overflow bug breaks the game. So either how do I give DF the appropriate permissions to write files as a regular user, or how do I un-fuck 2D mode as root?

I seriously searched this time so if the answer is simple I'm sorry :l but I read through a bunch of threads and searched as thoroughly as I could.
« Last Edit: February 04, 2021, 11:06:56 pm by Toxicshadow »
Logged
Quote
'ere the Chias get hungry...

Maximum Spin

  • Bay Watcher
  • [OPPOSED_TO_LIFE] [GOES_TO_ELEVEN]
    • View Profile
Re: 2D mode "Display not found" (another linux issue)
« Reply #1 on: February 04, 2021, 09:36:21 pm »

I can't run text mode because it gives me a buffer overflow in a certain scenario. I can run DF in 2D if I run it as a regular, non-admin user, however then DF doesn't have permissions to write files. I don't use sudo I just switch to root with su -, but trying to run DF as the root user gives me "Display not found and PRINT_MODE not set to TEXT, aborting." This wouldn't be an issue if I was content playing the game in the terminal but the buffer overflow bug breaks the game. So either how do I give DF the appropriate permissions to write files as a regular user, or how do I un-fuck 2D mode as root?

I seriously searched this time so if the answer is simple I'm sorry :l but I read through a bunch of threads and searched as thoroughly as I could.
You shouldn't have to run DF as root in any conceivable scenario. Do you have permission to write files in the game's folder?
Logged

Toxicshadow

  • Bay Watcher
    • View Profile
    • github
Re: 2D mode "Display not found" (another linux issue)
« Reply #2 on: February 04, 2021, 09:45:02 pm »

I can't run text mode because it gives me a buffer overflow in a certain scenario. I can run DF in 2D if I run it as a regular, non-admin user, however then DF doesn't have permissions to write files. I don't use sudo I just switch to root with su -, but trying to run DF as the root user gives me "Display not found and PRINT_MODE not set to TEXT, aborting." This wouldn't be an issue if I was content playing the game in the terminal but the buffer overflow bug breaks the game. So either how do I give DF the appropriate permissions to write files as a regular user, or how do I un-fuck 2D mode as root?

I seriously searched this time so if the answer is simple I'm sorry :l but I read through a bunch of threads and searched as thoroughly as I could.
You shouldn't have to run DF as root in any conceivable scenario. Do you have permission to write files in the game's folder?
Code: [Select]
melody@melody-pc:~/df4705$ echo 'test write' >foo.txt
melody@melody-pc:~/df4705$ dir
foo.txt
^ leads me to assume I do have permission. Creating a new world does not save anything and I get permission denied:
Code: [Select]
melody@melody-pc:~/df4705$ ./df
Sound devices available:
OpenAL Soft
Picking OpenAL Soft. If your desired device was missing, make sure you have the appropriate 32-bit libraries installed. If you wanted a different device, configure ~/.openalrc appropriately.
Perfect OpenAL context attributes GET
Loading bindings from data/init/interface.txt
New window size: 1920x1080
Font size: 16x16
Resizing grid to 120x67
Resizing font to 16x16

Resetting textures
Resetting textures
mkdir(data/save/region1) failed: Permission denied
mkdir(data/save/region1/raw) failed: No such file or directory
mkdir(data/save/region1/raw/graphics) failed: No such file or directory
mkdir(data/save/region1/raw/interaction examples) failed: No such file or directory
mkdir(data/save/region1/raw/objects) failed: No such file or directory
mkdir(data/save/region1/raw/graphics/example) failed: No such file or directory
mkdir(data/save/region1/raw/objects/examples and notes) failed: No such file or directory
mkdir(data/save/region1/raw/objects/text) failed: No such file or directory
mkdir(data/save/region1/raw/objects/vanilla raws) failed: No such file or directory
Logged
Quote
'ere the Chias get hungry...

Maximum Spin

  • Bay Watcher
  • [OPPOSED_TO_LIFE] [GOES_TO_ELEVEN]
    • View Profile
Re: 2D mode "Display not found" (another linux issue)
« Reply #3 on: February 04, 2021, 09:51:21 pm »

You really should specifically check whether you can mkdir (df)/data/save/region1, since that's where the problem is.

The /data/save folder may have come out of the archive with the wrong permissions set.
Logged

Toxicshadow

  • Bay Watcher
    • View Profile
    • github
Re: 2D mode "Display not found" (another linux issue)
« Reply #4 on: February 04, 2021, 10:04:49 pm »

You really should specifically check whether you can mkdir (df)/data/save/region1, since that's where the problem is.

The /data/save folder may have come out of the archive with the wrong permissions set.
going into /data/save and trying mkdir does give me a permission error! I didn't think to check the permissions of the folders themselves. In all honesty, permissions is something I've neglected to really read about and have been avoiding messing with. I went in as root and used chmod +rwx on 'save' and then went back to my own user, and still don't have permission. I guess it's my fault for not taking the time yet to read about this stuff, but do you know how I can change the permissions, and what they need to be set to?
Logged
Quote
'ere the Chias get hungry...

Maximum Spin

  • Bay Watcher
  • [OPPOSED_TO_LIFE] [GOES_TO_ELEVEN]
    • View Profile
Re: 2D mode "Display not found" (another linux issue)
« Reply #5 on: February 04, 2021, 10:16:08 pm »

going into /data/save and trying mkdir does give me a permission error! I didn't think to check the permissions of the folders themselves. In all honesty, permissions is something I've neglected to really read about and have been avoiding messing with. I went in as root and used chmod +rwx on 'save' and then went back to my own user, and still don't have permission. I guess it's my fault for not taking the time yet to read about this stuff, but do you know how I can change the permissions, and what they need to be set to?
Most likely, you want to chown it to your user. Probably good to do on the whole df folder recursively.

ET be more helpful: That is, 'sudo chown -R melody ~/df4705' based on the information you've given.
« Last Edit: February 04, 2021, 10:19:04 pm by Maximum Spin »
Logged

Toxicshadow

  • Bay Watcher
    • View Profile
    • github
Re: 2D mode "Display not found" (another linux issue)
« Reply #6 on: February 04, 2021, 10:28:59 pm »

going into /data/save and trying mkdir does give me a permission error! I didn't think to check the permissions of the folders themselves. In all honesty, permissions is something I've neglected to really read about and have been avoiding messing with. I went in as root and used chmod +rwx on 'save' and then went back to my own user, and still don't have permission. I guess it's my fault for not taking the time yet to read about this stuff, but do you know how I can change the permissions, and what they need to be set to?
Most likely, you want to chown it to your user. Probably good to do on the whole df folder recursively.

ET be more helpful: That is, 'sudo chown -R melody ~/df4705' based on the information you've given.
Nice, chown is the trick. Interestingly enough, the display error came back.
Code: [Select]
melody@melody-pc:~/df4705/data/save$ mkdir region1
melody@melody-pc:~/df4705/data/save$ dir
current  region1

melody@melody-pc:~/df4705$ ./df
Display not found and PRINT_MODE not set to TEXT, aborting.
For some background, here's some of my init, incase I messed up there. I am trying to run it in 2D, and would not like to run it in text mode. windowed or not windowed doesn't make a difference, the error still occurs.
Code: [Select]
[GRAPHICS:YES]
[GRAPHICS_WINDOWEDX:0]
[GRAPHICS_WINDOWEDY:0]
[GRAPHICS_FONT:curses_square_16x16.png]
[GRAPHICS_FULLSCREENX:0]
[GRAPHICS_FULLSCREENY:0]
[GRAPHICS_FULLFONT:curses_square_16x16.png]
[GRAPHICS_BLACK_SPACE:YES]

[PRINT_MODE:2D]
Logged
Quote
'ere the Chias get hungry...

Starver

  • Bay Watcher
    • View Profile
Re: 2D mode "Display not found" (another linux issue)
« Reply #7 on: February 04, 2021, 10:36:13 pm »

Ninjaed - after I put the chown aside.

Did you just chmod +rwx for root? (Or a different owner, if it wasn't that. I'd suggest chowning it if that's odd, but not as 1ia.)

If so, then once you're back as you again, it's likely unchanged.  You should[1] be able to do a full +rwxrwxrwx (or a+rwx, or just 777 it) and make it wide open, assuming it is allowed to be for other random reasons I can't rule out. Though always use it with caution/understanding. Better to manage it correctly, but in this case...


Giving you this anyway, though it looks like the problem has gone from the "have access to the df directory". External resource directory? But that wouldn't be a true problem for your suing, so maybe a dependency install failure??

[1] I'm making assumptions here.
Logged

Maximum Spin

  • Bay Watcher
  • [OPPOSED_TO_LIFE] [GOES_TO_ELEVEN]
    • View Profile
Re: 2D mode "Display not found" (another linux issue)
« Reply #8 on: February 04, 2021, 10:37:31 pm »

Nice, chown is the trick. Interestingly enough, the display error came back.
It's fair to say that you have now exceeded the domain of my expertise, but just in case you haven't, do me a favor and 'echo $DISPLAY'?
Logged

Toxicshadow

  • Bay Watcher
    • View Profile
    • github
Re: 2D mode "Display not found" (another linux issue)
« Reply #9 on: February 04, 2021, 10:39:40 pm »

-snip-
Giving you this anyway, though it looks like the problem has gone from the "have access to the df directory". External resource directory? But that wouldn't be a true problem for your suing, so maybe a dependency install failure??

[1] I'm making assumptions here.
It could be a dependency error, but I've checked so many times that I have all the dependencies, so I'm not sure.
Nice, chown is the trick. Interestingly enough, the display error came back.
It's fair to say that you have now exceeded the domain of my expertise, but just in case you haven't, do me a favor and 'echo $DISPLAY'?
Just gives me a blank line. It does output, just a blank line.
Logged
Quote
'ere the Chias get hungry...

Maximum Spin

  • Bay Watcher
  • [OPPOSED_TO_LIFE] [GOES_TO_ELEVEN]
    • View Profile
Re: 2D mode "Display not found" (another linux issue)
« Reply #10 on: February 04, 2021, 10:42:14 pm »

Nice, chown is the trick. Interestingly enough, the display error came back.
It's fair to say that you have now exceeded the domain of my expertise, but just in case you haven't, do me a favor and 'echo $DISPLAY'?
Just gives me a blank line. It does output, just a blank line.
Because I've learned not to assume things, you do actually have X running, right? Your terminal is not in fact in text mode?
Logged

Toxicshadow

  • Bay Watcher
    • View Profile
    • github
Re: 2D mode "Display not found" (another linux issue)
« Reply #11 on: February 04, 2021, 10:47:13 pm »

Nice, chown is the trick. Interestingly enough, the display error came back.
It's fair to say that you have now exceeded the domain of my expertise, but just in case you haven't, do me a favor and 'echo $DISPLAY'?
Just gives me a blank line. It does output, just a blank line.
Because I've learned not to assume things, you do actually have X running, right? Your terminal is not in fact in text mode?
you really are making me feel like an idiot right now. My terminal is infact in text mode but I'm pretty sure X is running? I mean my desktop environment is running, I would think that would include the window manager right? Sorry I'm an idiot but I guess it's time to get learnt today :P
yeah going into the console (as su -) and typing X tells me it's already running.
Logged
Quote
'ere the Chias get hungry...

Ziusudra

  • Bay Watcher
    • View Profile
Re: 2D mode "Display not found" (another linux issue)
« Reply #12 on: February 04, 2021, 10:48:25 pm »

Which distribution of Linux are you using?
Logged
Ironblood didn't use an axe because he needed it. He used it to be kind. And right now he wasn't being kind.

Maximum Spin

  • Bay Watcher
  • [OPPOSED_TO_LIFE] [GOES_TO_ELEVEN]
    • View Profile
Re: 2D mode "Display not found" (another linux issue)
« Reply #13 on: February 04, 2021, 10:50:38 pm »

you really are making me feel like an idiot right now. My terminal is infact in text mode but I'm pretty sure X is running? I mean my desktop environment is running, I would think that would include the window manager right? Sorry I'm an idiot but I guess it's time to get learnt today :P
yeah going into the console (as su -) and typing X tells me it's already running.
Mooooost likely you can just do 'DISPLAY=:0' to set DISPLAY to the most likely correct value, then try running DF, and it should pick up X properly. It's possible that 0 isn't the right screen or whatever the X word for it is, or that you need to set it differently some other way, but it's almost always :0.

BTW, if you use some flavour of xterm (probably one comes with your desktop environment) it should be configured to have this value set automatically.
« Last Edit: February 04, 2021, 10:53:56 pm by Maximum Spin »
Logged

Toxicshadow

  • Bay Watcher
    • View Profile
    • github
Re: 2D mode "Display not found" (another linux issue)
« Reply #14 on: February 04, 2021, 10:57:41 pm »

Which distribution of Linux are you using?
debian + kde. I tried xubuntu for a while and found it to be just alright, so I wanted to try somethin' else this time.
you really are making me feel like an idiot right now. My terminal is infact in text mode but I'm pretty sure X is running? I mean my desktop environment is running, I would think that would include the window manager right? Sorry I'm an idiot but I guess it's time to get learnt today :P
yeah going into the console (as su -) and typing X tells me it's already running.
Mooooost likely you can just do 'DISPLAY=:0' to set DISPLAY to the most likely correct value, then try running DF, and it should pick up X properly. It's possible that 0 isn't the right screen or whatever the X word for it is, or that you need to set it differently some other way, but it's almost always :0.

BTW, if you use some flavour of xterm (probably one comes with your desktop environment) it should be configured to have this value set automatically.
Hmm, well trying DISPLAY=:0 through =:4 didn't work, but running it through xterm instead of "konsole" (lol) worked fine, AND the write problem was solved. So note going forward, don't bother with kde's terminal lol.
Logged
Quote
'ere the Chias get hungry...
Pages: [1] 2