Bay 12 Games Forum

Please login or register.

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

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

taldarus

  • Bay Watcher
  • Awkward Post Master
    • View Profile
Re: [DFHack] modtools/create-unit (version 0.4) (beta)
« Reply #75 on: September 28, 2015, 09:21:28 pm »

haven't seen anything on this post in a while. was thinking that I should take a swing at this. The spawn unit part works wonderfully, but lacks location. Is there a copy/paste solution to this? Is there some reference material I could use? I have been idling on my personal project for too long, and want to get back to making my race :)

EDIT: I'm an idiot. See the location thing has been added. Going to tinker with it. Thanks expwnent!

You still want feed back I assume?
« Last Edit: September 28, 2015, 11:01:53 pm by taldarus »
Logged

taldarus

  • Bay Watcher
  • Awkward Post Master
    • View Profile
Re: [DFHack] modtools/create-unit (version 0.4) (beta)
« Reply #76 on: September 28, 2015, 11:30:00 pm »

Ok, so in reaction-trigger.lua it is able to pull up the command for the location as job.pos.x, y, z using the -command \\LOCATION, but how do I integrate that with...

Failed attempts:
Spoiler (click to show/hide)

Spoiler (click to show/hide)

Spoiler (click to show/hide)

Spoiler (click to show/hide)

Spoiler (click to show/hide)

I have tried a variety of locations and positions assuming -location [ job.pos.x job.pos.y job.pos.z ] is the correct call for the script. Still nothing. Oh, and I just overwrote ...Hold on, forgot the equip-item.lua (not trying to equip anything, but will check)

Don't see anything (in my obviously "expert" opinion) that says the equip script should be screwing, so I am not testing atm.
« Last Edit: September 29, 2015, 08:23:12 am by taldarus »
Logged

expwnent

  • Bay Watcher
    • View Profile
Re: [DFHack] modtools/create-unit (version 0.4) (beta)
« Reply #77 on: September 29, 2015, 09:25:16 am »

You need to use [ \\LOCATION ]. Something like

Code: [Select]
modtools/reaction-trigger -reactionName T0QUEENEGG -command [ modtools/create-unit -race CHIDDRIN -caste T0QUEEN -civId \\LOCAL -groupId \\LOCAL -name -location [ \\LOCATION ] ]
Logged

taldarus

  • Bay Watcher
  • Awkward Post Master
    • View Profile
Re: [DFHack] modtools/create-unit (version 0.4) (beta)
« Reply #78 on: September 29, 2015, 09:44:00 am »

hmmm, thought I did, let me check real quick.

EDIT:
Yeah, spawn works (many attempts didn't), but spawns in what appears to be the 'default' position.

EDIT2:
Spoiler (click to show/hide)

EDIT3:
Rechecked to make sure my input was correct. Also re-downloaded the reaction-trigger.lua just to be sure I had the most up to date trigger. No luck.

Hopefully this will be helpful.
« Last Edit: September 29, 2015, 07:07:36 pm by taldarus »
Logged

taldarus

  • Bay Watcher
  • Awkward Post Master
    • View Profile
Re: [DFHack] modtools/create-unit (version 0.4) (beta)
« Reply #79 on: September 29, 2015, 09:54:15 pm »

Well, carp...
Thought I would work on my testing my civ's egg producing aspect, but got caught on the that. Hadn't noticed at the time, but civId doesn't seem to be working. Onload reaction and manually created creature where both friendly, but not members.

DFHACK errors:
BOTH:
Create-Unit.lua #274 & 495

ONLOAD:
dfhack.lua #447 & 462
reaction-trigger.lua #107 & 147
Logged

expwnent

  • Bay Watcher
    • View Profile
Re: [DFHack] modtools/create-unit (version 0.4) (beta)
« Reply #80 on: September 30, 2015, 01:48:55 pm »

hmmm, thought I did, let me check real quick.

EDIT:
Yeah, spawn works (many attempts didn't), but spawns in what appears to be the 'default' position.

EDIT2:
Spoiler (click to show/hide)

EDIT3:
Rechecked to make sure my input was correct. Also re-downloaded the reaction-trigger.lua just to be sure I had the most up to date trigger. No luck.

Hopefully this will be helpful.

What's the output of this:

Code: [Select]
modtools/reaction-trigger -reactionName T0QUEENEGG -command [ devel/print-args -race CHIDDRIN -caste T0QUEEN -civId \\LOCAL -groupId \\LOCAL -name -location [ \\LOCATION ] ]
DFHACK errors:
BOTH:
Create-Unit.lua #274 & 495

ONLOAD:
dfhack.lua #447 & 462
reaction-trigger.lua #107 & 147

I don't understand what this means.
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: [DFHack] modtools/create-unit (version 0.4) (beta)
« Reply #81 on: September 30, 2015, 03:02:25 pm »

I assume those are line numbers, but there's more than one error that can occur at a specific line, so it would be helpful to paste the full tracebacks (from stderr.log or the console).
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.

taldarus

  • Bay Watcher
  • Awkward Post Master
    • View Profile
Re: [DFHack] modtools/create-unit (version 0.4) (beta)
« Reply #82 on: September 30, 2015, 05:21:13 pm »

stderr.log output
Spoiler (click to show/hide)
What would seem relevant to me is in bold. Note that that is actually the very first input I used. I do remember that, I do not see any of the ten-fifteen alterations and tests.

console output:
Spoiler (click to show/hide)

Had an idea, would a clean install help?
Logged

expwnent

  • Bay Watcher
    • View Profile
Re: [DFHack] modtools/create-unit (version 0.4) (beta)
« Reply #83 on: September 30, 2015, 07:15:07 pm »

Try this:

Code: [Select]
modtools/reaction-trigger -reactionName T0WORKERNEGG -command [ modtools/create-unit -race CHIDDRIN -caste T0WORKER -civId \\\LOCAL -groupId \\\LOCAL -name -location [ \\LOCATION ] ]
Logged

taldarus

  • Bay Watcher
  • Awkward Post Master
    • View Profile
Re: [DFHack] modtools/create-unit (version 0.4) (beta)
« Reply #84 on: September 30, 2015, 07:26:30 pm »

Absolutely nothing.
Logged

taldarus

  • Bay Watcher
  • Awkward Post Master
    • View Profile
Re: [DFHack] modtools/create-unit (version 0.4) (beta)
« Reply #85 on: September 30, 2015, 07:48:07 pm »

Since that uses ///LOCAL wouldn't I need to change the code?
Logged

expwnent

  • Bay Watcher
    • View Profile
Re: [DFHack] modtools/create-unit (version 0.4) (beta)
« Reply #86 on: September 30, 2015, 07:55:41 pm »

reaction-trigger strips off one of the backslashes before passing it to create-unit so it ought to work.
Logged

taldarus

  • Bay Watcher
  • Awkward Post Master
    • View Profile
Re: [DFHack] modtools/create-unit (version 0.4) (beta)
« Reply #87 on: September 30, 2015, 08:23:32 pm »

It's not even running....

Everything is console of hack is SOP for me, no reaction runs this way.
Spoiler (click to show/hide)

stderr.log
Spoiler (click to show/hide)

Doesn't seem to recognize it.

I went ahead and tried \\\\LOCAL for civId and groupId, same null signal.
Logged

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: [DFHack] modtools/create-unit (version 0.4) (beta)
« Reply #88 on: October 21, 2015, 03:22:26 pm »

The version of the script that I pulled from GitHub had a couple minor errors in it.

I got an error trying to create hostile units, and tracked it down to line 211.  It should read
Code: [Select]
if ( civ_id ) and civ_id ~= -1 thenso that it doesn't try to look up a "real" civ indexed -1.

I also replaced the entire location function with
Code: [Select]
if args.location then
  dfhack.run_command("teleport -unit " .. unitId .. " -x " .. args.location[1] .. " -y " .. args.location[2] .. " -z " .. args.location[3])
end

It now runs without bleeding red all over the console.
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.4) (beta)
« Reply #89 on: October 21, 2015, 03:35:52 pm »

This is probably better, since it avoids potential issues with spaces in the variables being concatenated:
Code: [Select]
dfhack.run_command("teleport", "-unit", unitId, "-x", args.location[1], "-y", args.location[2], "-z", args.location[3])
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.
Pages: 1 ... 4 5 [6] 7 8