Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 10 11 [12] 13 14 ... 17

Author Topic: Dwarf Fortress for the BLind: Advice sought  (Read 56435 times)

zkline

  • Bay Watcher
    • View Profile
Re: Dwarf Fortress for the BLind: Advice sought
« Reply #165 on: April 16, 2016, 12:59:40 pm »

Dirst, this seems to work very well on first inspection. I've only managed to test on the mac so far, because I don't have DFHack for my Linux install yet. But I was able to bookmark my wagon and successfully explore a bit, and zoom back to the bookmark again.

Thanks for writing these scripts. If I run into anything weird I'll let you know. For the record, I figured "raw," meant "the dfHack installation directory." :)
Logged

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: Dwarf Fortress for the BLind: Advice sought
« Reply #166 on: April 16, 2016, 01:41:33 pm »

That works, too.  The "scripts" subfolder under "raw" is supposed to be for mod-specific scripts, and gets copied to your save folder.  It is earlier in the search path than the main DFHack scripts folder, but other than that it doesn't really make a difference.

I did get some pointers on reading the map size, so hopefully a new version won't require that calibration step.
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

LordPorkins

  • Bay Watcher
  • Unrelated to DukePorkins
    • View Profile
Re: Dwarf Fortress for the BLind: Advice sought
« Reply #167 on: April 16, 2016, 08:39:35 pm »

.... I think the previous 4 posts were in english.
I think....

Thats about all i got from reading that.
Logged
Ïlul Thuveg-Ellest
Rete Sano-Pima
Tormuk Dul-Orax
Kar Pum-Sisha

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: Dwarf Fortress for the BLind: Advice sought
« Reply #168 on: April 16, 2016, 09:00:32 pm »

There were some English words in there.
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

TheBiggerFish

  • Bay Watcher
  • Somewhere around here.
    • View Profile
Re: Dwarf Fortress for the BLind: Advice sought
« Reply #169 on: April 16, 2016, 10:30:57 pm »

S'just Lua, guys, it's not Cthulhu.

(Note:I do not actually know Lua, I may be wrong about its eldritchness.)
Logged
Sigtext

It has been determined that Trump is an average unladen swallow travelling northbound at his maximum sustainable speed of -3 Obama-cubits per second in the middle of a class 3 hurricane.

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: Dwarf Fortress for the BLind: Advice sought
« Reply #170 on: April 17, 2016, 01:08:48 am »

Here is some more of that CthuLua stuff.  This version dispenses with the calibration step thanks to lethosor's help.  It also reports the Z level as it shows on the screen instead of the internal offset, and now does sanity checks on your goto coordinates.

Unfortunately, fixing the Z broke compatibility with bookmarks from the previous version.  Hopefully those were only used in test forts.

Code: (bookmark.lua) [Select]
-- bookmark script v1.01
-- Set and clears persistent bookmarks on the fort map.
-- Enter "bookmark help" for a list of reserved names.
-- Version 1.01 removes the need for the "calibrate" step and harmonizes reported Z with screen display.

local args = {...}

local bookmarks = dfhack.persistent.get_all("BOOKMARK",true)

if args[1] == "help" then
print([[bookmark.lua
Enter "bookmark foo" to create a bookmark named "foo" at the current location.
Any one-word string may be used except the following reserved words:
"bookmark help" prints this command summary.
"bookmark list" prints a list of existing bookmarks.
"bookmark drop foo" erases the bookmark named "foo".
"bookmark clear all" erases all current bookmarks, note the space between "clear" and "all".
]])

elseif args[1] == "list" then
if bookmarks then
for _, bookmark in ipairs(bookmarks) do
print(bookmark.value .. ":  " .. bookmark.ints[1] .. "  " .. bookmark.ints[2] .. "  " .. bookmark.ints[3])
end
else
print("No bookmarks defined.")
end

elseif args[1] == "clear" and args[2] == "all" then
if bookmarks then
local count = #bookmarks
for _, bookmark in ipairs(bookmarks) do
bookmark:delete()
end
print("Deleted " .. count .. " bookmarks.")
else
print("No bookmarks are defined, so no action taken.")
end

elseif args[1] == "drop" and args[2] then
if bookmarks then
local del = false
for _, bookmark in ipairs(bookmarks) do
if bookmark.value == args[2] then
bookmark:delete()
print("Bookmark " .. args[2] .. " deleted.")
del = true
end
end
if del == false then print("Bookmark " .. args[2] .. " not defined, so no action taken.") end
else
print("No bookmarks are defined, so no action taken.")
end

elseif args[1] and not args[2] then
local pos = {}
pos = copyall(df.global.cursor)
pos.z = pos.z + df.global.world.map.region_z
local make_new = true
if pos.x == -30000 then
name = "Center:"
dm = require('gui.dwarfmode')
pos["x"] = df.global.window_x + math.floor(dm.getPanelLayout().map.width / 2)
pos["y"] = df.global.window_y + math.floor(dm.getPanelLayout().map.height / 2)
pos["z"] = df.global.window_z + df.global.world.map.region_z
end
if bookmarks then
for _, bookmark in ipairs(bookmarks) do
if bookmark.value == args[1] then
bookmark.ints[1] = pos.x
bookmark.ints[2] = pos.y
bookmark.ints[3] = pos.z
bookmark:save()
print("Bookmark " .. args[1] .. " updated.")
make_new = false
end
end
if make_new == true then
dfhack.persistent.save({key="BOOKMARK/"..args[1],value=args[1],ints={pos.x,pos.y,pos.z}})
print("Bookmark " .. args[1] .. " created.")
end
else
dfhack.persistent.save({key="BOOKMARK/"..args[1],value=args[1],ints={pos.x,pos.y,pos.z}})
print("Bookmark " .. args[1] .. " created.")
end

else
print([[
Invalid command.  Use "bookmark help" for help.
]])
end

Code: (goto.lua) [Select]
-- goto script v1.01
-- Move the screen to a bookmark or a set of XYZ coordinates.
-- Enter "bookmark help" for a list of reserved names.
-- Version 1.01 removes the need for the "calibrate" step, harmonizes reported Z with screen display, and checks bounds on target coordinates.

local args = {...}

local bookmarks = dfhack.persistent.get_all("BOOKMARK",true)

if args[1] == "help" then
print([[bookmark.lua
Enter "goto # # #" to move the screen to a set of XYZ coordinates.
Enter "goto foo" to move the screen to be centered on bookmark "foo".
"goto help" prints this command summary.
]])

elseif args[1] and not args[2] then
if bookmarks then
local pos = {}
local xcoord = df.global.cursor.x
for _, bookmark in ipairs(bookmarks) do
if bookmark.value == args[1] then
pos["x"] = bookmark.ints[1]
pos["y"] = bookmark.ints[2]
pos["z"] = bookmark.ints[3]
end
end
if pos.x then
dm = require('gui.dwarfmode')
if xcoord ~= -30000 then df.global.cursor.x = pos.x end
df.global.cursor.y = pos.y
df.global.cursor.z = pos.z - df.global.world.map.region_z
df.global.window_x = math.max(pos.x - math.floor(dm.getPanelLayout().map.width / 2), 0)
df.global.window_y = math.max(pos.y - math.floor(dm.getPanelLayout().map.height / 2), 0)
df.global.window_z = pos.z - df.global.world.map.region_z
print("Now at " .. args[1])
else
print("Bookmark " .. args[1] .. " not defined.")
end
else
print("No bookmarks defined.")
end

elseif args[1] and args[2] and args[3] then
local pos_x = tonumber(args[1])
local pos_y = tonumber(args[2])
local pos_z = tonumber(args[3]) - df.global.world.map.region_z
local max_x = df.global.world.map.x_count - 1
local max_y = df.global.world.map.y_count - 1
local max_z = df.global.world.map.z_count - 1
if pos_x > max_x or pos_y > max_y or pos_z > max_z or pos_x < 0 or pos_y < 0 or pos_z < 0 then
print("Target out of range.")
else
local dm = require('gui.dwarfmode')
local size_x = dm.getPanelLayout().map.width
local size_y = dm.getPanelLayout().map.height
local half_x = math.floor(size_x / 2)
local half_y = math.floor(size_y / 2)
local window_x = math.min(math.max(pos_x - half_x, 0), max_x - size_x)
local window_y = math.min(math.max(pos_y - half_y, 0), max_y - size_y)
local xcoord = df.global.cursor.x
if xcoord ~= -30000 then
df.global.cursor.x = pos_x
df.global.cursor.y = pos_y
else
df.global.cursor.y = window_y + half_y
end
df.global.cursor.z = pos_z
df.global.window_x = window_x
df.global.window_y = window_y
df.global.window_z = pos_z
if xcoord == -30000 and (pos_x ~= window_x + half_x or pos_y ~= window_y + half_y) then
print("Too close to edge. Now at " .. window_x + half_x .. "  " .. window_y + half_y .. "  " .. pos_z + df.global.world.map.region_z)
else
print("Now at " .. pos_x .. "  " .. pos_y .. "  " .. pos_z + df.global.world.map.region_z)
end
end

else
print([[
Invalid command.  Use "goto help" for help.
]])
end

Code: (whereami.lua) [Select]
-- whereami script v1.01
-- Reports coordinates of the cursor if it is present, or the center of the screen if not.
-- Also lists any bookmarks set for these coordinates.
-- Version 1.01 removes the need for the "calibrate" step and harmonizes reported Z with screen display.

local bookmarks = dfhack.persistent.get_all("BOOKMARK",true)
local pos = {}
pos = copyall(df.global.cursor)
pos.z = pos.z + df.global.world.map.region_z
local name = "Cursor:"
if pos.x == -30000 then
dm = require('gui.dwarfmode')
name = "Center:"
pos["x"] = df.global.window_x + math.floor(dm.getPanelLayout().map.width / 2)
pos["y"] = df.global.window_y + math.floor(dm.getPanelLayout().map.height / 2)
pos["z"] = df.global.window_z + df.global.world.map.region_z
end
print(name .. "  " .. pos.x .. "  " .. pos.y .. "  " .. pos.z)
if bookmarks then
for _, bookmark in ipairs(bookmarks) do
if bookmark.ints[1] == pos.x and bookmark.ints[2] == pos.y and bookmark.ints[3] == pos.z then
print("Bookmarked as " .. bookmark.value)
end
end
end

Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: Dwarf Fortress for the BLind: Advice sought
« Reply #171 on: April 17, 2016, 01:45:31 am »

Since this really isn't the appropriate place to be sending potentially Eldritch code back and forth, I started this thread in the Modding area.
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

LordPorkins

  • Bay Watcher
  • Unrelated to DukePorkins
    • View Profile
Re: Dwarf Fortress for the BLind: Advice sought
« Reply #172 on: April 17, 2016, 12:50:10 pm »

*Stares slack jawed at the previous post. Eyes begin to glaze over. Suddenly shakes head*

"Woah, What? Where am i?"
Logged
Ïlul Thuveg-Ellest
Rete Sano-Pima
Tormuk Dul-Orax
Kar Pum-Sisha

Dozebôm Lolumzalìs

  • Bay Watcher
  • what even is truth
    • View Profile
    • test
Re: Dwarf Fortress for the BLind: Advice sought
« Reply #173 on: April 17, 2016, 04:15:04 pm »

"Inside a thread THAT'S NOT A ROLEPLAYING THREAD. Get back to your hole board." :P
Logged
Quote from: King James Programming
...Simplification leaves us with the black extra-cosmic gulfs it throws open before our frenzied eyes...
Quote from: Salvané Descocrates
The only difference between me and a fool is that I know that I know only that I think, therefore I am.
Sigtext!

Heretic

  • Bay Watcher
    • View Profile
Re: Dwarf Fortress for the BLind: Advice sought
« Reply #174 on: April 18, 2016, 12:33:00 am »

zkline - great respect for you! Seriosly. I have little post-suggestion for future experiments - to use desktop for blind(i forget it's name, you said that it's has not enough sympols previosly in this topic) + sound note. Like touching-code for liter(abcd...) and sounds for color and Upper or normal symbols.
But i'm really glad to see that this long research been crowned with success!
And other suggestion - you can try to create something like community game, probadly with youtube translation... and a lot of other beards help you in situation, that now you can't solve. As for me, i'm really intresed to see somethink like this!
Logged

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: Dwarf Fortress for the BLind: Advice sought
« Reply #175 on: April 23, 2016, 01:07:36 am »

Hi zkline and anyone else not terrified by that earlier Lua script stuff, I got version 1.02 to now give a very brief description of the tile when you type whereami in the DFHack console.  For example,

whereami
Cursor: 73 74 148, SOIL WALL

Obviously there is a lot more information available, but I wanted to keep the responses very short.  The idea is to detect when the ground level changes, not to re-create the game's look or DFHack's probe.
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

zkline

  • Bay Watcher
    • View Profile
Re: Dwarf Fortress for the BLind: Advice sought
« Reply #176 on: April 23, 2016, 11:54:37 am »

Thanks for this, Dirst. :)

Sadly, I lost access to my Linux system, and thus, relatively pleasant text-mode DF. Thanks, Windows 10 for overriding boot entries without permission. :/ I haven't had the patience to repair things yet.

I would love to be able to play without need for text mode, however. Has their been any luck with logging?
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: Dwarf Fortress for the BLind: Advice sought
« Reply #177 on: April 23, 2016, 02:23:34 pm »

Here's the script I have so far: https://github.com/lethosor/dfhack-scripts/blob/master/acclog.lua
A more easily-downloadable ("raw") version: https://raw.githubusercontent.com/lethosor/dfhack-scripts/master/acclog.lua

I couldn't come up with a great name for it, and I really haven't had a lot of time to work on it, being busy with other DFHack maintenance stuff. Right now it just logs the selected items in the title, options, and load game menus, although I've been putting in extra work to make adding new things easier.

Anyway, let me know if the logging works and is usable (it writes to acclog.txt in the DF folder), and if it's too verbose/terse/whatever. I'll probably make the messages customizable at some point, but they're not at the moment.
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

zkline

  • Bay Watcher
    • View Profile
Re: Dwarf Fortress for the BLind: Advice sought
« Reply #178 on: August 17, 2016, 04:23:16 pm »

Hey, All,

Just wanted to pop back in here to say I finally restored Linux access again. So DF is once again maybe sort of playable.

I'm tempted to focus on adventure mode this time around, if only because I have been craving somethings super sandboxy of late. There are some problems with it too, of course, but less so than fortress-building.

I'll continue to poke at different screen readers, in hopes I can get one which reads the characters properly. That would be an excellent start. :)
Logged

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: Dwarf Fortress for the BLind: Advice sought
« Reply #179 on: August 17, 2016, 04:31:34 pm »

So DF is once again maybe sort of playable.
"DF" and "playable" in the same sentence?  I think you misunderstand this game :)

Welcome back!
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map
Pages: 1 ... 10 11 [12] 13 14 ... 17