Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2] 3 4 ... 8

Author Topic: [DFHack] modtools/create-unit (version 0.4) (beta)  (Read 30830 times)

mifki

  • Bay Watcher
  • works secretly...
    • View Profile
    • mifki
Re: [DFHack] modtools/create-unit (version 0.1) (beta)
« Reply #15 on: July 22, 2015, 05:33:45 pm »

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)

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: [DFHack] modtools/create-unit (version 0.1) (beta)
« Reply #16 on: July 22, 2015, 07:03:37 pm »

Dirst: that's quite reasonable. I'll have to be careful it computes size correctly for different ages because that's important for combat. I probably won't bother making things like hair length be age appropriate unless someone really wants it.
It'd be fine for an initial version to only work for adults, the creatures I mentioned are full-sized from day 0.

Child sizes are tricky because growth is linear during the growth stage, rather than just a step function.
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] modtools/create-unit (version 0.1) (beta)
« Reply #17 on: July 22, 2015, 08:35:29 pm »

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?)
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.

mifki

  • Bay Watcher
  • works secretly...
    • View Profile
    • mifki
Re: [DFHack] modtools/create-unit (version 0.1) (beta)
« Reply #18 on: July 22, 2015, 08:56:42 pm »

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.

taldarus

  • Bay Watcher
  • Awkward Post Master
    • View Profile
Re: [DFHack] modtools/create-unit (version 0.1) (beta)
« Reply #19 on: July 23, 2015, 12:07:58 am »

Spawned a Hydra, worked fine.

Trying to spawn a civilian. Got an error about arg5 civ_id in function 'processArgs' and in main chunk.

Saw something about this in the post, tried with \\LOCAL and \LOCAL, using my custom race atm. Will revert to standard dwarfs later to verify it's not my boys. Pretty sure I tried it with dwarfs hours ago, but can't remember (at the time, I thought I was messing up how to use the code)

Seems to be universal error, got it for the dog too.

ADDM: Used in arena crashed df and hack.
« Last Edit: July 23, 2015, 12:15:52 am by taldarus »
Logged

expwnent

  • Bay Watcher
    • View Profile
Re: [DFHack] modtools/create-unit (version 0.1) (beta)
« Reply #20 on: July 23, 2015, 01:07:04 am »

In later versions it will work in all modes. Currently it only works in dwarf mode.

Try civId and groupId instead of civ_id and group_id. A bug in the documentation.
Logged

taldarus

  • Bay Watcher
  • Awkward Post Master
    • View Profile
Re: [DFHack] modtools/create-unit (version 0.1) (beta)
« Reply #21 on: July 23, 2015, 02:03:26 am »

Perfect!

Spawned me a Queen & Soldier! They are, however, not actually my civilians. Both fall into the 'Other' category and are classified as friendlies.

Gonna try a friendly hydra.

Is there a way to automate this? I read through all material I could find, but no luck. I assume its something you need to introduce into the scripts code?
« Last Edit: July 23, 2015, 02:05:12 am by taldarus »
Logged

expwnent

  • Bay Watcher
    • View Profile
Re: [DFHack] modtools/create-unit (version 0.1) (beta)
« Reply #22 on: July 23, 2015, 02:04:55 am »

Try setting both civId and groupId to \\LOCAL.
Logged

taldarus

  • Bay Watcher
  • Awkward Post Master
    • View Profile
Re: [DFHack] modtools/create-unit (version 0.1) (beta)
« Reply #23 on: July 23, 2015, 02:09:37 am »

Command used: modtools/create-unit -race CHIDDRIN -caste T0QUEEN -civId \\LOCAL -groupId \\LOCAL

I don't see/understand the difference.

EDIT: Changed GroupID to correct form GroupId
« Last Edit: July 23, 2015, 02:14:54 am by taldarus »
Logged

expwnent

  • Bay Watcher
    • View Profile
Re: [DFHack] modtools/create-unit (version 0.1) (beta)
« Reply #24 on: July 23, 2015, 02:12:00 am »

That command should work, except you need groupId instead of groupID (but it would have complained if you did that wrong).

The difference between what?
Logged

taldarus

  • Bay Watcher
  • Awkward Post Master
    • View Profile
Re: [DFHack] modtools/create-unit (version 0.1) (beta)
« Reply #25 on: July 23, 2015, 02:14:03 am »

Spawned me a Queen & Soldier! They are, however, not actually my civilians. Both fall into the 'Other' category and are classified as friendlies.

then you said

Try setting both civId and groupId to \\LOCAL.

But I already did that, so I don't see how this would help.
Logged

expwnent

  • Bay Watcher
    • View Profile
Re: [DFHack] modtools/create-unit (version 0.1) (beta)
« Reply #26 on: July 23, 2015, 02:16:00 am »

If you just set civId then they'll be members of your civilization but not members of your fort. They *should* be members of both if you use both -civId \\LOCAL and -groupId \\LOCAL, but it's possible it isn't working correctly. It seems to work fine for dwarves in vanilla.
Logged

taldarus

  • Bay Watcher
  • Awkward Post Master
    • View Profile
Re: [DFHack] modtools/create-unit (version 0.1) (beta)
« Reply #27 on: July 23, 2015, 02:17:46 am »

ah, ok, suggestions?

Edit: Added Hydra as a pet, it worked right up until I unpaused the game.

Stray Hydra and all. When game started to run, it froze immediately, and then crashed shortly after. An error box appeared, but disappeared before I could read it. DF error log is clean of any reference, but I doubt a dfhack error shows there.

Edit2: Oh, both civ members names are just numbers, I can give them if you want. Anything else you want tested?

Edit3: Tried adding the -flags tag to my race. It came up with this error:
bad argument #1 to 'ipairs' (table expected, got string)
stack traceback:
  [C]: in function 'ipairs'
...modtools/create-unit.lua:312: in main chunk
« Last Edit: July 23, 2015, 02:32:21 am by taldarus »
Logged

expwnent

  • Bay Watcher
    • View Profile
Re: [DFHack] modtools/create-unit (version 0.2) (beta)
« Reply #28 on: July 23, 2015, 02:36:56 am »

Try version 0.2. It supports random civilization-appropriate names.

For the flags argument you need to do it like

-flags [ flag1 flag2 ]

and even if there's just one flag you have to do -flags [ flagName ]
« Last Edit: July 23, 2015, 02:42:40 am by expwnent »
Logged

taldarus

  • Bay Watcher
  • Awkward Post Master
    • View Profile
Re: [DFHack] modtools/create-unit (version 0.2) (beta)
« Reply #29 on: July 23, 2015, 02:54:57 am »

You sir are a scripting machine, vn!

Name is now 'blank', or I assume it is blank (Just says Peasant). I haven't spent any time working on the entity file, I just strip mined the dwarf one for pieces I wanted.

Still reads as friendly, not a civ member...

Tested saving and loading, looks secure...

Tested dog, in order to verify it is my race...and the dog shows up as a tame stray dog... forgot to have loo(k)ed when i did it, but he shows in the unit list. So it's my race

tried to add entity and creature, but its too many characters...
Logged
Pages: 1 [2] 3 4 ... 8