Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 109 110 [111] 112 113 ... 373

Author Topic: DFHack 0.34.11 r3  (Read 1441339 times)

vjek

  • Bay Watcher
  • If it didn't work, change the world so it does.
    • View Profile
Re: DFHack 0.34.10 r1
« Reply #1650 on: May 30, 2012, 09:47:02 am »

...
But  "put it into the dfhack scripts directory" mean what? I don't know about dfhack scripts directory,where can I find it? ...

For 34.10 (not sure about .09 and .08) after you uncompress dfhack into the DF directory, it creates a \hack\ directory.

Within \hack\, there is another directory, called \scripts\

Within \scripts\ there are a few .lua files.  If you place it there, you can call it without manually specificying ' lua scriptname.lua' although that will still work.

You can just use the scriptname without the extension, directly from the [DFHack]# prompt.

So if you extracted DF 34.10 into c:\df_34_10_win, and uncompressed dfhack into that directory, you would put the script at:

c:\df_34_10_win\hack\scripts\make_legendary.lua

Then, for example:

[DFHack]# make_legendary MINING
amost is now a Legendary Miner
[DFHack]#


Easy! :)  And your script looks great, it's good to see people writing more code!

zkm2erjfdb

  • Escaped Lunatic
    • View Profile
Re: DFHack 0.34.10 r1
« Reply #1651 on: May 30, 2012, 10:54:08 am »

Within \scripts\ there are a few .lua files.  If you place it there, you can call it without manually specificying ' lua scriptname.lua' although that will still work.
Great!I have done something unnecessary to make so many part in one file.With \scripts\ I can make my code look like the part of DFHack.with out .lua  so great.
And from
Everybody with an older fortress that begins to slow down could try this for a potential 5-10% increase in fps:
I learn: df.global.world.units.all,why I didn't find this function before.It makes my code work better!
Today is a great day.I go to sleep now. :D
!!!Why? I find Console.* don't work in /scripts/   like Console.lineedit()
But it works when use lua skill.lua to run .

So I change them into dfhack.*
I find it works,but is it standard?
I find Utility:DFusionin wiki, I can't understand FunctionCall. yet.
« Last Edit: May 31, 2012, 07:49:47 am by zkm2erjfdb »
Logged

ag

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.10 r1
« Reply #1652 on: May 31, 2012, 02:30:41 am »

!!!Why? I find Console.* don't work in /scripts/   like Console.lineedit()
But it works when use lua skill.lua to run .

So I change them into dfhack.*

Because Console stuff is part of dfusion, which is still not completely merged into the new lua interface, and uses its own interpreter instance. The 'lua' command is also part of dfusion and uses its interpreter, while scripts run in the one managed by dfhack core.

Things described in this document are available in both interpreter instances:

https://github.com/peterix/dfhack/blob/master/LUA_API.rst
Logged

Rinin_Rus

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.10 r1
« Reply #1653 on: May 31, 2012, 04:36:17 am »

Is it possible to locate from global map any of features, except subterranean, magma_core and underworld? And is it possible to iterate all veins in all biomes from embark screen? So how many information could be collected about world during embark?

My brain explodes while I try to realize a structure of "DF" class for example. Which members is it has?
Logged
He has a lot of willpower,  but he has very little linguistic ability

ag

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.10 r1
« Reply #1654 on: May 31, 2012, 06:22:11 am »

My brain explodes while I try to realize a structure of "DF" class for example. Which members is it has?

What "DF" class?
Logged

Iceflame

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.10 r1
« Reply #1655 on: June 01, 2012, 02:22:29 am »

is there a way to fully cure dwarfs with DFHack?
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 0.34.10 r1
« Reply #1656 on: June 01, 2012, 04:13:37 am »

is there a way to fully cure dwarfs with DFHack?
that depends on what you mean of cure?
if you mean fully heal then
Code: [Select]
function tools.heal2(unit)
if unit==nil then
unit=getCreatureAtPos(getxyz())
end
unit.body.wounds:resize(0) -- memory leak here :/
unit.body.blood_count=unit.body.blood_max
--set flags for standing and grasping...
unit.status2.able_stand=4
unit.status2.able_stand_impair=4
unit.status2.able_grasp=4
unit.status2.able_grasp_impair=4
--should also set temperatures, and flags for breath etc...
unit.flags1.dead=false
unit.flags2.calculated_bodyparts=false
unit.flags2.calculated_nerves=false
unit.flags2.circulatory_spray=false
unit.flags2.vision_good=true
unit.flags2.vision_damaged=false
unit.flags2.vision_missing=false
unit.counters.winded=0
unit.counters.unconscious=0
for k,v in pairs(unit.body.components) do
for kk,vv in pairs(v) do
v[kk]=0
end
end
end
tools.menu:add("heal2",tools.heal2)
Should do the job, if you mean cure them of vamprism then I think warmist posted something a while back on it.
Logged
I thought I would I had never hear my daughter's escapades from some boy...
DAMN YOU RUMRUSHER!!!!!!!!
"body swapping and YOU!"
Adventure in baby making!Adv Homes

Tierre

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.10 r1
« Reply #1657 on: June 01, 2012, 04:21:21 am »

Will it work fine? I would try to test it but dwarf will not regrow any limbs this way eh.... but he will be alive - so you can add masterwork fortress workshop for full healing dwarfs later. This will make you reanimate any dwarf. Also there can be interactions moded to resurrect and fully heal any dwarf by your other dwarfes. Only question is - will it stop ghost from appearing and bad thoughts from happening AFTER resurrection.
Logged

Rose

  • Bay Watcher
  • Resident Elf
    • View Profile
Re: DFHack 0.34.10 r1
« Reply #1658 on: June 01, 2012, 04:27:03 am »

If you can add and remove syndromes, then adding a were-syndrome, changing to manimal and back, then removing the syndrome would also heal them up.
Logged

Iceflame

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.10 r1
« Reply #1659 on: June 01, 2012, 04:56:33 am »

Thanks, I think this is exactly what I needed - vamprism is not the problem - only blind migrants from my abandoned fortress.

Where do I have to put this script?
Logged

Tierre

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.10 r1
« Reply #1660 on: June 01, 2012, 06:44:07 am »

If you can add and remove syndromes, then adding a were-syndrome, changing to manimal and back, then removing the syndrome would also heal them up.
Actually masterwork does it similary. It converts a creature to itself and its healed this way with restored limbs. But it has to be alive to use a workshop:)
Logged

Robotic

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.10 r1
« Reply #1661 on: June 01, 2012, 07:13:36 am »

I'll update this post later, I have to step out for a few hours, but figured it was worth sharing:

Spoiler: make_legendary.lua (click to show/hide)

As with the other scripts, it can be used with either
' lua c:\path\to\script '
or if you put it into the dfhack scripts directory, just call it with make_legendary

typical usage would be to target a dwarf in dfhack, then make_legendary MINING
and voila, you have a legendary miner.  make_legendary list will provide a list of available skills.

How could I modify this to make a dwarf legendary in ALL skills in one go?
Logged

avtolik

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.10 r1
« Reply #1662 on: June 01, 2012, 07:23:41 am »

How could I modify this to make a dwarf legendary in ALL skills in one go?

See the script here:
http://dwarffortresswiki.org/index.php/Utility:DFusion#How_to
Logged

Hamek McEisenfaust

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.10 r1
« Reply #1663 on: June 01, 2012, 09:46:06 am »

Hey, guys- complete and utter newbie here. How exactly do I install the lua scripts so I can execute them from DFhack? I would /really/ like to be able to use the elevate scripts but after like an hour of fiddling around blindly I've had no success. Can anyone give me a step-by-step walkthrough?
Step 1: Copy the .lua file into the [DF]/hack/scripts folder
Step 2: Type the name of the script (without the ".lua") at the DFHack command prompt (along with any parameters).
Sorry to drag this up again. I would like to know if there is a way to tell DFhack? to run all three scripts, brainwash,physical and mental all at the same time rather then selecting each one after the other? I have the scripts running separately , however, i would like to be able to just type in say, GOD, and all three scripts run on the Urist targeted. Thank you for your assistance.
Logged
"here's 7 inebriated borderline psychotic bastards, go dig out a living space for 200 of them that will be coming soon btw there's also a terrible tentacle monster-panda made out of barf to deal with have fun" -PsychicKid

Robotic

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.10 r1
« Reply #1664 on: June 01, 2012, 10:28:42 am »

Sorry to drag this up again. I would like to know if there is a way to tell DFhack? to run all three scripts, brainwash,physical and mental all at the same time rather then selecting each one after the other? I have the scripts running separately , however, i would like to be able to just type in say, GOD, and all three scripts run on the Urist targeted. Thank you for your assistance.

Sure, you can just combine all the scripts into one .lua file called godmode (or whatever you'd like to name it).  Here it is for the lazy.

Spoiler (click to show/hide)
Logged
Pages: 1 ... 109 110 [111] 112 113 ... 373