Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - mifki

Pages: 1 ... 43 44 [45] 46 47 ... 99
661
I think it's a typo, it should be "designation".

662
I think I posted a way to use the built-in name screen to generate random names, this could be incorporated into the create-unit script.

Yeah, here it is (excluding cleanup, etc.)

Code: [Select]
a = df.new(df.viewscreen_setupadventurest) ; a.subscreen = 3 ; gui = require 'gui' ; gui.simulateInput(a, 'A_RANDOM_NAME') ; gui.simulateInput(a, 'A_CUST_NAME') ; print(dfhack.TranslateName(dfhack.gui.getCurViewscreen().name))

663
What is the extra viewscreen_dwarfmodest for?

That makes it so that it works even if the current viewscreen is something else.

That's not required even in this case. Just use df.global.gview.view.child instead of getCurViewscreen() - it will correctly place the new screen on the top of the stack even if the parent screen wasn't on top.
You'd want to make sure that screen is actually a dwarf mode viewscreen, though. (Is this supposed to work in adventure mode?)

In my case it can be dwarf mode only.
Oh, right, if this script is supposed to work in adv mode, then creating a new dwarf mode screen is required.

664
What is the extra viewscreen_dwarfmodest for?

That makes it so that it works even if the current viewscreen is something else.

That's not required even in this case. Just use df.global.gview.view.child instead of getCurViewscreen() - it will correctly place the new screen on the top of the stack even if the parent screen wasn't on top.

Spoiler (click to show/hide)

665
What is the extra viewscreen_dwarfmodest for?

666
DF General Discussion / Re: Future of the Fortress
« on: July 22, 2015, 02:07:19 am »
^Now I'm wondering if it would be possible to put something like the adventurer travel map above the fort mode minimap with dfhack.

This gave me an idea of instantiating an adventure mode screen on top of the fortress screen. It somewhat worked and I was able to walk around, and my dwarves were talking to each other... Most likely useless but very fun.

667
With viewscreen_layer_arena_creaturest approach it's very easy to add equipment.
There are a number of issues with spawning intelligent creatures, at least if you want them to function as citizens of a civ.  The script above (if hacked to allow it) can spawn a new member of the fort, but he/she has no preferences or dreams or relationships.

Spawned creatures can be adopted as pets, so they can make NEW relationships.  The problem is that they start out with a slate that's a bit too blank.

Given those limitations, no one delved into equipment.

New dwarves created with viewscreen_layer_arena_creaturest have preferences.
But no relationships of course because it doesn't create a histfig.  On the other hand, relationships totally depend on what you're creating (civ member, pet, invader), so can't be created fully automatically.

668
With viewscreen_layer_arena_creaturest approach it's very easy to add equipment.

669
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.

670
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.

671
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.

672
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.

673
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!

674
The idea is to make it so that it works better, including nemesis entries. It just doesn't work yet.

Where's the latest version?

675
Oh, is it working now? Are nemesis entries handled? It would be nice to (re?)-add that to DFHack, since a lot of people have asked about it.

taldarus - creating units is not a simple task, largely because DFHack doesn't have access to the code DF uses (and it's unlikely that DF has code to create units from scratch in arbitrary locations in any case).

Can't you use viewscreen_layer_arena_creaturest? It doesn't create hf/nemesis, but seems to do everything else much easier than doing it manually.

I think the current version of the script is at least that functional.

Using the original DF code is just more reliable and much less code to write and maintain.

Pages: 1 ... 43 44 [45] 46 47 ... 99