Bay 12 Games Forum

Please login or register.

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

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

mifki

  • Bay Watcher
  • works secretly...
    • View Profile
    • mifki
Re: [DFHack] modtools/create-unit (version 0.3.1) (beta)
« Reply #45 on: July 24, 2015, 02:35:40 am »

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

expwnent

  • Bay Watcher
    • View Profile
Re: [DFHack] modtools/create-unit (version 0.3.1) (beta)
« Reply #46 on: July 24, 2015, 03:38:38 am »

Random civilization-appropriate names are already implemented.
Logged

Roses

  • Bay Watcher
    • View Profile
Re: [DFHack] modtools/create-unit (version 0.3.1) (beta)
« Reply #47 on: July 24, 2015, 05:33:54 am »

Did some basic testing so far everything is going well. Thin I ask going to write some scripts to handle specific instances like summoning familiars and making them pets of the summoner.

Question. Any idea why megabeasts aren't made friendly?
Logged

expwnent

  • Bay Watcher
    • View Profile
Re: [DFHack] modtools/create-unit (version 0.3.1) (beta)
« Reply #48 on: July 24, 2015, 05:35:29 am »

Actually, yes! It has to do with their flags. Hydras have the resident flag set which makes them hostile even if they're domesticated and civ members and fort members. I'll do a quick patch to let you clear flags with the command line instead of just set them.
Logged

expwnent

  • Bay Watcher
    • View Profile
Re: [DFHack] modtools/create-unit (version 0.3.2) (beta)
« Reply #49 on: July 24, 2015, 05:46:08 am »

Patched. Experiment thoroughly with flags.
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: [DFHack] modtools/create-unit (version 0.3.2) (beta)
« Reply #50 on: July 24, 2015, 05:47:12 am »

Random civilization-appropriate names are already implemented.
And for non-civ members? I play dwarves, spawn 10 hostile bears. These should have no names. I spawn 10 bandits, these should have names, but are not necessarily members of the human civ.

Sorry if I make it more complicated, if it's nonsense, just tell me. I'll life, even without fancy naming schemes. ;)
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: [DFHack] modtools/create-unit (version 0.3.2) (beta)
« Reply #51 on: July 24, 2015, 06:04:48 am »

You can already spawn nameless ones (I think). I'll tweak it so if you want names you can specify what civ their names come from independently of the civ they are a member of (if any).
« Last Edit: July 24, 2015, 06:08:03 am by expwnent »
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: [DFHack] modtools/create-unit (version 0.3.2) (beta)
« Reply #52 on: July 24, 2015, 06:18:26 am »

Thank you for indulging me.  :)
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: [DFHack] modtools/create-unit (version 0.3.2) (beta)
« Reply #53 on: July 24, 2015, 06:26:53 am »

In this case it's actually pretty easy. Equipment is slightly trickier. I'll do that next.
Logged

taldarus

  • Bay Watcher
  • Awkward Post Master
    • View Profile
Re: [DFHack] modtools/create-unit (version 0.3.2) (beta)
« Reply #54 on: July 24, 2015, 06:38:22 am »

Meph: Just add the -name tag to the end and it should work fine.

Expwnent: No names work for the first one, but the later ones revert to the screwy number system. Also the hydra earned its name, I think, and that was a screwy number

Edit: Forgot why I got on, still haven't gotten a 100% straight answer on this. Cna I try connecting this code to a workshop reaction, or is that something to be implemented?
« Last Edit: July 24, 2015, 06:41:32 am by taldarus »
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: [DFHack] modtools/create-unit (version 0.3.2) (beta)
« Reply #55 on: July 24, 2015, 06:44:06 am »

Adding it to a workshop is easy, I did that A LOT with even the old spawnunit. You just have the reaction call the script, with a line in the onLoad.init in the DwarfFortress/raw folder.
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 :::

Roses

  • Bay Watcher
    • View Profile
Re: [DFHack] modtools/create-unit (version 0.3.2) (beta)
« Reply #56 on: July 24, 2015, 06:47:01 am »

In this case it's actually pretty easy. Equipment is slightly trickier. I'll do that next.

For equipment I use to have a script that selected a random weapon available to a given civ but I can't seem to find it, I'll see if it's somewhere around. Are you planning on allowing random equipment and user defined equipment?

Edit: look up reaction-trigger
« Last Edit: July 24, 2015, 06:49:10 am by Roses »
Logged

taldarus

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

ty meph!

EDIT: Expwnent, you said to test tags thoroughly, any in particular? (I don't plan on needing to use any for my current project)
« Last Edit: July 24, 2015, 06:57:40 am by taldarus »
Logged

expwnent

  • Bay Watcher
    • View Profile
Re: [DFHack] modtools/create-unit (version 0.3.2) (beta)
« Reply #58 on: July 24, 2015, 09:47:18 am »

I mean, it should work, I just meant that you should make sure you figure out the right flags to set for various things, like how domesticated hydras need the resident flag cleared.
Logged

taldarus

  • Bay Watcher
  • Awkward Post Master
    • View Profile
Re: [DFHack] modtools/create-unit (version 0.3.2) (beta)
« Reply #59 on: July 24, 2015, 10:56:55 pm »

Ok, ran into several small errors that I already fixed on my end. Now, I am looking at the errors in the dfhack screen. It seems to be the problem.

\lua\utils.lua:595: error: invalid arg: 1: reactionName
stacktaceback: modtools/create-unit.lua:313: in main chunk

despite tweaking several different values on my end, but can't find anything to get it working.

onload.init
Spoiler (click to show/hide)

reaction.txt
Spoiler (click to show/hide)

Despite the changes, I am still getting the same error...

EDIT: Cleaned up another awkward post.
« Last Edit: July 25, 2015, 03:59:04 am by taldarus »
Logged
Pages: 1 2 3 [4] 5 6 ... 8