Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 35 36 [37] 38 39 ... 44

Author Topic: Putnam's DFHack scripts  (Read 120405 times)

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: Putnam's DFHack scripts
« Reply #540 on: June 30, 2014, 01:18:20 am »

I have a question about the spawnunit script.  I'm trying to make a stripped-down version that spawns an animal that doesn't need to be a historical figure.  This will eventually get tucked into a SyndromeTrigger from mining special minerals.

My first question is: since I'm doing my troubleshooting in the arena, are there any important differences?  Should I just torture a test fort instead?

My second question is: what can be stripped out if I don't want it to be a historical figure (at least until it racks up notable kills)?

My third question is: how do I get generic names? Setting u.name.has_name = false gives the creature a blank name.  The blank sows up on the units screen, in announcements and combat logs, etc.  I'd love to find out this is just a quirk of the arena, but checking just in case.  Ideally, I'd like the Dwarves to be able to give the thing a name if it makes itself bothersome enough (which I'm guessing also makes it a historical figure?).

After the encounter with blanks, I hacked in some text manipulation to use the caste name as a creature name.  That causes me to get reports like The Awakened Granite Awakened Granite is fighting!
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

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Putnam's DFHack scripts
« Reply #541 on: June 30, 2014, 09:23:33 am »

Spawnunit is:

1. Not really mine
2. Has a better version in r5.

Better to post it in the topic.

The blank name thing is a quirk of the arena, though. Spawnunit shouldn't be making hist figures.

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: Putnam's DFHack scripts
« Reply #542 on: June 30, 2014, 09:54:05 am »

Spawnunit is:

1. Not really mine
2. Has a better version in r5.

Better to post it in the topic.

The blank name thing is a quirk of the arena, though. Spawnunit shouldn't be making hist figures.
If you are using spawnunit from this gist then it does create nemesis. It can be changed by adding an argument (true) to the list in the call to skip nemesis/hist-figure creation.

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: Putnam's DFHack scripts
« Reply #543 on: July 01, 2014, 01:22:40 pm »

Spawnunit is:

1. Not really mine
2. Has a better version in r5.

Better to post it in the topic.

The blank name thing is a quirk of the arena, though. Spawnunit shouldn't be making hist figures.
If you are using spawnunit from this gist then it does create nemesis. It can be changed by adding an argument (true) to the list in the call to skip nemesis/hist-figure creation.
Thanks.  Yes, that looks like the meat of Putnam's script; he'd added bits to allow for SyndromeTriggers and such that I plan to use.  I needed to change the anon_4 and anon_5 to make it work under r5.  If I'm going to be mucking around inside the script I should probably use one that was built from the ground up to be in r5.  I just can't seem to find it :(
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

fitzitz

  • Bay Watcher
    • View Profile
Re: Putnam's DFHack scripts
« Reply #544 on: July 15, 2014, 10:41:11 pm »

Can  anyone help? I keep trying to force migrants to come on (Im using masterwork) and have tested on multiple saves, new regions, different races (IE Orcs, Dwarves and Kobold, so nothing that you would expect issues with), but I keep getting this error over and over:

[DFHack]# force migrants MOUNTAIN
...s\MasterworkDF V4j\Dwarf Fortress\hack\scripts/force.lua:59: Cannot read fiel
d vector<historical_entity*>.1699: index out of bounds.
stack traceback:
        [C]: in function '__index'
        ...s\MasterworkDF V4j\Dwarf Fortress\hack\scripts/force.lua:59: in funct
ion 'force_migrants'
        ...s\MasterworkDF V4j\Dwarf Fortress\hack\scripts/force.lua:93: in main
chunk
        (...tail calls...)
[DFHack]# force migrants player
...s\MasterworkDF V4j\Dwarf Fortress\hack\scripts/force.lua:19: Cannot read fiel
d vector<historical_entity*>.1699: index out of bounds.
stack traceback:
        [C]: in function '__index'
        ...s\MasterworkDF V4j\Dwarf Fortress\hack\scripts/force.lua:19: in main
chunk
        (...tail calls...)


Anyone know what is up with it?
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Putnam's DFHack scripts
« Reply #545 on: July 15, 2014, 10:48:00 pm »

I was still using that stupid crap instead of the nice in-engine stuff? Here's an updated version.

fitzitz

  • Bay Watcher
    • View Profile
Re: Putnam's DFHack scripts
« Reply #546 on: July 15, 2014, 11:23:27 pm »

Now it says this


[DFHack]# force migrants TAIGA
...ames\MasterworkDF V4j\Dwarf Fortress\hack\lua\dfhack.lua:354: ...s\Masterwork
DF V4j\Dwarf Fortress\hack\scripts/force.lua:57: '}' expected (to close '{' at l
ine 52) near 'migrants'
stack traceback:
        [C]: in function 'error'
        ...ames\MasterworkDF V4j\Dwarf Fortress\hack\lua\dfhack.lua:354: in func
tion <...ames\MasterworkDF V4j\Dwarf Fortress\hack\lua\dfhack.lua:344>
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Putnam's DFHack scripts
« Reply #547 on: July 16, 2014, 01:49:11 am »

...try that updated version again. Seriously, does nobody update these scripts when I do? That's an egregious syntax error. I mean, yeah, the error is definitely my fault, but nobody said anything until you showed up!

fitzitz

  • Bay Watcher
    • View Profile
Re: Putnam's DFHack scripts
« Reply #548 on: July 16, 2014, 03:16:33 am »

I know! I spent a few days searching, just to make sure I wasn't doing something stupid, and yet there was nothing about it (not this particular issue anyway XD).

Anyway, now it says

[DFHack]# force migrants TAIGA
...s\MasterworkDF V4j\Dwarf Fortress\hack\scripts/force.lua:77: attempt to index
 global 'allEventTypes' (a nil value)
stack traceback:
        ...s\MasterworkDF V4j\Dwarf Fortress\hack\scripts/force.lua:77: in main
chunk
        (...tail calls...)
Logged

fitzitz

  • Bay Watcher
    • View Profile
Re: Putnam's DFHack scripts
« Reply #549 on: July 16, 2014, 10:08:39 am »

Anyone know why it is doing this? I suck at coding, so I have little to no idea about what is going on -_-
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Putnam's DFHack scripts
« Reply #550 on: July 16, 2014, 12:51:19 pm »

fitzitz

  • Bay Watcher
    • View Profile
Re: Putnam's DFHack scripts
« Reply #551 on: July 17, 2014, 05:24:43 am »

It still comes up with the same error ;_;
Logged

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: Putnam's DFHack scripts
« Reply #552 on: July 17, 2014, 05:33:24 am »

...try it now -.-
You cannot reference the table while it's constructing i.e. it does not exist at that point.
i suggest predefining:
Code: [Select]
local function ev_mischevousbeast()
    df.global.timed_events:insert('#', { new = df.timed_event, type = df.timed_event_type.WildlifeMichievous, season = df.global.cur_season, season_ticks = df.global.cur_season_tick } )
end
--and then later:
mischevousbeast=ev_mischevousbeast,
mischeviousbeast=ev_mischevousbeast,
« Last Edit: July 17, 2014, 05:35:30 am by Warmist »
Logged

fitzitz

  • Bay Watcher
    • View Profile
Re: Putnam's DFHack scripts
« Reply #553 on: July 17, 2014, 05:54:35 am »

But why does the error with the mischievous beast part stop me from forcing migrants or caravans?
Logged

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: Putnam's DFHack scripts
« Reply #554 on: July 17, 2014, 06:22:22 am »

But why does the error with the mischievous beast part stop me from forcing migrants or caravans?
The lua engine must read the file and load it so it can run. When first reading it finds a major error (according to lua) and thus fails loading the file itself and you don't get any functionality at all. Simplest workaround: remove line
Code: [Select]
mischeviousbeast=allEventTypes[mischievousbeast],
Pages: 1 ... 35 36 [37] 38 39 ... 44