Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 357 358 [359] 360

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

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5370 on: May 06, 2017, 10:14:48 pm »

replace df.building.find(args[1]) with df.building.find(tonumber(args[1]))

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5371 on: May 10, 2017, 02:32:02 pm »

Is it possible to see what arguments a script takes from inside DFHack? For example, the modtools/create-item script has -creator, -item, -mat, etc... I'm looking to make a script that does something for each script it finds with a certain argument available. I know I could probably read in the scripts files, and do a simple word search, but I didn't know if that information gets loaded in somwhere else (I could also just run each script with run_command_silent and check if it accepts the argument I want, but that seems rather costly and a little dangerous.
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5372 on: May 10, 2017, 04:29:56 pm »

Not really, and it's unlikely that all of the scripts you find would work the way you expect if you could do that. Most scripts should have a "help" or "-help" option available, so I guess you could try that.
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.

Amostubal

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5373 on: May 10, 2017, 09:31:03 pm »

replace df.building.find(args[1]) with df.building.find(tonumber(args[1]))

sorry Putnam, I thought I told you thanks for this... I've got a fully working TESB up and going now!
Logged
Legendary Dwarf Fortress
Legendary Discord Group
"...peering into the darkness behind the curtains, evokes visions of pixies being chased by dragons while eating cupcakes made of coral iced with liquid fire while their hearts burn out with unknown plant substances..." - a quote from the diaries of Amostubal

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5374 on: May 11, 2017, 04:11:19 am »

currently working on a play any Civ script for fort mode embark menu, but hitting a small snag trying to insert a position so folks can do basic DF entity stuff like Doctoring and building armies.
so far none of my insert entity position raw stuff works unless I manually do it in Gm-editor.
so I'm kinda stump on how do I write this into a script
Spoiler (click to show/hide)
so here's my work in progress loads of dummy out attempts
Logged
I thought I would I had never hear my daughter's escapades from some boy...
DAMN YOU RUMRUSHER!!!!!!!!
"body swapping and YOU!"
Adventure in baby making!Adv Homes

PatrikLundell

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5375 on: May 11, 2017, 04:39:56 am »

@Rumrusher: Are you sure entito is a pointer to the target struct rather than a copy of the data of the target struct? I'm too hazy on Lua's rules myself to say anything with certainty, but it looks like a possible cause (and could be tested by using the full path to see if that takes hold).
Using a script rather than providing modified raws to swap in and out seems like a needlessly complicated way of doing things to me...
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5376 on: May 11, 2017, 05:03:13 am »

@Rumrusher: Are you sure entito is a pointer to the target struct rather than a copy of the data of the target struct? I'm too hazy on Lua's rules myself to say anything with certainty, but it looks like a possible cause (and could be tested by using the full path to see if that takes hold).
Using a script rather than providing modified raws to swap in and out seems like a needlessly complicated way of doing things to me...
yeah it is given I could just make all civs have a position but, I figure doing this saves me when I roll in an hardcoded civ with no way to setting the entity position on a raw level to give me military.
entito is there as a "edit the newly made raw entity position", my problem is I don't know how to Insert a entity raw position to reach that spot of "is entito working" as every time I go through the available site entity raws they keep showing up there's no position.
Logged
I thought I would I had never hear my daughter's escapades from some boy...
DAMN YOU RUMRUSHER!!!!!!!!
"body swapping and YOU!"
Adventure in baby making!Adv Homes

PatrikLundell

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5377 on: May 11, 2017, 07:32:01 am »

This added a position entry to the humans for me. Provided, of course, that is what your problem is.
Spoiler (click to show/hide)

Edit: Come to think of it, I suspect your approach is doomed. It ought to allow you to start playing (once you're added all that's needed), but never load a save, as the save probably loads raw files copied at the save creation, rather than writing to raw files from the raw data representation within DF as the game is saved (or at least that would require you to repatch things at every load).
« Last Edit: May 11, 2017, 07:43:34 am by PatrikLundell »
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5378 on: May 11, 2017, 08:59:57 am »

thanks , darn I forgot about new().

though this set up would allow folks to play as angels ... doing so tends to crash the game.

...crud okay so it worked but didn't give the civs military so I ended up just going with plan b, using warmist tofort to unlock noble positions.
only got it to work with a bunch of Dwarves so I don't know if it works with every one, but doing so kinda remove job access to the other dwarves turning the fort into a weird hermit and the 6 useless peasants mess
Logged
I thought I would I had never hear my daughter's escapades from some boy...
DAMN YOU RUMRUSHER!!!!!!!!
"body swapping and YOU!"
Adventure in baby making!Adv Homes

knedl

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5379 on: May 11, 2017, 01:07:52 pm »

@lethosor - you have been asking in this thread http://www.bay12forums.com/smf/index.php?topic=163671.0 if the script works for caravans and I confirm it did help me get the rest of the human caravan on the map. My case was a bit specific because when caravan was announced only guards entered the map but soon after some darn monkey attacked and killed a horse. Since I have horses on the map I didn't think it's related to caravan but indeed the monkey managed to kill the caravan horse and the rest of the caravan got stuck outside of map. Using the script a few in-game days later got the rest of the traders on the map but now they are stuck at the bin that was "dropped" by the dead horse and are stuck at the edge of the map again. As far as I know I just have to wait for them to go insane and die but that shouldn't affect future caravans visits from humans right?

In regards to sieges - I had one announced the other day and the game pauses and zooms to where the units entered the map. There is always only a few that get spotted on the edge like 10 units or so right from the start and other units enter the map following the ones that appeared when siege is announced. I made a quicksave because it was late for me and I said will deal with this siege next time I play. So I made a backup of the save and then I let the siege go forward for a while just to see how many attackers came and there was around 80 goblins & trolls (in the "u"/others screen). So before I started the game next time I used the backed up quicksave to start right from where the siege was announced. But this time there were only goblins that were already on the map, so some 8 goblins and all the other units from the siege were gone and have never entered the map (there were also only 8 present in the "u"/others screen). So it seems that quicksave at the time that siege is announced only saves the units that are present on the map but not the ones that still follow right behind them. It cuts out those that are entering the map. So that siege ended very fast with only a few goblins that I killed and I never got a siege again. I am not sure how much in-game time has passed since then but it seems like a lot. So do you guys have any experience with that and do you think that those goblins that didn't spawn might be stuck "somewhere in the savegame folder/world.sav file" between the world map and fort map and could create a mess long term or prevent other goblin sieges to happen? Any ideas on this one?

Also I think that the game does NOT save farm plots settings properly. The fertilize on/off function might not be saved properly, actually is always set/reset to "on" after you load the game. I set some farms to not be fertilized but when I reload all are set to fertilize "on" again. I did check if it might be because seasons changed but the fertilize "on/off" settings have all been reset for all farms and for all seasons. Might be a bug hiding in the potato farm that no one noticed :) Anyway you guys probably can check in a minute what stats are saved for farm plots and see if fertilize "on/off" option is also saved or not. Sounds strange to my because not saving it should crash the game on load I guess but hey this is DF and anything is possible :D

Please include the "caravan unit retrieval" script in DFHack and consider doing the same for siege units. I also hope that my experience above will help investigate this further.

EDIT: I always forget to tell I am playing 43.03 Newb Pack so not 100% up to date here :)
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5380 on: May 11, 2017, 01:23:05 pm »

@lethosor - you have been asking in this thread http://www.bay12forums.com/smf/index.php?topic=163671.0 if the script works for caravans and I confirm it did help me get the rest of the human caravan on the map. My case was a bit specific because when caravan was announced only guards entered the map but soon after some darn monkey attacked and killed a horse. Since I have horses on the map I didn't think it's related to caravan but indeed the monkey managed to kill the caravan horse and the rest of the caravan got stuck outside of map. Using the script a few in-game days later got the rest of the traders on the map but now they are stuck at the bin that was "dropped" by the dead horse and are stuck at the edge of the map again. As far as I know I just have to wait for them to go insane and die but that shouldn't affect future caravans visits from humans right?
Maybe, but I'm not sure.

Quote
In regards to sieges - I had one announced the other day and the game pauses and zooms to where the units entered the map. There is always only a few that get spotted on the edge like 10 units or so right from the start and other units enter the map following the ones that appeared when siege is announced. I made a quicksave because it was late for me and I said will deal with this siege next time I play. So I made a backup of the save and then I let the siege go forward for a while just to see how many attackers came and there was around 80 goblins & trolls (in the "u"/others screen). So before I started the game next time I used the backed up quicksave to start right from where the siege was announced. But this time there were only goblins that were already on the map, so some 8 goblins and all the other units from the siege were gone and have never entered the map (there were also only 8 present in the "u"/others screen). So it seems that quicksave at the time that siege is announced only saves the units that are present on the map but not the ones that still follow right behind them. It cuts out those that are entering the map. So that siege ended very fast with only a few goblins that I killed and I never got a siege again. I am not sure how much in-game time has passed since then but it seems like a lot. So do you guys have any experience with that and do you think that those goblins that didn't spawn might be stuck "somewhere in the savegame folder/world.sav file" between the world map and fort map and could create a mess long term or prevent other goblin sieges to happen? Any ideas on this one?
Sounds like a DF bug to me. Did you try saving from the options menu as well?

Quote
Also I think that the game does NOT save farm plots settings properly. The fertilize on/off function might not be saved properly, actually is always set/reset to "on" after you load the game. I set some farms to not be fertilized but when I reload all are set to fertilize "on" again. I did check if it might be because seasons changed but the fertilize "on/off" settings have all been reset for all farms and for all seasons. Might be a bug hiding in the potato farm that no one noticed :) Anyway you guys probably can check in a minute what stats are saved for farm plots and see if fertilize "on/off" option is also saved or not. Sounds strange to my because not saving it should crash the game on load I guess but hey this is DF and anything is possible :D
I can't find any DFHack tools that deal with fertilization at all, so I don't think it's a DFHack issue. I've never had it happen, in any case. Just to check, does the "f" option when you select a farm plot say "Fertilize" or "Cancel fert"?

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.

knedl

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5381 on: May 11, 2017, 01:55:32 pm »

Quote
Sounds like a DF bug to me. Did you try saving from the options menu as well?

After I let the siege go for a while I exited the game normally not with the kill command, so esc and savegame etc. The prob is that next time I run the game I deleted this last savegame because I had the quick save from only a few minutes before. I never loaded the save to be able to see if that one might be corrupt but never happened to me anyway so I am sure it was nothing wrong there. I am sure that quicksave cut out the units like there is a glitch between region-snapshot.dat and unit.dat. Where does the U screen/others get the units data from? Do like units get generated on the spot when siege is announced and are visible on U screen/others immediately/first and then units enter the map (same with caravans, megabeasts, etc)? It might explain why people get this strange "units not entering the map" because they save spot on when the game announces the event and pauses. If you then exit the game and reload the units that did not enter the map get bugged somehow/stuck out of map unable to enter.

Quote
I can't find any DFHack tools that deal with fertilization at all, so I don't think it's a DFHack issue. I've never had it happen, in any case. Just to check, does the "f" option when you select a farm plot say "Fertilize" or "Cancel fert"?

Yes it does change. I set them all to Cancel, only wanted my pig tail farms to be fertilized but after a reload all farms had fertilize back on.

EDIT: I just got the message that the caravan I spawned with the script is leaving soon.
« Last Edit: May 11, 2017, 02:11:43 pm by knedl »
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5382 on: May 11, 2017, 02:40:49 pm »

After I let the siege go for a while I exited the game normally not with the kill command, so esc and savegame etc. The prob is that next time I run the game I deleted this last savegame because I had the quick save from only a few minutes before. I never loaded the save to be able to see if that one might be corrupt but never happened to me anyway so I am sure it was nothing wrong there. I am sure that quicksave cut out the units like there is a glitch between region-snapshot.dat and unit.dat. Where does the U screen/others get the units data from? Do like units get generated on the spot when siege is announced and are visible on U screen/others immediately/first and then units enter the map (same with caravans, megabeasts, etc)? It might explain why people get this strange "units not entering the map" because they save spot on when the game announces the event and pauses. If you then exit the game and reload the units that did not enter the map get bugged somehow/stuck out of map unable to enter.
I suppose saving at that point could be the cause, although quicksave only triggers an autosave, so if that were the cause, it wouldn't be quicksave-specific.

Quote
Yes it does change. I set them all to Cancel, only wanted my pig tail farms to be fertilized but after a reload all farms had fertilize back on.
Are you saying that you switched it to display "f: Cancel fert"? I'm pretty sure that means you enabled fertilization, although I could be misunderstanding.
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.

knedl

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5383 on: May 11, 2017, 03:09:16 pm »

Quote
I suppose saving at that point could be the cause, although quicksave only triggers an autosave, so if that were the cause, it wouldn't be quicksave-specific.
Like you said saving at that point could be the cause. Might be worth keeping this in mind and test it further when events pop up to see if there is a savegame generating related bug

Quote
Yes it does change. I set them all to Cancel, only wanted my pig tail farms to be fertilized but after a reload all farms had fertilize back on.

Are you saying that you switched it to display "f: Cancel fert"? I'm pretty sure that means you enabled fertilization, although I could be misunderstanding.

When you build a farm plot, the default setting for fertilize is on, as fertilize. You can pres "f" and it sets the farm plot to cancel fert, meaning it won't be fertilized. If you set farms to cancel fert, save and reload those same farms will have fertilize back on. It seems the setting for fertilize is not saved it just goes back/reverts to default settings for farm plots on reload. It's like you would have to for example set plump helmets for all your plots every time you reload the game. At first I thought that I messed something up with season settings, like set plump helmets only for spring time and not other seasons and after reload there is a new season and you wonder why there are no crops. It's the same with fertilizer settings, except those revert to default after reload.

« Last Edit: May 11, 2017, 03:11:16 pm by knedl »
Logged

knedl

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5384 on: May 11, 2017, 03:51:39 pm »

Oh and btw an idea for Autobucher. Is it possible that one more thing would be included in those options and that is to be able to set collect eggs on/off for every "race". The don't collect eggs option, should be possible by a script that setts forbid on certain race eggs in the nest box. It sucks locking and unlocking or forbidding eggs. This option would perfectly round up the autobutcher tool.
Logged
Pages: 1 ... 357 358 [359] 360