Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 65 66 [67] 68 69 ... 360

Author Topic: DFHack 0.43.03-r1  (Read 1087185 times)

PeridexisErrant

  • Bay Watcher
  • Dai stihó, Hrasht.
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #990 on: September 24, 2014, 06:15:38 am »

Awesome, I've got it working - just went through changing the viewscreen values set to 0 and when it moved the cursor that worked. 

Incidentally, vs.anon_21 controls which item (sites, hist figs, structures, etc) is selected in the main legends mode view.  I've stuck it in for now, but once a name is assigned it'll need to change.

Spoiler: new exportlegends.lua (click to show/hide)
Logged
I maintain the DF Starter Pack - over a million downloads and still counting!
 Donations here.

Trouserman

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #991 on: September 24, 2014, 08:15:57 am »

You might want to make vs local ("local vs =" instead of just "vs =") there, since it's in a function and all. Just good practice in programming.

So, Lua isn't lexically scoped by default? I haven't really had a look at the language yet, but that's... disappointing.
Logged

expwnent

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #992 on: September 24, 2014, 09:11:35 am »

A lot of things about Lua are disappointing.
Logged

TheDorf

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #993 on: September 24, 2014, 09:17:54 am »

I'm feeling really confused about this whole onLoad.init file thing...

Am I supposed to place it in Dwarf Fortress 0.40.13\raw? This is what I did, but I can't seem to get it to work. I'm using PeridexisErran't DF Starter pack if that changes anything.

The thing is, there is a dfhack.init file in the main dwarf fortress folder, as well as a LNP_dfhack_onLoad.init file. The download didn't seem to come with any onLoad.init file, so I created one in the \raw folder, and it seems to be copied to any new worlds I create, just like I believe it should. But it just doesn't seem to work.

It could simply be that I failed with the syntax of launching the scripts, but I do believe I have the right syntax.

Spoiler (click to show/hide)
Logged
I love this community. Somebody asks "hay guise how do i tame shark", and then everybody is like "why don't we fling sharks at things with complex mechanical devices?".

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: DFHack 0.40.13-r1
« Reply #994 on: September 24, 2014, 10:04:22 am »

Code: (In my Wizard Creature's raws) [Select]
[CAN_DO_INTERACTION:CONJURE]
[CDI:ADV_NAME:Conjure Bound Dagger]
(CDI:INTERACTION:CONJURE)
[CDI:TARGET:A:SELF_ONLY]
[CDI:MAX_TARGET_NUMBER:A:1]
[CDI:VERB:conjure a bound dagger:conjures a bound dagger:NA]
[CDI:WAIT_PERIOD:86400]
Not sure if this is the problem, but "(CDI:INTERACTION:CONJURE)" is not the same as "[CDI:INTERACTION:CONJURE]".
Logged
P.S. If you don't get this note, let me know and I'll write you another.
It's amazing how dwarves can make a stack of bones completely waterproof and magmaproof.
It's amazing how they can make an entire floodgate out of the bones of 2 cats.

TheDorf

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #995 on: September 24, 2014, 10:25:07 am »

Code: (In my Wizard Creature's raws) [Select]
[CAN_DO_INTERACTION:CONJURE]
[CDI:ADV_NAME:Conjure Bound Dagger]
(CDI:INTERACTION:CONJURE)
[CDI:TARGET:A:SELF_ONLY]
[CDI:MAX_TARGET_NUMBER:A:1]
[CDI:VERB:conjure a bound dagger:conjures a bound dagger:NA]
[CDI:WAIT_PERIOD:86400]
Not sure if this is the problem, but "(CDI:INTERACTION:CONJURE)" is not the same as "[CDI:INTERACTION:CONJURE]".

Yeah, I tried with the [] before, but then I "commented" the line out because I believe the CDI:INTERACTION token is only required in syndromes that allow the interaction. Thanks though :)
The verb prints out nicely and everything, so I'm pretty sure I've got bad syntax in my onLoad.init, or I've put the onLoad.init in the wrong place or something like that.
Logged
I love this community. Somebody asks "hay guise how do i tame shark", and then everybody is like "why don't we fling sharks at things with complex mechanical devices?".

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: DFHack 0.40.13-r1
« Reply #996 on: September 24, 2014, 12:28:49 pm »

I'm pretty sure I've got bad syntax in my onLoad.init, or I've put the onLoad.init in the wrong place or something like that.
What happens if you load the game and then manually copy/paste the contents of onLoad.init into the DFHack console window?

If it works, then onLoad.init isn't being run; if it doesn't work, then you've got a syntax error.
Logged
P.S. If you don't get this note, let me know and I'll write you another.
It's amazing how dwarves can make a stack of bones completely waterproof and magmaproof.
It's amazing how they can make an entire floodgate out of the bones of 2 cats.

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #997 on: September 24, 2014, 12:46:07 pm »

You can also invoke devel/print-args (e.g. "devel/print-args test") in onLoad.init to display a message if/when onLoad.init is run.
Also, have you verified that the file was saved as "onLoad.init" and not "onLoad.init.txt"?
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.

TheDorf

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #998 on: September 24, 2014, 01:10:12 pm »

You can also invoke devel/print-args (e.g. "devel/print-args test") in onLoad.init to display a message if/when onLoad.init is run.
Also, have you verified that the file was saved as "onLoad.init" and not "onLoad.init.txt"?

Thank you guys.

Spoiler (click to show/hide)

devel/print-args seems to be working, and nothing happens when I copy-paste the lua code into DFHack, so I guess I've got a bunch of syntax errors in every single line, seeing as none of them work :c You guys wouldn't happen to know what "too few actors" means? Every now and then, the following generates that message:
Code: [Select]
[CDI:VERB:conjure a bound dagger:conjures a bound dagger:NA]
Code: [Select]
modtools/interaction-trigger -onAttackStr "conjure a bound dagger" -command [ item/create -unit \\ATTACKER_ID -item WEAPON:ITEM_WEAPON_DAGGER_BOUND -mat SOUL_BOUND -inventory -dur 86400 ]
I've also tried
Code: [Select]
[CDI:VERB:summons a steel sword:summons a steel sword:summons a steel sword]
Code: [Select]
modtools/interaction-trigger -onAttackStr "summons a steel sword" -command [ item/create -unit \\ATTACKER_ID -item WEAPON:ITEM_WEAPON_SWORD -mat STEEL -inventory ]which is code given to me by roses, but I can't get that to work either. :s
Logged
I love this community. Somebody asks "hay guise how do i tame shark", and then everybody is like "why don't we fling sharks at things with complex mechanical devices?".

expwnent

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #999 on: September 24, 2014, 01:37:57 pm »

Too few actors is something EventManager prints when it can figure out either the attacker or the defender but not both. Can you figure out what makes that happen?

Heh. I might have been silly and not tested self-interactions. Does it work if you cast it on someone else?
Logged

TheDorf

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1000 on: September 24, 2014, 01:53:50 pm »

Too few actors is something EventManager prints when it can figure out either the attacker or the defender but not both. Can you figure out what makes that happen?

Heh. I might have been silly and not tested self-interactions. Does it work if you cast it on someone else?

I'm sorry, but I don't think I'd be able to. I can't seem to figure anything out at all xD

Well, the error is a bit weird, it seems to just show up really rarely. Casting on others doesn't seem to work either, but that hasn't generated any errors so far.


Edit: Got the error when casting on someone else. Also tried a bunch of different settings for the summoning of a steel sword.

Spoiler (click to show/hide)

« Last Edit: September 24, 2014, 02:12:33 pm by TheDorf »
Logged
I love this community. Somebody asks "hay guise how do i tame shark", and then everybody is like "why don't we fling sharks at things with complex mechanical devices?".

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1001 on: September 24, 2014, 02:22:55 pm »

Too few actors is something EventManager prints when it can figure out either the attacker or the defender but not both. Can you figure out what makes that happen?

Heh. I might have been silly and not tested self-interactions. Does it work if you cast it on someone else?

I get it fairly consistently with announcements made by interactions that use VERBAL_SPEECH, since those don't actually have attackers/defenders.

expwnent

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1002 on: September 24, 2014, 02:27:09 pm »

I forget but I might have set it up so it only prints the message once per run of DF, which makes it really awkward to test.
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1003 on: September 24, 2014, 02:28:09 pm »

Good thing VERBAL_SPEECH points to a text file and takes lines from it at random.

Try out, say, Fortbent, where there are a few creatures (ebubbles) that have hundreds of lines in their verbal_speech files for their interactions.

TheDorf

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1004 on: September 24, 2014, 02:34:51 pm »

I forget but I might have set it up so it only prints the message once per run of DF, which makes it really awkward to test.

Yeah, this seems to be the case.

I just don't get why it doesn't work though... I've tried making it only possible to cast it on myself, I've tried casting on others, I have 12 different lines attempting to do very similar things. I've even gotten an example from the author of the script, but I can't even get that to work.

Does anyone have a working spell that uses create-item.lua? If anyone does, it would be greatly appreciated if you could share the onLoad.init, the interaction and the creature files with me. I'm starting to feel like giving up. :c

Good thing VERBAL_SPEECH points to a text file and takes lines from it at random.

Try out, say, Fortbent, where there are a few creatures (ebubbles) that have hundreds of lines in their verbal_speech files for their interactions.

Not sure if this was aimed at me, but I have no idea how to use VERBAL_SPEECH (or apparently anything else, for that matter) in scripts O_o



Edit: I remember reading something about activating the triggers somewhere (Something like "enable interaction-trigger"). Does this still have to be done? If yes, what exactly do I need to type?
« Last Edit: September 24, 2014, 02:39:48 pm by TheDorf »
Logged
I love this community. Somebody asks "hay guise how do i tame shark", and then everybody is like "why don't we fling sharks at things with complex mechanical devices?".
Pages: 1 ... 65 66 [67] 68 69 ... 360