v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

Editing User:Andux/Scripts

Jump to navigation Jump to search

Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.


The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 58: Line 58:
 
"umma", "undi", "unga", "unni",  
 
"umma", "undi", "unga", "unni",  
 
"vala", "vali", "vara", "vari", "vina",
 
"vala", "vali", "vara", "vari", "vina",
 
 
"ya",
 
"ya",
 
"zadi", "zani", "zara", "zi"
 
"zadi", "zani", "zara", "zi"
Line 104: Line 103:
 
if unit.flags1.important_historical_figure or unit.flags2.important_historical_figure then
 
if unit.flags1.important_historical_figure or unit.flags2.important_historical_figure then
 
--Use the same name as the histfig data
 
--Use the same name as the histfig data
unit.name.first_name = df.historical_figure.find(unit.hist_figure_id).name.first_name;
+
unit.name.first_name = df.global.world.history.figures[unit.hist_figure_id].name.first_name;
 
else
 
else
 
if (unit.sex ~= 0) then
 
if (unit.sex ~= 0) then
Line 153: Line 152:
  
 
===Urbanizer===
 
===Urbanizer===
For older versions of Dwarf Fortress--converts all forest retreats to visitable towns.
+
Converts all forest retreats to visitable towns.
 
<pre style="overflow: auto;">
 
<pre style="overflow: auto;">
 
for k,v in pairs(df.global.world.world_data.sites) do
 
for k,v in pairs(df.global.world.world_data.sites) do
Line 164: Line 163:
  
 
==General==
 
==General==
 
+
===HealUnit===
===GoodAsNew===
+
Repairs all health issues except for syndromes and severed limbs.
Removes all wear from the selected item.
 
 
<pre style="overflow: auto;">
 
<pre style="overflow: auto;">
local r=nil
+
local unit=dfhack.gui.getSelectedUnit()
local top=dfhack.gui.getCurViewscreen()
+
if unit then
print(top.parent,top)
+
print("Erasing wounds...")
local cvstype=dfhack.gui.getFocusString(top)
+
while #unit.body.wounds > 0 do
print(dfhack.gui.getFocusString(top.parent).."/"..cvstype)
+
unit.body.wounds:erase(#unit.body.wounds-1)
if cvstype=="dungeon_monsterstatus" then
+
end
print(" inventory size: "..#top.inventory)
+
unit.body.wound_next_id=1
print("  inventory_cursor: "..top.inventory_cursor)
 
r=top.inventory[top.inventory_cursor].item
 
else
 
r=dfhack.gui.getSelectedItem()
 
end
 
  
if r then
+
print("Refilling blood...")
r.wear=0
+
unit.body.blood_count=unit.body.blood_max
r.wear_timer=0
 
printall(r)
 
end
 
</pre>
 
 
 
===Kinsey===
 
<pre style="overflow: auto;">
 
-- View or change the sexual orientation of the selected unit.
 
 
 
--[====[
 
 
 
kinsey
 
======
 
View or change the sexual orientation of the selected unit. Usage:
 
 
 
:kinsey:
 
    Print the unit's orientation flags.
 
:kinsey -asexual:
 
    Change flags so that the unit will not romance or marry anyone.
 
:kinsey -rf:
 
    Allow the unit to romance females.
 
:kinsey -rm:
 
    Allow the unit to romance males.
 
:kinsey -mf:
 
    Allow the unit to marry females.
 
:kinsey -mm:
 
    Allow the unit to marry males.
 
:kinsey -indeterminate:
 
    Mark the unit's orientation as indeterminate (default for adventurers).
 
 
 
Apart from the -asexual flag, any of the options above can be used together;
 
for example, ``kinsey -rm -mf`` will allow a unit to romance either sex, but
 
only marry females.
 
 
 
]====]
 
 
 
local utils = require('utils')
 
  
local validArgs = utils.invert({
+
print("Resetting status flags...")
    'asexual',
+
unit.status2.able_stand_impair=unit.status2.able_stand
    'rf',
+
unit.status2.able_grasp_impair=unit.status2.able_grasp
    'rm',
 
    'mf',
 
    'mm',
 
    'indeterminate',
 
    'help',
 
})
 
  
local args = utils.processArgs({...}, validArgs)
+
unit.flags2.has_breaks=false
 +
unit.flags2.gutted=false
 +
unit.flags2.circulatory_spray=false
 +
unit.flags2.vision_good=true
 +
unit.flags2.vision_damaged=false
 +
unit.flags2.vision_missing=false
 +
unit.flags2.breathing_good=true
 +
unit.flags2.breathing_problem=false
  
if args.help then
+
unit.flags2.calculated_nerves=false
print(dfhack.script_help())
+
unit.flags2.calculated_bodyparts=false
return
 
end
 
  
local unit = dfhack.gui.getSelectedUnit()
+
print("Resetting counters...")
if not unit then
+
unit.counters.winded=0
qerror('Error: please select a unit.')
+
unit.counters.stunned=0
end
+
unit.counters.unconscious=0
 +
unit.counters.webbed=0
 +
unit.counters.pain=0
 +
unit.counters.nausea=0
 +
unit.counters.dizziness=0
  
local hf = df.historical_figure.find(unit.hist_figure_id)
+
unit.counters2.paralysis=0
if not hf then
+
unit.counters2.fever=0
print("Warning: Couldn't find histfig data for this unit.")
+
unit.counters2.exhaustion=0
end
+
unit.counters2.hunger_timer=0
 
+
unit.counters2.thirst_timer=0
if unit then
+
unit.counters2.sleepiness_timer=0
if args.asexual then
+
unit.counters2.vomit_timeout=0
unit.status.current_soul.orientation_flags.indeterminate = false
 
unit.status.current_soul.orientation_flags.romance_male = false
 
unit.status.current_soul.orientation_flags.marry_male = false
 
unit.status.current_soul.orientation_flags.romance_female = false
 
unit.status.current_soul.orientation_flags.marry_female = false
 
print("Unit orientation flags cleared.")
 
if hf then
 
hf.orientation_flags.indeterminate = false
 
hf.orientation_flags.romance_male = false
 
hf.orientation_flags.marry_male = false
 
hf.orientation_flags.romance_female = false
 
hf.orientation_flags.marry_female = false
 
print("Changes propagated to histfig data.")
 
end
 
 
 
elseif args.indeterminate or args.rm or args.mm or args.rf or args.mf then
 
unit.status.current_soul.orientation_flags.indeterminate = (args.indeterminate~=nil)
 
unit.status.current_soul.orientation_flags.romance_male = (args.rm~=nil)
 
unit.status.current_soul.orientation_flags.marry_male = (args.mm~=nil)
 
unit.status.current_soul.orientation_flags.romance_female = (args.rf~=nil)
 
unit.status.current_soul.orientation_flags.marry_female = (args.mf~=nil)
 
print("Unit orientation flags updated.")
 
if hf then
 
hf.orientation_flags.indeterminate = unit.status.current_soul.orientation_flags.indeterminate
 
hf.orientation_flags.romance_male = unit.status.current_soul.orientation_flags.romance_male
 
hf.orientation_flags.marry_male = unit.status.current_soul.orientation_flags.marry_male
 
hf.orientation_flags.romance_female = unit.status.current_soul.orientation_flags.romance_female
 
hf.orientation_flags.marry_female = unit.status.current_soul.orientation_flags.marry_female
 
print("Histfig data updated to match.")
 
end
 
end
 
  
print("Current orientation flags:")
 
print("  indeterminate: ", unit.status.current_soul.orientation_flags.indeterminate)
 
print("  romance_male:  ", unit.status.current_soul.orientation_flags.romance_male)
 
print("  marry_male:    ", unit.status.current_soul.orientation_flags.marry_male)
 
print("  romance_female:", unit.status.current_soul.orientation_flags.romance_female)
 
print("  marry_female:  ", unit.status.current_soul.orientation_flags.marry_female)
 
 
end
 
end
 
</pre>
 
</pre>

Please note that all contributions to Dwarf Fortress Wiki are considered to be released under the GFDL & MIT (see Dwarf Fortress Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Cancel Editing help (opens in new window)