Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Df-gui/gm maker on sites  (Read 2288 times)

iii22

  • Bay Watcher
    • View Profile
Df-gui/gm maker on sites
« on: September 01, 2020, 02:25:41 pm »

Can you select a site from the World menu and use gm editor to bring it up? It would make things so much easier finding the right sites to mess with.
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: Df-gui/gm maker on sites
« Reply #1 on: September 02, 2020, 07:57:34 pm »

Yes, you can select any DF object in gui/gm-editor. In this case, I think you could use "gui/gm-editor world.world_data.sites[SITE_ID]", although I'm not sure if the site ID is also its index in the sites list.

Which specific screen are you referring to as "the world menu"? There might be another way to get to the site from the screen with "gui/gm-editor scr".

(You might get more visibility if you post questions like this in the main DFHack thread, by the way.)
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.

PatrikLundell

  • Bay Watcher
    • View Profile
Re: Df-gui/gm maker on sites
« Reply #2 on: September 03, 2020, 02:00:14 am »

The Site Id is off by one...
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: Df-gui/gm maker on sites
« Reply #3 on: September 03, 2020, 08:54:55 am »

Yeah, looks like no sites have an ID of 0 in a world I checked too.

I had forgotten that gui/gm-editor also supports function calls, so you can also use this:
Code: [Select]
gui/gm-editor df.world_site.find(SITE_ID)
This will actually search for a site with a matching "id" field (and works for most other DF types, too).
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.

iii22

  • Bay Watcher
    • View Profile
Re: Df-gui/gm maker on sites
« Reply #4 on: September 04, 2020, 02:24:28 pm »

So then how do you get the site to send a siege or attack you? I know it's possible since there is an "army" and "army controller" value that gm editor finds.
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: Df-gui/gm maker on sites
« Reply #5 on: September 04, 2020, 08:43:04 pm »

You'll almost certainly need a dedicated script for that. gui/gm-editor is just a tool for inspecting DF structures, and making some basic modifications to them. Actually creating one, or setting up whatever needs to be done to trigger a siege, is likely too complicated to be done in gui/gm-editor.
I'm not actually sure if someone has written a script to trigger a siege, but you could check or ask in the DFHack thread or the utilities/modding subforums.
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.

PatrikLundell

  • Bay Watcher
    • View Profile
Re: Df-gui/gm maker on sites
« Reply #6 on: September 06, 2020, 07:38:46 am »

A major stumbling block is that we don't even know how the proper data structures behave, nor have all (relevant?) fields in them been identified. An siege is a rather complicated mess with one "army" for the general, another for the actual army, and a third one for the character actually leading the army. How do they interact? Don't know. Are there other structures involved? Don't know.

Thus, before you can get DFHack to send armies, you have to do the research (and update the DF structures with it!) to find out what pieces are involved, how they interact, and what the internal structure of each piece is, as well as the role of each of those fields.
Logged

iii22

  • Bay Watcher
    • View Profile
Re: Df-gui/gm maker on sites
« Reply #7 on: September 10, 2020, 08:29:27 am »

A major stumbling block is that we don't even know how the proper data structures behave, nor have all (relevant?) fields in them been identified. An siege is a rather complicated mess with one "army" for the general, another for the actual army, and a third one for the character actually leading the army. How do they interact? Don't know. Are there other structures involved? Don't know.

Thus, before you can get DFHack to send armies, you have to do the research (and update the DF structures with it!) to find out what pieces are involved, how they interact, and what the internal structure of each piece is, as well as the role of each of those fields.
Rumrusher managed to get a force siege script working from this thread ( http://www.bay12forums.com/smf/index.php?topic=164680.30 ) but only in Adventure mode. Maybe somebody here could revise it for Fort mode
Logged

Shonai_Dweller

  • Bay Watcher
    • View Profile
Re: Df-gui/gm maker on sites
« Reply #8 on: September 13, 2020, 04:40:57 pm »

Again, you mention this "Adventurer siege" thing. Where in that thread did Rumrusher actually say the script for generating a siege (an exclusively Fortress mode thing) was only for Adventurer (whatever that means).

That thread involves the most knowledgeable script writers in the community. If their script doesn't work, then no-one knows how to do it and you'll just have to script it yourself.
Logged

iii22

  • Bay Watcher
    • View Profile
Re: Df-gui/gm maker on sites
« Reply #9 on: September 16, 2020, 09:29:50 am »

He told me the results of the script on Discord.
Logged