Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 43 44 [45] 46 47 ... 61

Author Topic: [SUGGESTIONS] for DFhack plugins  (Read 141688 times)

mifki

  • Bay Watcher
  • works secretly...
    • View Profile
    • mifki
Re: [SUGGESTIONS] for DFhack plugins
« Reply #660 on: July 21, 2015, 01:55:06 am »

Most recent spawn-unit as far as I know: http://www.bay12forums.com/smf/index.php?topic=139553.msg6197007#msg6197007

If you can make a fully-automated version of spawn-unit with viewscreen_layer_arena_creaturest which works in all cases I would jump up and down with joy.

What are "all cases"?
The most basic version that creates dwarves is just several lines of code https://gist.github.com/pronvit/f665d13e5eb70f5da1e3
I'm not sure I'll have time to improve it, but I was thinking it doesn't need to be fully-automated because viewscreen_layer_arena_creaturest also gives us a free UI to choose a race, skills, effects.

expwnent

  • Bay Watcher
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #661 on: July 21, 2015, 02:04:26 am »

Sorry, I have only been able to loosely follow what has been going on with the spawn unit script, so these questions may have already been answered.

1. Does it allow for spawning of both friendly and hostile animals?
2. Does it allow for spawning of hostile entity creatures (they don't have to be entity members, but just CAN_SPEAK or CAN_LEARN invaders?)
3. Does it allow for spawning of friendly civ members? (from what I have read this is still a no)
4. Does the friendly and hostile animals extend to semi and megabeasts?

I would add:

5. Do pets work?

6. Can new dwarves join the military / take on noble roles?

Before and after saving and reloading of course, in each case.
Logged

expwnent

  • Bay Watcher
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #662 on: July 21, 2015, 02:09:56 am »

PS: For scripts it will need to be fully-automated, since when the mod requires many evil goblins to show up out of nowhere you don't want the user to be consulted and spawn fluffy wamblers instead.
Logged

mifki

  • Bay Watcher
  • works secretly...
    • View Profile
    • mifki
Re: [SUGGESTIONS] for DFhack plugins
« Reply #663 on: July 21, 2015, 02:20:16 am »

I'll try, but again, I wasn't saying it would solve all the problems. You'll need to configure the unit afterwards to get the behaviour you want. But at least no need to deal with body/appearance/personality/next_ids and to worry about some of the data being uninitialised and thus causing problems.

expwnent

  • Bay Watcher
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #664 on: July 21, 2015, 02:22:58 am »

Oh, sure. It would be great if it works for all cases though. That way we won't have to work out how to fix the script every time there's a new significant DF release.
Logged

expwnent

  • Bay Watcher
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #665 on: July 21, 2015, 02:24:25 am »

I think you need to add "links" to the proper population for them to truly be a member. See the spawn-unit version I linked for details.
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #666 on: July 21, 2015, 02:38:30 am »

Also, about configuring after: just make sure it's usable with script_environment if it's a lua script (make the primary spawn unit function global, make it so that it doesn't actually do anything if zero arguments are presented)

expwnent

  • Bay Watcher
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #667 on: July 21, 2015, 02:39:26 am »

I can manage that bit myself once the core functionality is there. That part's easy.
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: [SUGGESTIONS] for DFhack plugins
« Reply #668 on: July 21, 2015, 03:36:50 am »

There was a fairly recent version in the DFHack thread somewhere. I seem to remember that friendly creatures turn hostile after save/load with that version. I don't have a link, sorry.

I've created a dwarf and an aardvark with viewscreen_layer_arena_creaturest, the aardvark is still friendly after save/load, and the dwarf is still working in a workshop. Free workforce, yay!
I've been waiting for this about a year now. You truly are a wizard.
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

expwnent

  • Bay Watcher
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #669 on: July 21, 2015, 03:39:19 am »

I can confirm it doesn't add the unit to civs properly. I'll try stitching this together with the old version and see if it works.
Logged

mifki

  • Bay Watcher
  • works secretly...
    • View Profile
    • mifki
Re: [SUGGESTIONS] for DFhack plugins
« Reply #670 on: July 21, 2015, 03:41:22 am »

I can confirm it doesn't add the unit to civs properly. I'll try stitching this together with the old version and see if it works.

What do you mean? Obviously it doesn't create histfig, so you can't assign to noble positions, etc. I'll look into histfig/nemesis later, maybe there's some code somewhere in the game that we can use.

expwnent

  • Bay Watcher
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #671 on: July 21, 2015, 03:51:53 am »

I haven't done much work on it myself but I'm told that nemesis/histfig stuff is the hardest part to get working properly. As for code in the game you can use, there's always transformation + pregnancy, but that only works on races that can reproduce, it requires a unit to start with who isn't otherwise occupied with anything important, it can only be done across 3-4 frames, and if the game exits halfway through it might do horrible things to the save file.

Still, this helps. I'll keep trying tonight. I might be able to get spawn-unit working from this and the old version.
Logged

mifki

  • Bay Watcher
  • works secretly...
    • View Profile
    • mifki
Re: [SUGGESTIONS] for DFhack plugins
« Reply #672 on: July 21, 2015, 03:57:57 am »

I haven't done much work on it myself but I'm told that nemesis/histfig stuff is the hardest part to get working properly. As for code in the game you can use, there's always transformation + pregnancy, but that only works on races that can reproduce, it requires a unit to start with who isn't otherwise occupied with anything important, it can only be done across 3-4 frames, and if the game exits halfway through it might do horrible things to the save file.

Frames are just calls of viewscreen_dwarfmodest:logic(), we could call that from Lua.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #673 on: July 21, 2015, 04:11:56 am »

I haven't done much work on it myself but I'm told that nemesis/histfig stuff is the hardest part to get working properly. As for code in the game you can use, there's always transformation + pregnancy, but that only works on races that can reproduce, it requires a unit to start with who isn't otherwise occupied with anything important, it can only be done across 3-4 frames, and if the game exits halfway through it might do horrible things to the save file.

Frames are just calls of viewscreen_dwarfmodest:logic(), we could call that from Lua.

expwnent

  • Bay Watcher
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #674 on: July 21, 2015, 05:31:47 am »

Results are promising. I'll try and post a beta version today after some tinkering.
Logged
Pages: 1 ... 43 44 [45] 46 47 ... 61