This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- changes from advmode to fort safely and back (hopefully) | |
--[[Now to warn you about saving and loading in either game mode might lead | |
to some side issues, for saving in fort mode switching to adv mode needs the adv to be `bodyswap` | |
back in again. for Saving in Adv to switch to Fort mode you probably be safe-ish if the site. | |
isn't a nano fort or a site that isn't 3x3 small. otherwise the game will try to resize the map. | |
oh and switching to fort mode on any pre-gen site larger than 4x4 might implode one pc if | |
you don't have like 20 gigs of memory for the 16x16 embark size. | |
ok so this version of this script has be updated again so that caravans and visitors and migrants | |
could show up at any edge of the map... and maybe leave from any spot... of the z level you assign the site too. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function telekinesis(itemSource,itemTarget) | |
local curpos | |
if df.global.ui_advmode.menu==1 then | |
curpos=df.global.cursor | |
else | |
print ("No cursor located! uhh wouldn't had effected anything though.") | |
return | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local dlg=require("gui.dialogs") | |
local testciv=df.global.world.entities.all | |
require("utils").insert_sorted(dfhack.gui.getCurViewscreen().available_civs,df.global.world.entities.all[112],"id") | |
require("utils").insert_sorted(dfhack.gui.getCurViewscreen().available_civs,df.global.world.entities.all[302],"id") | |
require("utils").insert_sorted(dfhack.gui.getCurViewscreen().available_civs,df.global.world.entities.all[234],"id") | |
require("utils").insert_sorted(dfhack.gui.getCurViewscreen().available_civs,df.global.world.entities.all[134],"id") | |
require("utils").insert_sorted(dfhack.gui.getCurViewscreen().available_civs,df.global.world.entities.all[32],"id") | |
require("utils").insert_sorted(dfhack.gui.getCurViewscreen().available_civs,df.global.world.entities.all[274],"id") | |
require("utils").insert_sorted(dfhack.gui.getCurViewscreen().available_civs,df.global.world.entities.all[47],"id") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function addaciv() | |
local testciv=df.global.world.entities.all | |
--df.viewscreen_choose_start_sitest.available_civs:insert("#",{new=df.global.world.entities.all,112}) | |
--require("utils").insert_sorted(df..available_civs,df.global.world.entities.all[1],"id") | |
require("utils").insert_sorted(dfhack.gui.getCurViewscreen().parent.available_civs,df.global.world.entities.all[112],"id") | |
require("utils").insert_sorted(dfhack.gui.getCurViewscreen().parent.available_civs,df.global.world.entities.all[302],"id") | |
require("utils").insert_sorted(dfhack.gui.getCurViewscreen().parent.available_civs,df.global.world.entities.all[234],"id") | |
require("utils").insert_sorted(dfhack.gui.getCurViewscreen().parent.available_civs,df.global.world.entities.all[134],"id") | |
require("utils").insert_sorted(dfhack.gui.getCurViewscreen().parent.available_civs,df.global.world.entities.all[32],"id") | |
require("utils").insert_sorted(dfhack.gui.getCurViewscreen().parent.available_civs,df.global.world.entities.all[274],"id") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Mount (rider,horse) | |
--for k,horse in pairs(unit_list) do | |
--if unit_rider.pos.x==horse.pos.x and unit_rider.pos.y==horse.pos.y | |
--and unit_rider.pos.z==horse.pos.z then --check if they are on the same tile | |
horse.general_refs:insert("#",{new=df.general_ref_unit_riderst,unit_id=rider.id}) | |
rider.relations.rider_mount_id=horse.id | |
rider.flags1.rider=true | |
horse.flags1.ridden=true | |
require("utils").insert_sorted(df.global.world.units.other.ANY_RIDER,rider,"id") | |
return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local dlg = require("gui.dialogs") | |
function CompN1() | |
local adv=df.global.world.units.active[2] | |
--for k,v in pairs(df.global.world.units.active) do | |
--if adv.relations.group_leader_id==adv.id then | |
local sx,sy,sz | |
sx=adv.pos.x | |
sy=adv.pos.y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local gui = require 'gui' | |
local dlg = require 'gui.dialogs' | |
local args={...} | |
local is_cheat=(#args>0 and args[1]=="-c") | |
local cursor=xyz2pos(df.global.cursor.x,df.global.cursor.y,df.global.cursor.z) | |
local permited_equips={} | |
permited_equips[df.item_backpackst]="UPPERBODY" | |
permited_equips[df.item_quiverst]="UPPERBODY" | |
permited_equips[df.item_flaskst]="UPPERBODY" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- allows to do jobs in adv. mode. | |
keybinds={ | |
nextJob={key="CUSTOM_B",desc="Next job in the list"}, | |
prevJob={key="CUSTOM_V",desc="Previous job in the list"}, | |
continue={key="A_WAIT",desc="Continue job if available"}, | |
down_alt1={key="CUSTOM_CTRL_D",desc="Use job down"}, | |
down_alt2={key="CURSOR_DOWN_Z_AUX",desc="Use job down"}, | |
up_alt1={key="CUSTOM_CTRL_E",desc="Use job up"}, | |
up_alt2={key="CURSOR_UP_Z_AUX",desc="Use job up"}, | |
use_same={key="A_MOVE_SAME_SQUARE",desc="Use job at the tile you are standing"}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getCaste(race_id,caste_id) | |
local cr=df.creature_raw.find(race_id) | |
return cr.caste[caste_id] | |
end | |
function CreateUnit(race_id,caste_id) | |
local race=df.creature_raw.find(race_id) | |
if race==nil then error("Invalid race_id") end | |
local caste=getCaste(race_id,caste_id) | |
local unit=df.unit:new() | |
unit.race=race_id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local _ENV = mkmodule('plugins.dfusion.Rum-tools') | |
local dfu=require("plugins.dfusion") | |
local ms=require "memscan" | |
menu=dfu.SimpleMenu() | |
RaceNames={} | |
function setrace(name) | |
RaceTable=BuildNameTable() | |
print("Your current race is:"..GetRaceToken(df.global.ui.race_id)) | |
local id | |
if name == nil then |
NewerOlder