Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 78 79 [80] 81 82 ... 360

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

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1185 on: October 23, 2014, 01:13:29 pm »

For those interested, I have written a little function to get the ADV_NAME of each interaction that a unit can do (both via creature/caste interactions, and those granted through syndromes). It will be going in my new unitViewer script, but I seem to remember someone asking for something like this in the past

Code: [Select]
function getTargetInteractions(tar)
 ints = {}
 t_ints = {}
 for i,x in pairs(df.global.world.raws.creatures.all[tonumber(tar.race)].caste[tonumber(tar.caste)].body_info.interactions) do
  s = -1
  check = false
  name = false
  for j,y in pairs(df.global.world.raws.creatures.all[tonumber(tar.race)].raws) do
   if split(y.value,':')[1] == '[CAN_DO_INTERACTION' then
    s = s + 1
    if s == i then
     check = true
    elseif s > i then
     break
    end
   end
   if check then
    if split(y.value,':')[2] == 'ADV_NAME' then
     ints[i+1] = split(split(y.value,':')[3],']')[1]
     name = true
end
   end
  end
  if not name then
   ints[i+1] = 'Unknown'
  end
 end
 if #ints == 0 then
  ints[1] = {'NONE'}
 end
 for i,x in pairs(tar.syndromes.active) do
  for j,y in pairs(df.global.world.raws.syndromes.all[tonumber(x.type)].ce) do
   if y._type == df['creature_interaction_effect_can_do_interactionst'] then
    t_ints[i+1] == y.name
   end
  end
 end
 return ints, t_ints
end
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1186 on: October 23, 2014, 02:11:51 pm »

Hi, I've got a question about DFhack v34.11 (I've still got a Fort left in 0.34)

I've tried activating the gui/assign-rack script but it told me to activate the weaponrack-UNassign binpatch first, when I did it gave me this error.
Now I have to admit that computers, programming etc. are by no means my domain so I wager I'm doing something wrong. However I was unable to find any kind of solution on the internet.
Thanks in advance and apologies if I'm posting this in the wrong place, if this post doesn't belong here then just tell me where to post and I'll delete it.


You can copy text from the DFHack console on Windows by accessing the window's menu (either by clicking in the upper left or upper right corner of the window).

I saw that DFHack generates a few files relating to ghosts:
  • unit_ghost_info.h
  • ghost_goal.h
  • ghost_type.h
Can these somehow be used to modify ghosts and their behavior? I was thinking of making a mod that added friendlier and productive ghosts, but I've read that ghosts are hard-coded and can't be found on the Raws. Is DFHack powerful enough for me to make a ghost mod?
Certainly, although I don't know exactly how much you'd be able to accomplish. Take a look at the tweak plugin (the "clear-ghostly" tweak to be specific) for an example.
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.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1187 on: October 23, 2014, 02:26:31 pm »

For those interested, I have written a little function to get the ADV_NAME of each interaction that a unit can do (both via creature/caste interactions, and those granted through syndromes). It will be going in my new unitViewer script, but I seem to remember someone asking for something like this in the past

-snip-

Wow that's cool!

...

You really need to work on variable names, though, heh. I can't read that at all.

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1188 on: October 23, 2014, 02:53:10 pm »

For those interested, I have written a little function to get the ADV_NAME of each interaction that a unit can do (both via creature/caste interactions, and those granted through syndromes). It will be going in my new unitViewer script, but I seem to remember someone asking for something like this in the past

-snip-

Wow that's cool!

...

You really need to work on variable names, though, heh. I can't read that at all.

NEVAR!

But yes, on a serious note, I really do. I get yelled at about it all the time for work, don't know what my problem with proper variable naming is... This code is actually pretty good compared to some of my others (like the one you saw with ddtot and such). ints = interactions, t_ints = temporary_interactions
Logged

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1189 on: October 23, 2014, 02:59:26 pm »

For those interested, I have written a little function to get the ADV_NAME of each interaction that a unit can do (both via creature/caste interactions, and those granted through syndromes). It will be going in my new unitViewer script, but I seem to remember someone asking for something like this in the past

-snip-

Wow that's cool!

...

You really need to work on variable names, though, heh. I can't read that at all.

NEVAR!

But yes, on a serious note, I really do. I get yelled at about it all the time for work, don't know what my problem with proper variable naming is... This code is actually pretty good compared to some of my others (like the one you saw with ddtot and such). ints = interactions, t_ints = temporary_interactions
There is a way to fix unclear variable names.  CTRL-H.
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

heydude6

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1190 on: October 23, 2014, 07:09:44 pm »

This is a dumb question but what does ctrl-H do?
Logged
Lets use the ancient naval art of training war parrots. No one will realize they have been boarded by space war parrots until it is to late!
You can fake being able to run on water. You can't fake looking cool when you break your foot on a door and hit your head on the floor.

LeoCean

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1191 on: October 23, 2014, 08:07:07 pm »

This is a dumb question but what does ctrl-H do?

Likely in notepad++ or some other file reader, nothing to do with dwarf fortress per se.
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1192 on: October 23, 2014, 08:32:51 pm »

What does it do?

Is it an autocomplete hotkey or summat?

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1193 on: October 23, 2014, 09:02:21 pm »

What does it do?

Is it an autocomplete hotkey or summat?
It's the standard shortcut key for search-and-replace.
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

WillowLuman

  • Bay Watcher
  • They/Them Life is weird
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1194 on: October 23, 2014, 10:22:12 pm »

How does one mess with lua in this version? unit=dfhack.gui.getSelectedUnit() does not seem to work ingame anymore.
Logged
Dwarf Souls: Prepare to Mine
Keep Me Safe - A Girl and Her Computer (Illustrated Game)
Darkest Garden - Illustrated game. - What mysteries lie in the abandoned dark?

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1195 on: October 23, 2014, 10:25:09 pm »

? It should.

WillowLuman

  • Bay Watcher
  • They/Them Life is weird
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1196 on: October 23, 2014, 10:25:45 pm »

Nevermind, I miscapitalized.
Logged
Dwarf Souls: Prepare to Mine
Keep Me Safe - A Girl and Her Computer (Illustrated Game)
Darkest Garden - Illustrated game. - What mysteries lie in the abandoned dark?

TheDorf

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1197 on: October 24, 2014, 03:13:37 am »

How would I go about using hotkeys to launch custom scripts?

Also, how would I go about simulating pressing the "Esc" key, or any other key for that matter? Would this be possible in LUA, or would I have to develop a c++ plugin?
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 #1198 on: October 24, 2014, 03:18:04 am »

Custom scripts are treated as DFHack commands exactly like normal scripts (mostly because there's no difference whatsoever between custom scripts and included ones), so do it the same way you see other keybindings done in the init.

I ain't posting the whole documentation on the topic here, so search "simulateInput" here
« Last Edit: October 24, 2014, 03:25:38 am by Putnam »
Logged

TheDorf

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.13-r1
« Reply #1199 on: October 24, 2014, 03:24:30 am »

Custom scripts are treated as DFHack commands exactly like normal scripts, so do it the same way you see other keybindings done in the init.

I ain't posting the whole documentation on the topic here, so search "simulateInput" here
Thank you so much! :D
« Last Edit: October 24, 2014, 03:49:06 am 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 ... 78 79 [80] 81 82 ... 360