Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 313 314 [315] 316 317 ... 360

Author Topic: DFHack 0.43.03-r1  (Read 1087170 times)

Hesperid

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #4710 on: September 20, 2016, 09:34:46 pm »

1 based indexing is an obvious example of massive brain damage... Hmmm... Maybe I should brush up my C skills some and write a language that takes all the best parts of Lua, but use C-like syntax, 0 based indexing, etc. The problem is, I already have too many projects.

I think we've all had that idea once or twice whenever we stumble on Lua's many oddities. Lua's strengths are very impressive, and the clumsy and verbose syntax is the price you must pay for it. The real problem in writing your own Lualike language, because it applies even to people that don't have too many projects, is this: see you in 20 years when your single-developer language is mature and doesn't randomly glitch out/segfault. Oh you're finished? Well Lua's dead and now we're all using MontyPython, because all the VR devices have an integrated bytecode VM for it. There's your next homemade language dupe project. :P
Logged

heydude6

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #4711 on: September 21, 2016, 12:51:16 am »

Just a quick question about the exterminate him command, but is there a way to make it select a target by receiving map coordinates rather than having to move my cursor over it? I kind of want to create a syndrome that automatically exterminates a unit after it gets infected with it and I can't have players willingly initiating the process.
Logged
Lets use the ancient naval art of training war parrots. No one will realize they have been boarded by space war parrots until it is to late!
You can fake being able to run on water. You can't fake looking cool when you break your foot on a door and hit your head on the floor.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #4712 on: September 21, 2016, 02:26:40 am »

Exterminate just removes all blood from the creature's system and makes them disappear in two ticks. Make a CE_BLEEDING syndrome with extremely high severity on all parts, that should be enough.

Williham

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #4713 on: September 21, 2016, 08:17:31 am »

1 based indexing is an obvious example of massive brain damage... Hmmm... Maybe I should brush up my C skills some and write a language that takes all the best parts of Lua, but use C-like syntax, 0 based indexing, etc. The problem is, I already have too many projects.

I think we've all had that idea once or twice whenever we stumble on Lua's many oddities. Lua's strengths are very impressive, and the clumsy and verbose syntax is the price you must pay for it. The real problem in writing your own Lualike language, because it applies even to people that don't have too many projects, is this: see you in 20 years when your single-developer language is mature and doesn't randomly glitch out/segfault. Oh you're finished? Well Lua's dead and now we're all using MontyPython, because all the VR devices have an integrated bytecode VM for it. There's your next homemade language dupe project. :P

Also, the language already exists:

They call it Squrrel.
Logged

expwnent

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #4714 on: September 21, 2016, 08:54:28 am »

That looks great but in terms of how much good we can do for the project per hour of free time it's probably not worth it.
Logged

gchristopher

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #4715 on: September 21, 2016, 04:54:30 pm »

I'm investigating writing a script that calculates a artificial running "score" of a game as it progresses. I'd like it to display periodic updates on the current score, and persist a cumulative total for an in-game year across save/loads. So far I've got:

- I can start a script from onMapLoad*.init and do any needed cleanup from onMapUnload*.init. (That's the safest place to put something that should only run in Fortress mode?)
- I can use repeat to schedule a command to examine the site map/logs and calculate/report a score daily.

So far, so good. Is there any convenient way to save a value (like "current total score") that will persist across save/loads of a game?

I imagine that writing a value to an arbitrary file would be a gigantic security hole, but maybe it's possible anyway? I see there's a stockpiles plugin that (I think) delivers a .dll to deliver the file access functionality. I'd rather not get that fancy.

Failing that, I guess there's a lot of places in a saved game where you could stash a value somewhere it wouldn't hurt a running game. Maybe in some stat for a historical figure, or somewhere in the game raws as a non []-enclosed value that would be interpreted as a comment?

Does anyone have any advice on how to best save arbitrary data across game saves so the script can retrieve it on the next onMapLoad?
« Last Edit: September 21, 2016, 04:56:03 pm by gchristopher »
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #4716 on: September 21, 2016, 06:11:34 pm »

onMapLoad*.init will run whenever any map is loaded, including in adventure mode. If you want your script to only work in fortress mode, you have to handle that in your script (e.g. check "dfhack.world.isFortressMode()").

The stockpiles plugin is self-contained. It doesn't distribute any other libraries. Perhaps you're thinking of protobuf, but that's included in DFHack, and DFHack uses it for most remote communication. Lua has decent enough file support for the kind of data you want to save, and there's also a Lua JSON library if you want that.

There's also the persistent storage API. I'm not too familiar with it, but it should be documented in the Lua API docs: http://dfhack.readthedocs.io/en/latest/docs/Lua%20API.html
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.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #4717 on: September 21, 2016, 09:13:22 pm »

I would personally just use the JSON API and use the site index as a key. There are some minor problems with saving (autosaves won't work), but that can be handled by just storing the scores by dates, saving the file whenever they're stored, then deleting any that happen after the current date. Make sure to store any keys as strings rather than integers, storing as integers will make the JSON API store it as an array even where that makes no sense (e.g. you're tracking units 2703 and 2704, so your JSON table has 2702 empty indices listed out before 2703).

TheKaspa

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #4718 on: September 24, 2016, 02:43:45 am »

Is there a pre-alpha for 43.05?
Logged
Tai'shar DwarfFortress

I've heard Minecart Airlines Express offers nice trips to nobility. Alternative trips include a voyage over the volcano. Call 1-800-I-THE-GUINEAPIG-VOLUNTEER and book now!
My fucking armok, you broke the game.

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #4719 on: September 24, 2016, 11:47:34 am »

Is there a pre-alpha for 43.05?
We've tried doubling the volunteers' pay ($0x2=$0), but it turns out that no one is slacking and it's just taking a long time.
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

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #4720 on: September 24, 2016, 12:02:28 pm »

I've also been busier than normal and haven't had as much time to work on DFHack as I would've liked.

Part of the issue is that some offsets still aren't located (partly because there are 6 builds now instead of 3, although the real issue is that finding 64-bit offsets is harder since we have to update some tools we were using). That would definitely block a stable release, but I guess it's not too bad for an alpha release. We've released early builds without some offsets before, anyway.

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.

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: DFHack 0.43.03-r1
« Reply #4721 on: September 24, 2016, 01:12:28 pm »

finding 64-bit offsets is harder since we have to update some tools we were using
In some cases, that isn't even possible - for example, I've been using IDA demo/free versions on Windows for 32-bit DF, but the only versions of IDA that support 64-bit binaries cost over $1000 for a single license, and most other tools don't even come anywhere close in terms of functionality and usability.
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.

SalmonGod

  • Bay Watcher
  • Nyarrr
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #4722 on: September 25, 2016, 03:28:16 pm »

This is super sad, and I would donate money to the cause if I could.  It's very difficult to go back to playing DF without the basic set of DFHack and Therapist tools.
Logged
In the land of twilight, under the moon
We dance for the idiots
As the end will come so soon
In the land of twilight

Maybe people should love for the sake of loving, and not with all of these optimization conditions.

zeves

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #4723 on: September 25, 2016, 06:33:08 pm »

yes it wouldnt be so bad if we only had 50 dwarves, but with new hardware in place and the map bigger than ever, 200 dwarves seem quite difficult  to manage manually.
Logged

nuker22110

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #4724 on: September 25, 2016, 07:51:21 pm »

when using catsplosion list, the command shows animals that have already been slaughtered. When does the count reset? Also, I penned my falcons into a room with nestboxes and ran the catsplosion bird_falcon_peregrine and it just says pregnancies accelerated or something, but nothing happens? they dont immediately lay more eggs
Logged
Pages: 1 ... 313 314 [315] 316 317 ... 360