Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 268 269 [270] 271 272 ... 373

Author Topic: DFHack 0.34.11 r3  (Read 1455969 times)

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4035 on: June 13, 2013, 09:25:14 pm »

dfhack.getline()?

Urist Da Vinci

  • Bay Watcher
  • [NATURAL_SKILL: ENGINEER:4]
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4036 on: June 13, 2013, 10:03:00 pm »

dfhack.getline()?

Now I get an error about an "attempt to call field 'getline' (a nil value)".

EDIT:
An online lua reference suggests io.read(). This initially appears to work, but the script causes df to become unresponsive and frozen until you provide input, so I can't move the cursor.
« Last Edit: June 13, 2013, 10:11:07 pm by Urist Da Vinci »
Logged

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4037 on: June 14, 2013, 01:48:33 am »

dfhack.getline()?

Now I get an error about an "attempt to call field 'getline' (a nil value)".

EDIT:
An online lua reference suggests io.read(). This initially appears to work, but the script causes df to become unresponsive and frozen until you provide input, so I can't move the cursor.

That is wrong way to do anyway. I was thinking about making a series of overlays for e.g. unit selection (including multiple, from list, by some filter), item selection, generic cursor, etc...
They would be like gui.dialogs. this https://github.com/warmist/OpusArcania/blob/master/buildings.lua actually uses an overlay to show mana in world and has movable cursor. movie how it looks

Urist Da Vinci

  • Bay Watcher
  • [NATURAL_SKILL: ENGINEER:4]
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4038 on: June 14, 2013, 02:06:20 am »

I am going to get around the multiple input problem for now by using two scripts.

Script 1 will print the id or other unique identifer of the targeted unit. You use this on both units.

Script 2 will prompt twice for user text input, and you enter the numbers that you can see above. The script can then find the two units. It's clumsy, but it will work for my experiments.

ag

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4039 on: June 14, 2013, 02:18:04 am »

An online lua reference suggests io.read(). This initially appears to work, but the script causes df to become unresponsive and frozen until you provide input, so I can't move the cursor.

Read the dfhack lua api documentation, instead of random online references: https://github.com/peterix/dfhack/blob/master/Lua%20API.rst#native-utilities
Logged

Urist Da Vinci

  • Bay Watcher
  • [NATURAL_SKILL: ENGINEER:4]
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4040 on: June 14, 2013, 09:06:19 am »

An online lua reference suggests io.read(). This initially appears to work, but the script causes df to become unresponsive and frozen until you provide input, so I can't move the cursor.

Read the dfhack lua api documentation, instead of random online references: https://github.com/peterix/dfhack/blob/master/Lua%20API.rst#native-utilities

Thanks, the script is now working as I intended. You can now change cursor targets while it is waiting for input:

Code: [Select]
print("Target first unit")
test=dfhack.lineedit("")
unit=dfhack.gui.getSelectedUnit()
if unit==nil then
print ("No unit under cursor!  Aborting with extreme prejudice.")
return
end

print("Target second unit")
test=dfhack.lineedit("")
unit2=dfhack.gui.getSelectedUnit()
if unit2==nil then
print ("No unit under cursor!  Aborting with extreme prejudice.")
return
end

print(unit.id, unit2.id)

CaptainArchmage

  • Bay Watcher
  • Profile Pic has Changed! Sorry for the Delay.
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4041 on: June 14, 2013, 01:07:08 pm »

Is there any indication of how often the game goes through the list of items on the map? Because this is related to FPS drop, is there a way to change how often the game checks and reduce it to "when necessary" or "every week"? This kind of hack might help increase framerates.
Logged
Given current events, I've altered my profile pic and I'm sorry it took so long to fix. If you find the old one on any of my accounts elsewhere on the internet, let me know by message (along with the specific site) and I'll fix. Can't link the revised avatar for some reason.

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: DFHack 0.34.11 r3
« Reply #4042 on: June 14, 2013, 02:03:42 pm »

It depends on what you mean by "go through the list of items on the map" - there's checks for updating temperature, increasing item age (and applying stuff like rot and possibly also fire damage), generating hauling jobs, and other various operations, and those are all done on completely separate intervals (and I believe some have the same interval but different offsets). Changing those isn't as simple as you might think.

Even if they could be changed, how exactly would you define "when necessary"?

If you really want to reduce FPS drop related to large item counts, then just destroy the extra items so the game doesn't have to deal with them - we already have "autodump" to do that with garbage, and (as angavrilov mentioned in a post earlier) it should also be possible to 'free up' the items used by constructions.

[edit] I've just written a new plugin (which will be called "cleanconst") which gets rid of construction materials and marks them to be recreated on disassembly.
« Last Edit: June 14, 2013, 02:44:05 pm by Quietust »
Logged
P.S. If you don't get this note, let me know and I'll write you another.
It's amazing how dwarves can make a stack of bones completely waterproof and magmaproof.
It's amazing how they can make an entire floodgate out of the bones of 2 cats.

UberFuber

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4043 on: June 14, 2013, 02:23:22 pm »

It depends on what you mean by "go through the list of items on the map" - there's checks for updating temperature, increasing item age (and applying stuff like rot and possibly also fire damage), generating hauling jobs, and other various operations, and those are all done on completely separate intervals (and I believe some have the same interval but different offsets). Changing those isn't as simple as you might think.

Even if they could be changed, how exactly would you define "when necessary"?

If you really want to reduce FPS drop related to large item counts, then just destroy the extra items so the game doesn't have to deal with them - we already have "autodump" to do that with garbage, and (as angavrilov mentioned in a post earlier) it should also be possible to 'free up' the items used by constructions.
DFHack also have the temperature tweak, which means it takes less time (hence less processing power) for items to reach equilibrium temperature.
Logged

Urist Da Vinci

  • Bay Watcher
  • [NATURAL_SKILL: ENGINEER:4]
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4044 on: June 14, 2013, 11:39:52 pm »

Turns out that swapping souls between two creatures actually works. This only results in a skill/preference/personality trait swap. Alliances, happiness, names, thoughts, relationships, and profession are stored seperately (I know we already knew that). One could argue that you want the creature's deity to be tied to the soul, even if it makes sense to track the parents of the body. Also, the soul has a gender, so after a swap the creature's description may have "He" used to describe physical attributes and "She" used to describe preferences/mental.

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4045 on: June 15, 2013, 12:58:52 am »

Turns out that swapping souls between two creatures actually works. This only results in a skill/preference/personality trait swap. Alliances, happiness, names, thoughts, relationships, and profession are stored seperately (I know we already knew that). One could argue that you want the creature's deity to be tied to the soul, even if it makes sense to track the parents of the body. Also, the soul has a gender, so after a swap the creature's description may have "He" used to describe physical attributes and "She" used to describe preferences/mental.
Also you can stack souls into one body. Though it does not do much.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4046 on: June 15, 2013, 01:00:09 am »

That's an understatement. It does nothing, as far as I can tell.

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4047 on: June 15, 2013, 01:12:47 am »

That's an understatement. It does nothing, as far as I can tell.
Well you still hold the souls. They could be used as a resource. Just don't forget which is yours and if you use up the last one, then too bad for you...

Sergarr

  • Bay Watcher
  • (9) airheaded baka (9)
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4048 on: June 15, 2013, 05:17:23 am »

Turns out that swapping souls between two creatures actually works. This only results in a skill/preference/personality trait swap. Alliances, happiness, names, thoughts, relationships, and profession are stored seperately (I know we already knew that). One could argue that you want the creature's deity to be tied to the soul, even if it makes sense to track the parents of the body. Also, the soul has a gender, so after a swap the creature's description may have "He" used to describe physical attributes and "She" used to describe preferences/mental.

Does that affect marriages?
Logged
._.

Urist Da Vinci

  • Bay Watcher
  • [NATURAL_SKILL: ENGINEER:4]
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4049 on: June 15, 2013, 10:13:55 am »

Turns out that swapping souls between two creatures actually works. This only results in a skill/preference/personality trait swap. Alliances, happiness, names, thoughts, relationships, and profession are stored seperately (I know we already knew that). One could argue that you want the creature's deity to be tied to the soul, even if it makes sense to track the parents of the body. Also, the soul has a gender, so after a swap the creature's description may have "He" used to describe physical attributes and "She" used to describe preferences/mental.

Does that affect marriages?

Nope. Those are stored as a relationship. A married dwarf now has the soul of a dog, with no skills or personality, but the marriage wasn't changed between the dwarf's body and the spouse. The dog is now flashing because it has a legendary skill.

Deleting a dwarf's soul entirely causes the description page to say "Text generation failed: " , and removes all skills/mental attributes/personality, but doesn't otherwise appear to cause the game to crash.
Pages: 1 ... 268 269 [270] 271 272 ... 373