rum_tools={} --> first lets make a menu table
rum_tools.menu=MakeMenu()
function rum_tools.changeadv() -- this function will do almost all the work
myoff=offsets.getEx("AdvCreatureVec") -- first find out where "Adventurer creature vector" is
vector=engine.peek(myoff,ptr_vector) -- +16 is a little fix...
indx=GetCreatureAtPos(getxyz()) -- a little helper, gets index in the vector with current id. And getxyz() is a function that gets x y and z of that "X" pointer. These functions are in common.lua
print("Swaping, press enter when done.")
-- next three lines is a common switch two things pattern
tval=vector:getval(0) -- get offset of player
vector:setval(0,vector:getval(indx)) -- set first offset to be the target's
vector:setval(indx,tval) -- set targets offset to the players
r=io.stdin:read() -- pause
-- again switch them around
tval=vector:getval(0)
vector:setval(0,vector:getval(indx))
vector:setval(indx,tval)
end
function rum_tools.MakeFollow()
--first three lines same as before (because we will need an offset of creature at location x,y,z)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
indx=GetCreatureAtPos(getxyz())
print(string.format("current creature:%x",vector:getval(indx)))
trgid=engine.peek(vector:getval(0),ptr_Creature.ID) --get players ID
lfollow=engine.peek(vector:getval(indx),ptr_Creature.followID) -- get target creatures "now following ID"
if lfollow ~=0xFFFFFFFF then --if its set
print("Already following, unfollow? y/N") -- ask confirmation
r=io.stdin:read()
if r== "y" then
engine.poke(vector:getval(indx),ptr_Creature.followID,0)
end
else
engine.poke(vector:getval(indx),ptr_Creature.followID,trgid) -- if not just write the players ID.
end
end
function rum_tools.racechange()
--first three lines same as before (because we will need an offset of creature at location x,y,z)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
indx=GetCreatureAtPos(getxyz())
RaceTable=RaceTable or BuildNameTable() --slow.If loaded don't load again
print("Enter race name ALL CAPS!:")
repeat
entry=io.stdin:read() --get entry
id=RaceTable[entry] -- find race id
until id~=nil -- if not found repeat
engine.poke(vector:getval(indx),ptr_Creature.race,id)
end
function rum_tools.makeghost()
--first three lines same as before (because we will need an offset of creature at location x,y,z)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
indx=GetCreatureAtPos(getxyz())
--indx=0
--print(string.format("%x",vector:getval(indx)))
flg=engine.peek(vector:getval(indx),ptr_Creature.flags) --get flags
flg:flip(76) -- 76 is ghostliness flag.
--flg:set(1,0) -- alive
--flg:set(13,1) -- skeleton
engine.poke(vector:getval(indx),ptr_Creature.flags,flg) --save flags
end
function rum_tools.maketest()
--first three lines same as before (because we will need an offset of creature at location x,y,z)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
indx=GetCreatureAtPos(getxyz())
--indx=0
--print(string.format("%x",vector:getval(indx)))
test=engine.peek(vector:getval(indx),ptr_Creature.wutlvl) --get random hex memory between bleed and blood
--flg:flip(76) -- 76 is ghostliness flag.
--flg:set(1,0) -- alive
--flg:set(13,1) -- skeleton
engine.poke(vector:getval(indx),ptr_Creature.wutlvl,-1) --testing for anything to happen
end
function rum_tools.getitems()
--first three lines same as before (because we will need an offset of creature at location x,y,z)
x,y,z=getxyz()
vector=engine.peek(myoff+16,ptr_vector)
indx=GetCreatureAtPos(getxyz())
indx=0
flg=engine.peek(vector:getval(indx),ptr_Creature.flags) --get flags
flg:flip(76) -- 76 is ghostliness flag.
--flg:set(1,0) -- alive
--flg:set(13,1) -- skeleton
engine.poke(vector:getval(indx),ptr_Creature.flags,flg) --save flags
end
function rum_tools.hostilate()
vector=engine.peek(offsets.getEx("AdvCreatureVec"),ptr_vector)
id=GetCreatureAtPos(getxyz())
print(string.format("Vec:%d cr:%d",vector:size(),id))
off=vector:getval(id)
crciv=engine.peek(vector:getval(id),ptr_Creature.civ)
curciv=engine.peek(vector:getval(0),ptr_Creature.civ)
if curciv==crciv then
print("Friendly-making enemy")
engine.poke(off,ptr_Creature.civ,-1)
flg=engine.peek(off,ptr_Creature.flags)
flg:set(17,true)
engine.poke(off,ptr_Creature.flags,flg)
else
print("Enemy- making friendly")
engine.poke(off,ptr_Creature.civ,curciv)
flg=engine.peek(off,ptr_Creature.flags)
flg:set(17,false)
flg:set(19,false)
engine.poke(off,ptr_Creature.flags,flg)
end
end
function rum_tools.nociv() --removes Civ number will become hostile
vector=engine.peek(offsets.getEx("AdvCreatureVec"),ptr_vector)
id=GetCreatureAtPos(getxyz())
print(string.format("Vec:%d cr:%d",vector:size(),id))
off=vector:getval(id)
crciv=engine.peek(vector:getval(id),ptr_Creature.civ)
engine.poke(off,ptr_Creature.civ,-1)
--[[curciv=engine.peek(vector:getval(0),ptr_Creature.civ)
if curciv==crciv then
print("Friendly-making enemy")
engine.poke(off,ptr_Creature.civ,-1)
flg=engine.peek(off,ptr_Creature.flags)
flg:set(17,true)
engine.poke(off,ptr_Creature.flags,flg)
else
print("Enemy- making friendly")
engine.poke(off,ptr_Creature.civ,curciv)
flg=engine.peek(off,ptr_Creature.flags)
flg:set(17,false)
flg:set(19,false)
engine.poke(off,ptr_Creature.flags,flg)
end]]--
end
function rum_tools.tamingcompanions() --woop wopp does not work
vector=engine.peek(offsets.getEx("AdvCreatureVec"),ptr_vector)
id=GetCreatureAtPos(getxyz())
print(string.format("Vec:%d cr:%d",vector:size(),id))
off=vector:getval(id)
crciv=engine.peek(vector:getval(id),ptr_Creature.civ)
curciv=engine.peek(vector:getval(0),ptr_Creature.civ)
if curciv==crciv then
print("Friendly-making friendly")
engine.poke(off,ptr_Creature.civ,crciv)
flg=engine.peek(off,ptr_Creature.flags)
flg:set(17,0)
flg:set(19,0)
engine.poke(off,ptr_Creature.flags,flg)
else
print("Enemy- making friendly")
engine.poke(0,ptr_Creature.civ,crciv)
flg=engine.peek(off,ptr_Creature.flags)
flg:set(17,0)
flg:set(19,0)
engine.poke(off,ptr_Creature.flags,flg)
end
end
function rum_tools.getlegendsid(croff)
local vec=engine.peek(croff,ptr_Creature.legends)
if vec:size()~=0 then
return engine.peekd(vec:getval(0)+4)
else
return 0
end
end
function rum_tools.follow2()
myoff=offsets.getEx("AdvCreatureVec")
leg=offsets.getEx("Legends")
vector=engine.peek(myoff,ptr_vector)
legvec=engine.peek(leg,ptr_vector)
indx=GetCreatureAtPos(getxyz())
print(string.format("current creature:%x",vector:getval(indx)))
trgid=engine.peek(vector:getval(0),ptr_Creature.ID) --get players ID
--[[playerlegid=engine.peek(vector:getval(0),ptr_Creature.legends)
playerlegid=engine.peekd(playerlegid:getval(0)+4)
lfollow=engine.peek(vector:getval(indx),ptr_Creature.followID) -- get target creatures "now following ID"
trglegid=engine.peek(vector:getval(indx),ptr_Creature.legends)
trglegid=engine.peekd(trglegid:getval(0)+4)--]]
playerlegid=rum_tools.getlegendsid(vector:getval(0))
trglegid=rum_tools.getlegendsid(vector:getval(indx))
print(string.format("Player legends id:%d and offset:%x",playerlegid,legvec:getval(playerlegid)))
print(string.format("Target legends id:%d and offset:%x",trglegid,legvec:getval(trglegid)))
if lfollow ~=0xFFFFFFFF then --if its set
print("Already following, unfollow? y/N") -- ask confirmation
r=io.stdin:read()
if r== "y" then
engine.poke(vector:getval(indx),ptr_Creature.followID,-1)
engine.poke(legvec:getval(trglegid),ptr_legends2.follow,-1)
end
else
engine.poke(vector:getval(indx),ptr_Creature.followID,trgid) -- if not just write the players ID.
engine.poke(legvec:getval(trglegid),ptr_legends2.follow,playerlegid)
end
end
function rum_tools.changeadv2()
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
indx=GetCreatureAtPos(getxyz())
print("Swaping")
tval=vector:getval(0)
vector:setval(0,vector:getval(indx))
vector:setval(indx,tval)
local legid=rum_tools.getlegendsid(vector:getval(0))
print("Legends id found:"..legid)
if legid~=0 then
engine.poked(offsets.getEx("PlayerLegend"),legid)
else
print("Warning target does not have a valid legends id!")
end
end
function rum_tools.changeflag() --by rumrusher
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
indx=GetCreatureAtPos(getxyz())
flg=engine.peek(vector:getval(indx),ptr_Creature.flags)
print("Type flags number to flip:")
entry=io.stdin:read()
print("Was:"..flg:get(entry))
flg:flip(entry)
print("Now:"..flg:get(entry))
engine.poke(vector:getval(indx),ptr_Creature.flags,flg)
end
function rum_tools.wagonmode() --by rumrusher
--first three lines same as before (because we will need an offset of creature at location x,y,z)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
indx=GetCreatureAtPos(getxyz())
--indx=0
--print(string.format("%x",vector:getval(indx)))
flg=engine.peek(vector:getval(indx),ptr_Creature.flags) --get flags
flg:set(1,false)
flg:set(74,false)
engine.poke(vector:getval(indx),ptr_Creature.flags,flg)
print("To stay normal press y, else hit Enter turn Wagon mode on.")
r=io.stdin:read() -- repeat for it too work... also creature will be dead.
if r== "y" then
flg=engine.peek(vector:getval(indx),ptr_Creature.flags)
flg:set(1,false)
engine.poke(vector:getval(indx),ptr_Creature.flags,flg)
else
flg=engine.peek(vector:getval(indx),ptr_Creature.flags)
flg:set(1,false)
flg:flip(74)
engine.poke(vector:getval(indx),ptr_Creature.flags,flg)
end
end
continue on the other postrace changer!?change race - changes the controling race, not race of one creature. As for version, try running df in arena mode and then use the "-f" if it still does not work i suspect that .10 could be too old although i tried to make algorithms universal.
does this mean we can change the race of any selected the creature
or change the civ controller?
some how it doesn't work with .10. even when I try the -f
function rum_tools.ressurect()
--repeat
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
indx=0 --GetCreatureAtPos(getxyz())
if indx<0 then return end
--print(string.format("%x",vector:getval(indx)))
v2=engine.peek(vector:getval(indx),ptr_Creature.hurt1)
for i=0,v2:size()-1 do
v2:setval(i,0)
end
v2=engine.peek(vector:getval(indx),ptr_Creature.hurt2)
v2.type=DWORD
for i=0,v2:size()-1 do
v2:setval(i,0)
end
engine.poke(vector:getval(indx),ptr_Creature.bloodlvl,60000) --give blood
engine.poke(vector:getval(indx),ptr_Creature.bleedlvl,0) --stop some bleeding...
local flg=engine.peek(vector:getval(indx),ptr_Creature.flags)
flg:set(1,false) --ALIVE
flg:set(39,false) -- leave body yet again
flg:set(37,false)
flg:set(57,true)
flg:set(60,true) -- something todo with wounds- lets you walk again.
engine.poke(vector:getval(indx),ptr_Creature.flags,flg)
--until r==7
end
function rum_tools.Hurt() --instant hurt of a body part
--repeat
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
indx=GetCreatureAtPos(getxyz())
if indx<0 then return end
--print(string.format("%x",vector:getval(indx)))
v2=engine.peek(vector:getval(indx),ptr_Creature.hurt1)
for i=0,v2:size()-1 do
v2:setval(i,7)
end
v2=engine.peek(vector:getval(indx),ptr_Creature.hurt2)
v2.type=DWORD
for i=0,v2:size()-1 do
v2:setval(i,8)
end
engine.poke(vector:getval(indx),ptr_Creature.bloodlvl,60000) --give blood
engine.poke(vector:getval(indx),ptr_Creature.bleedlvl,1) --stop some bleeding...
local flg=engine.peek(vector:getval(indx),ptr_Creature.flags)
flg:set(1,false) --ALIVE
flg:set(39,false) -- leave body yet again
flg:set(37,false) -- something todo with wounds- lets you walk again.
engine.poke(vector:getval(indx),ptr_Creature.flags,flg)
--until r==7
end
function rum_tools.Hurtselected() --found out that this does not really hurt creature but will give the user ability to disarm them if you remove(15) a limb from their bodies this will cause their clothes to fall off so find the hand and poof away gear.
--repeat
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
indx=GetCreatureAtPos(getxyz())
if indx<0 then return end
--print(string.format("%x",vector:getval(indx)))
v2=engine.peek(vector:getval(indx),ptr_Creature.hurt1)
v3=engine.peek(vector:getval(indx),ptr_Creature.hurt2)
v3.type=DWORD
print("select body part 0=upperbody,1=lowerbody,2=head,3=right front leg,4=left front leg,5=")
r=io.stdin:read()
t=r*4
print("select infliction")
d=io.stdin:read()
v2:setval(t,d)
v3:setval(r,d) --remove zero-th limb or something... same with hurt2
end
function rum_tools.ressurectall()
local trgs=selectall()
for k,v in pairs(trgs) do
--indx=GetCreatureAtPos(v)
--indx=engine.peek(v,ptr_creature.ID)
print("Zombie:"..k)
v2=engine.peek(v,ptr_Creature.hurt1)
for i=0,v2:size()-1 do
v2:setval(i,0)
end
v2=engine.peek(v,ptr_Creature.hurt2)
v2.type=DWORD
for i=0,v2:size()-1 do
v2:setval(i,0)
end
engine.poke(v,ptr_Creature.bloodlvl,60000) --give blood
engine.poke(v,ptr_Creature.bleedlvl,0) --stop some bleeding...
local flags=engine.peek(v,ptr_Creature.flags)
flags:set(1,false) -- alive!
flags:set(39,false) -- leave body yet again
flags:set(37,false) -- something todo with wounds- lets you walk again.
engine.poke(v,ptr_Creature.flags,flags)
end
end
function rum_tools.ressurectcomp() --heal all your friends for a small chance to die again
local trgs=selectcomp()
for k,v in pairs(trgs) do
--indx=GetCreatureAtPos(v)
--indx=engine.peek(v,ptr_creature.ID)
print("Companion:"..k)
v2=engine.peek(v,ptr_Creature.hurt1)
for i=0,v2:size()-1 do
v2:setval(i,0)
end
v2=engine.peek(v,ptr_Creature.hurt2)
v2.type=DWORD
for i=0,v2:size()-1 do
v2:setval(i,0)
end
engine.poke(v,ptr_Creature.bloodlvl,60000) --give blood
engine.poke(v,ptr_Creature.bleedlvl,0) --stop some bleeding...
local flags=engine.peek(v,ptr_Creature.flags)
flags:set(1,false) -- alive!
flags:set(39,false) -- leave body yet again
flags:set(37,false) -- something todo with wounds- lets you walk again.
engine.poke(v,ptr_Creature.flags,flags)
end
end
function rum_tools.fortcomps() --removes the is resident tag off companions
local trgs=selectcomp()
for k,v in pairs(trgs) do
--indx=GetCreatureAtPos(v)
--indx=engine.peek(v,ptr_creature.ID)
print("Companion:"..k)
--[[v2=engine.peek(v,ptr_Creature.hurt1)
for i=0,v2:size()-1 do
v2:setval(i,0)
end
v2=engine.peek(v,ptr_Creature.hurt2)
v2.type=DWORD
for i=0,v2:size()-1 do
v2:setval(i,0)
end
engine.poke(v,ptr_Creature.bloodlvl,60000) --give blood
engine.poke(v,ptr_Creature.bleedlvl,0)]]-- --stop some bleeding...
local flags=engine.peek(v,ptr_Creature.flags)
flags:set(1,false) -- alive!
flags:set(51,false) -- leave body yet again
flags:set(47,false) -- something todo with wounds- lets you walk again.
engine.poke(v,ptr_Creature.flags,flags)
end
end
function rum_tools.Zombieressurectandcontrol() -- BE THE NECROMANCER... end up watching a bunch of zombie fight each other like savages and not get any raiding done use a teleport or carry command to order them around.
local trgs=selectall()
for k,v in pairs(trgs) do
--indx=GetCreatureAtPos(v)
--indx=engine.peek(v,ptr_creature.ID)
print("Zombie:"..k)
v2=engine.peek(v,ptr_Creature.hurt1)
for i=0,v2:size()-1 do
v2:setval(i,0)
end
v2=engine.peek(v,ptr_Creature.hurt2)
v2.type=DWORD
for i=0,v2:size()-1 do
v2:setval(i,0)
end
--engine.poke(creatureptr,ptr_Creature.legends,-1)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff+16,ptr_vector)
local trgs=selectall()
for k,v in pairs(trgs) do
trgid=engine.peek(vector:getval(0),ptr_Creature.ID) --get players ID
engine.peek(v,ptr_Creature.followID) -- get target creatures "now following ID"
engine.poke(v,ptr_Creature.followID,trgid) -- if not just write the players ID.
end
engine.poke(v,ptr_Creature.bloodlvl,60000) --give blood
engine.poke(v,ptr_Creature.bleedlvl,0) --stop some bleeding...
local flags=engine.peek(v,ptr_Creature.flags)
flags:set(1,false) -- alive!
flags:set(12,true) --zombie
engine.poke(v,ptr_Creature.flags,flags)
end
end
function rum_tools.Zombieressurect() -- turn dead into undead and undead into dead for good.
repeat
local trgs=selectall()
for k,v in pairs(trgs) do
--indx=GetCreatureAtPos(v)
--indx=engine.peek(v,ptr_creature.ID)
print("Zombie:"..k)
v2=engine.peek(v,ptr_Creature.hurt1)
for i=0,v2:size()-1 do
v2:setval(i,1)
end
v2=engine.peek(v,ptr_Creature.hurt2)
v2.type=DWORD
for i=0,v2:size()-1 do
v2:setval(i,1)
end
--engine.peek(v,ptr_Creature.civ)
--engine.poke(v,ptr_Creature.civ,-1)
engine.poke(v,ptr_Creature.bloodlvl,60000) --give blood
engine.poke(v,ptr_Creature.bleedlvl,24) --stop some bleeding...
local flags=engine.peek(v,ptr_Creature.flags)
flags:set(1,false) -- alive!
flags:set(12,true) --zombie
flags:set(17,true)
flags:set(19,true)
engine.poke(v,ptr_Creature.flags,flags)
--engine.poke(v,ptr_Creature.legends,-1)
end
until r==7
end
function rum_tools.lycanressurect() -- turns any one hurt a curtain way into a different race but be warn hitting them will cause the game to crash.
--repeat
local trgs=selectwolf()
for k,v in pairs(trgs) do
--indx=GetCreatureAtPos(v)
--indx=engine.peek(v,ptr_creature.ID)
engine.poke(v,ptr_Creature.race,151)
print("Werewolf:"..k)
v2=engine.peek(v,ptr_Creature.hurt1)
for i=0,v2:size()-1 do
v2:setval(i,0)
end
v2=engine.peek(v,ptr_Creature.hurt2)
v2.type=DWORD
for i=0,v2:size()-1 do
v2:setval(i,0)
end
engine.peek(v,ptr_Creature.civ)
engine.poke(v,ptr_Creature.civ,-1)
engine.poke(v,ptr_Creature.bloodlvl,60000) --give blood
engine.poke(v,ptr_Creature.bleedlvl,24) --stop some bleeding...
local flags=engine.peek(v,ptr_Creature.flags)
flags:set(1,false) -- alive!
flags:set(12,false) --zombie
flags:set(17,true)
flags:set(19,true)
engine.poke(v,ptr_Creature.flags,flags)
end
--until r==7
end
function rum_tools.ghostin() --necromancer controls of turning zombies into ghosts for easier manipulation of the dead
local trgs=selectskeleton()
for k,v in pairs(trgs) do
print("Zombie:"..k)
local flags=engine.peek(v,ptr_Creature.flags)
flags:set(1,false) -- alive!
flags:flip(76) --passive ghost following
engine.poke(v,ptr_Creature.flags,flags)
end
end
function rum_tools.skeltozombie() --add the rot to the pile of bones
local trgs=selectskeleton()
for k,v in pairs(trgs) do
print("Zombie:"..k)
local flags=engine.peek(v,ptr_Creature.flags)
flags:set(1,false) -- alive!
flags:set(12,true) --zombie
flags:set(13,false) --no skel
engine.poke(v,ptr_Creature.flags,flags)
end
end
function rum_tools.nosneak() --unreveal a hidden companion attack or an siege.
local trgs=selectalive()
for k,v in pairs(trgs) do
print("hidden:"..k)
local flags=engine.peek(v,ptr_Creature.flags)
flags:set(1,false) -- alive!
flags:set(18,false) --unreveal ambushers
engine.poke(v,ptr_Creature.flags,flags)
end
end
function rum_tools.compsneak() -- stealth tactics for against archers
local trgs=selectcomp()
for k,v in pairs(trgs) do
print("hidden:"..k)
local flags=engine.peek(v,ptr_Creature.flags)
--flags:set(1,false) -- alive!
flags:set(18,true) --ambushers
engine.poke(v,ptr_Creature.flags,flags)
end
end
function rum_tools.zombietoskel() -- strip the rotten meat from the bones.
local trgs=selectzombie()
for k,v in pairs(trgs) do
print("Skeleton:"..k)
local flags=engine.peek(v,ptr_Creature.flags)
flags:set(1,false) -- alive!
flags:set(13,true)
flags:set(12,false) --no zombie
engine.poke(v,ptr_Creature.flags,flags)
end
end
function selectalive()
local retvec={} --return vector (or a list)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector) --standart start
for i=0,vector:size()-1 do --check all creatures
local off
off=vector:getval(i)
local flags=engine.peek(off,ptr_Creature.flags)
if flags:get(1)==false then --if dead ...
table.insert(retvec,off)--... add it to return vector
end
end
return retvec --return the "return vector" :)
end
function rum_tools.ControlZombie() -- get temp control over the dead will revert if you travel
--first three lines same as before (because we will need an offset of creature at location x,y,z)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
local trgs=selectzombie()
for k,v in pairs(trgs) do
trgid=engine.peek(vector:getval(0),ptr_Creature.ID) --get players ID
engine.poke(v,ptr_Creature.civ,-1)
engine.peek(v,ptr_Creature.followID) -- get target creatures "now following ID"
engine.poke(v,ptr_Creature.followID,trgid) -- if not just write the players ID.
end
end
function selectskeleton()
local retvec={} --return vector (or a list)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector) --standart start
for i=0,vector:size()-1 do --check all creatures
local off
off=vector:getval(i)
local flags=engine.peek(off,ptr_Creature.flags)
if flags:get(13)==true then --if undead in anyway...
table.insert(retvec,off)--... add it to return vector
end
end
return retvec --return the "return vector" :)
end
function selectzombie()
local retvec={} --return vector (or a list)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector) --standart start
for i=0,vector:size()-1 do --check all creatures
local off
off=vector:getval(i)
local flags=engine.peek(off,ptr_Creature.flags)
if flags:get(12)==true then --if undead in anyway...
table.insert(retvec,off)--... add it to return vector
end
end
return retvec --return the "return vector" :)
end
function selectall()
local retvec={} --return vector (or a list)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector) --standart start
for i=0,vector:size()-1 do --check all creatures
local off
off=vector:getval(i)
local flags=engine.peek(off,ptr_Creature.flags)
if flags:get(1)==true and flags:get(12)==false then --if dead ...
table.insert(retvec,off)--... add it to return vector
end
end
return retvec --return the "return vector" :)
end
function selectcomp()
local retvec={} --return vector (or a list)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector) --standart start
for i=0,vector:size()-1 do --check all creatures
local off
off=vector:getval(i)
lfollow=engine.peek(off,ptr_Creature.followID) -- get target creatures "now following ID"
if lfollow ~=0xFFFFFFFF then --if its set
table.insert(retvec,off)--... add it to return vector
end
end
return retvec --return the "return vector" :)
end
function rum_tools.butcher() --flips slaughter flag on a creature causes any member of the fort to drag the poor sucker to the butcher shop and kill them for meat. yum
--first three lines same as before (because we will need an offset of creature at location x,y,z)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
indx=GetCreatureAtPos(getxyz())
--indx=0
--print(string.format("%x",vector:getval(indx)))
flg=engine.peek(vector:getval(indx),ptr_Creature.flags) --get flags
flg:flip(49) -- 76 is ghostliness flag.
--flg:set(1,0) -- alive
--flg:set(13,1) -- skeleton
engine.poke(vector:getval(indx),ptr_Creature.flags,flg) --save flags
end
function rum_tools.butcherdead() --search for dead creatures and flip on the butcher tag so that you can still serve a dead dwarf to feed millions.
local trgs=selectall()
for k,v in pairs(trgs) do
print("kattle:"..k)
local flags=engine.peek(v,ptr_Creature.flags)
flags:set(49,true) -- butch!
--flags:set(13,true)
--flags:set(12,false) no zombie
engine.poke(v,ptr_Creature.flags,flags)
end
end
function rum_tools.fortdy() --use the pointer on the creature flip off the is resident flag.
--first three lines same as before (because we will need an offset of creature at location x,y,z)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
indx=GetCreatureAtPos(getxyz())
--indx=0
--print(string.format("%x",vector:getval(indx)))
flg=engine.peek(vector:getval(indx),ptr_Creature.flags) --get flags
flg:set(51,false) -- 76 is ghostliness flag.
--flg:set(1,0) -- alive
--flg:set(13,1) -- skeleton
engine.poke(vector:getval(indx),ptr_Creature.flags,flg) --save flags
end
function selectindcomp(names) -- this function will allow you to change to a companion for a small period does not work
myoff=offsets.getEx("AdvCreatureVec") -- first find out where "Adventurer creature vector" is
vector=engine.peek(myoff,ptr_vector) -- +16 is a little fix...
--indx=GetCreatureAtPos(getxyz()) -- a little helper, gets index in the vector with current id. And getxyz() is a function that gets x y and z of that "X" pointer. These functions are in common.lua
local trgs=selectcomp()
for k,v in pairs(trgs) do
tnames={}
rnames={}
local name=engine.peek(v,ptt_dfstring):getval()
local lid= tools.getlegendsid(v)
if lid ~=0 then
print(i..")*Creature Name:"..name.." race="..engine.peekw(v+ptr_Creature.race.off).." legendid="..lid)
else
print(i..") Creature Name:"..name.." race="..engine.peekw(v+ptr_Creature.race.off))
end
if name ~="" and name~=nil then
tnames[v]=name
rnames[name]=v
end
end
print("=====================================")
print("type in name or number:")
r=io.stdin:read()
if tonumber(r) ==nil then
indx=rnames[r]
if indx==nil then return end
else
r=tonumber(r)
if r<vector:size() then indx=r else return end
end
return indx
end
function selectwolf()
local retvec={} --return vector (or a list)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector) --standart start
for i=0,vector:size()-1 do --check all creatures
local off
off=vector:getval(i)
local v2=engine.peek(off,ptr_Creature.hurt1)
if v2:getval(12)==15 and v2:getval(8)==0 then
--[[local flags=engine.peek(off,ptr_Creature.flags)
if flags:get(1)==0 then]]-- --if dead ...
table.insert(retvec,off)--... add it to return vector
end
end
return retvec --return the "return vector" :)
end
function rum_tools.change_adv2comp() --woop woop does not work
myoff=offsets.getEx("AdvCreatureVec") -- first find out where "Adventurer creature vector" is
vector=engine.peek(myoff,ptr_vector) -- +16 is a little fix...
indx=selectindcomp(names) -- a little helper, gets index in the vector with current id. And getxyz() is a function that gets x y and z of that "X" pointer. These functions are in common.lua
print("Swaping, press enter when done.")
-- next three lines is a common switch two things pattern
tval=vector:getval(0) -- get offset of player
vector:setval(0,vector:getval(indx)) -- set first offset to be the target's
vector:setval(indx,tval) -- set targets offset to the players
r=io.stdin:read() -- pause
-- again switch them around
tval=vector:getval(0)
vector:setval(0,vector:getval(indx))
vector:setval(indx,tval)
end
function rum_tools.comprace()
--first three lines same as before (because we will need an offset of creature at location x,y,z)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
--indx=GetCreatureAtPos(getxyz())
local trgs=selectcomp()
for k,v in pairs(trgs) do
--RaceTable=RaceTable or BuildNameTable() --slow.If loaded don't load again
--print("Enter race name ALL CAPS!:")
--repeat
entry=io.stdin:read() --get entry
--id=RaceTable[entry] -- find race id
--until id~=nil -- if not found repeat
engine.poke(v,ptr_Creature.race,entry)
end
end
function rum_tools.compraceez()
--first three lines same as before (because we will need an offset of creature at location x,y,z)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
--indx=GetCreatureAtPos(getxyz())
local trgs=selectcomp()
for k,v in pairs(trgs) do
RaceTable=RaceTable or BuildNameTable() --slow.If loaded don't load again
print("Enter race name ALL CAPS!:")
repeat
entry=io.stdin:read() --get entry
id=RaceTable[entry] -- find race id
until id~=nil -- if not found repeat
engine.poke(v,ptr_Creature.race,id)
end
end
function rum_tools.compiggybackride() --for people who want every one to cross the river or get every one in one spot so you can retreat/attack one person
--first three lines same as before (because we will need an offset of creature at location x,y,z)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
--indx=GetCreatureAtPos(getxyz())
local trgs=selectcomp()
for k,v in pairs(trgs) do
--RaceTable=RaceTable or BuildNameTable() --slow.If loaded don't load again
--print("Enter race name ALL CAPS!:")
repeat
flg=engine.peek(vector:getval(0),ptr_Creature.flags)
flg2=engine.peek(v,ptr_Creature.flags)
enty=engine.peek(vector:getval(0),ptr_Creature.y)
entx=engine.peek(vector:getval(0),ptr_Creature.x)
move=engine.peek(vector:getval(0),ptr_Creature.z)
engine.poke(v,ptr_Creature.z,move)
engine.poke(v,ptr_Creature.x,entx)
engine.poke(v,ptr_Creature.y,enty)
until flg:get(15) ==true or flg2:get(1) ==true
--entry=io.stdin:read() --get entry
--id=RaceTable[entry] -- find race id
--until id~=nil -- if not found repeat
--engine.poke(v,ptr_Creature.race,id)
end
end
function rum_tools.warptowag() --for those with wagons
--first three lines same as before (because we will need an offset of creature at location x,y,z)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
--indx=GetCreatureAtPos(getxyz())
local trgs=selectcomp()
for k,v in pairs(trgs) do
print("warpin' to Wagon")
local trgs=selectwagon()
for w,d in pairs(trgs) do
wary=engine.peek(d,ptr_Creature.y)
warx=engine.peek(d,ptr_Creature.x)
warz=engine.peek(d,ptr_Creature.z)
engine.poke(v,ptr_Creature.z,warz)
engine.poke(v,ptr_Creature.x,warx)
engine.poke(v,ptr_Creature.y,wary)
engine.poke(vector:getval(0),ptr_Creature.y,wary)
engine.poke(vector:getval(0),ptr_Creature.x,warx)
engine.poke(vector:getval(0),ptr_Creature.z,warz)
end
print("WARP COMPLETE! preparing getaway.")
--[[repeat
flg=engine.peek(vector:getval(0),ptr_Creature.flags)
flg2=engine.peek(d,ptr_Creature.flags)
enty=engine.peek(vector:getval(0),ptr_Creature.y)
entx=engine.peek(vector:getval(0),ptr_Creature.x)
move=engine.peek(vector:getval(0),ptr_Creature.z)
engine.poke(v,ptr_Creature.z,move)
engine.poke(v,ptr_Creature.x,entx)
engine.poke(v,ptr_Creature.y,enty)
until flg:get(15) ==true
print("Parking.")--]]
--entry=io.stdin:read() --get entry
--id=RaceTable[entry] -- find race id
--until id~=nil -- if not found repeat
--engine.poke(v,ptr_Creature.race,id)
end
end
function selectwagon()
local retvec={} --return vector (or a list)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector) --standart start
for i=0,vector:size()-1 do --check all creatures
local off
off=vector:getval(i)
local flags=engine.peek(off,ptr_Creature.flags)
if flags:get(74)==true then --if undead in anyway...
table.insert(retvec,off)--... add it to return vector
end
end
return retvec --return the "return vector" :)
end
function rum_tools.warp() --made before darius version really primitive
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
--indx=GetCreatureAtPos(getxyz())
print("how high?")
entry=io.stdin:read()
move=engine.peek(vector:getval(0),ptr_Creature.z)+entry
print("W and E")
entry=io.stdin:read()
move2=engine.peek(vector:getval(0),ptr_Creature.x)+entry
print("N and S")
entry=io.stdin:read()
move3=engine.peek(vector:getval(0),ptr_Creature.y)+entry
engine.poke(vector:getval(0),ptr_Creature.z,move)
engine.poke(vector:getval(0),ptr_Creature.x,move2)
engine.poke(vector:getval(0),ptr_Creature.y,move3)
end
function rum_tools.carry() --first crack at the carry command
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
indx=GetCreatureAtPos(getxyz())
--[[print("grab person how? N S E W")
--repeat
r=io.stdin:read()
if r=="N" then
enty=(engine.peek(vector:getval(0),ptr_Creature.y)+1)
elseif r=="S" then
enty=(engine.peek(vector:getval(0),ptr_Creature.y)-1)
elseif r=="W" then
entx=(engine.peek(vector:getval(0),ptr_Creature.x)-1)
elseif r=="E" then
entx=(engine.peek(vector:getval(0),ptr_Creature.x)+1)
end]]--
repeat
flg=engine.peek(vector:getval(0),ptr_Creature.flags)
flg2=engine.peek(vector:getval(indx),ptr_Creature.flags)
--print("how high?")
--entry=io.stdin:read()
Crepos=engine.peek(vector:getval(0),ptr_Creature.x)-1 --+entx
move=engine.peek(vector:getval(0),ptr_Creature.z)
--print("W and E")
--entry=io.stdin:read()
--move2=engine.peek(vector:getval(0),ptr_Creature.x)
--print("N and S")
--entry=io.stdin:read()
move3=engine.peek(vector:getval(0),ptr_Creature.y) --+enty
engine.poke(vector:getval(indx),ptr_Creature.z,move)
engine.poke(vector:getval(indx),ptr_Creature.x,Crepos)
engine.poke(vector:getval(indx),ptr_Creature.y,move3)
until flg:get(15) ==1 or flg2:get(1) ==1
end
function rum_tools.carryEX() --better version of the said carry command to use this have the pointer on top of the creature you want to hold and insert a letter may lead to invisible blocks so user beware.
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
indx=GetCreatureAtPos(getxyz())
print("grab person how? N S E W")
--repeat
r=io.stdin:read()
if r=="N" then
repeat
flg=engine.peek(vector:getval(0),ptr_Creature.flags)
flg2=engine.peek(vector:getval(indx),ptr_Creature.flags)
enty=engine.peek(vector:getval(0),ptr_Creature.y)+1
entx=engine.peek(vector:getval(0),ptr_Creature.x)
move=engine.peek(vector:getval(0),ptr_Creature.z)
engine.poke(vector:getval(indx),ptr_Creature.z,move)
engine.poke(vector:getval(indx),ptr_Creature.x,entx)
engine.poke(vector:getval(indx),ptr_Creature.y,enty)
until flg:get(15) ==true or flg2:get(1) ==true
elseif r=="S" then
repeat
flg=engine.peek(vector:getval(0),ptr_Creature.flags)
flg2=engine.peek(vector:getval(indx),ptr_Creature.flags)
enty=engine.peek(vector:getval(0),ptr_Creature.y)-1
entx=engine.peek(vector:getval(0),ptr_Creature.x)
move=engine.peek(vector:getval(0),ptr_Creature.z)
engine.poke(vector:getval(indx),ptr_Creature.z,move)
engine.poke(vector:getval(indx),ptr_Creature.x,entx)
engine.poke(vector:getval(indx),ptr_Creature.y,enty)
until flg:get(15) ==true or flg2:get(1) ==true
elseif r=="W" then
repeat
flg=engine.peek(vector:getval(0),ptr_Creature.flags)
flg2=engine.peek(vector:getval(indx),ptr_Creature.flags)
entx=engine.peek(vector:getval(0),ptr_Creature.x)-1
enty=engine.peek(vector:getval(0),ptr_Creature.y)
move=engine.peek(vector:getval(0),ptr_Creature.z)
engine.poke(vector:getval(indx),ptr_Creature.z,move)
engine.poke(vector:getval(indx),ptr_Creature.x,entx)
engine.poke(vector:getval(indx),ptr_Creature.y,enty)
until flg:get(15) ==true or flg2:get(1) ==true
elseif r=="E" then
repeat
flg=engine.peek(vector:getval(0),ptr_Creature.flags)
flg2=engine.peek(vector:getval(indx),ptr_Creature.flags)
entx=engine.peek(vector:getval(0),ptr_Creature.x)+1
enty=engine.peek(vector:getval(0),ptr_Creature.y)
move=engine.peek(vector:getval(0),ptr_Creature.z)
engine.poke(vector:getval(indx),ptr_Creature.z,move)
engine.poke(vector:getval(indx),ptr_Creature.x,entx)
engine.poke(vector:getval(indx),ptr_Creature.y,enty)
until flg:get(15) ==true or flg2:get(1) ==true
end
--[[flg=engine.peek(vector:getval(0),ptr_Creature.flags)
flg2=engine.peek(vector:getval(indx),ptr_Creature.flags)
--print("how high?")
--entry=io.stdin:read()
--Crepos=engine.peek(vector:getval(0),ptr_Creature.x)+entx
move=engine.peek(vector:getval(0),ptr_Creature.z)
--print("W and E")
--entry=io.stdin:read()
move2=engine.peek(vector:getval(0),ptr_Creature.x)
--print("N and S")
--entry=io.stdin:read()
move3=engine.peek(vector:getval(0),ptr_Creature.y)
repeat
engine.poke(vector:getval(indx),ptr_Creature.z,move)
engine.poke(vector:getval(indx),ptr_Creature.x,entx)
engine.poke(vector:getval(indx),ptr_Creature.y,enty)
until flg:get(15) ==1 or flg2:get(1) ==1]]--
end
function rum_tools.Fortilate() -- make creature same civ as the area their in great for converting adventurers to citizens of a fort.
vector=engine.peek(offsets.getEx("CreatureVec"),ptr_vector)
id=engine.peekd(offsets.getEx("CreaturePtr"))
print(string.format("Vec:%d cr:%d",vector:size(),id))
off=vector:getval(id)
crciv=engine.peek(off,ptr_Creature.civ)
curciv=engine.peekd(offsets.getEx("CurrentRace")-12)
if curciv==crciv then
print("Friendly")
--engine.poke(off,ptr_Creature.civ,curciv)
flg=engine.peek(off,ptr_Creature.flags)
flg:set(17,false)
engine.poke(off,ptr_Creature.flags,flg)
else
print("Enemy or Adventurer- making friendly")
engine.poke(off,ptr_Creature.civ,curciv)
flg=engine.peek(off,ptr_Creature.flags)
flg:set(17,false)
flg:set(19,false)
engine.poke(off,ptr_Creature.flags,flg)
end
end
function selectciv()
local retvec={} --return vector (or a list)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector) --standart start
for i=0,vector:size()-1 do --check all creatures
local off
off=vector:getval(i)
local crciv=engine.peek(off,ptr_Creature.civ)
local curciv=engine.peek(vector:getval(0),ptr_Creature.civ)
if curciv==crciv then
--[[local flags=engine.peek(off,ptr_Creature.flags)
if flags:get(1)==false then]]-- --if dead ...
table.insert(retvec,off)--... add it to return vector
end
end
return retvec --return the "return vector" :)
end
function selectciv1() -- this grabs any who is apart of the first civ aka Civ number "1"
local retvec={} --return vector (or a list)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector) --standart start
for i=0,vector:size()-1 do --check all creatures
local off
off=vector:getval(i)
local crciv=engine.peek(off,ptr_Creature.civ)
--local curciv=engine.peek(vector:getval(0),ptr_Creature.civ)
if crciv==1 then
--[[local flags=engine.peek(off,ptr_Creature.flags)
if flags:get(1)==false then]]-- --if dead ...
table.insert(retvec,off)--... add it to return vector
end
end
return retvec --return the "return vector" :)
end
function rum_tools.returnfort() -- goes through all who are apart of your civ and flips off the is resident tag also has left over code form previous testing.
local trgs=selectciv()
for k,v in pairs(trgs) do
print("members:"..k)
local flags=engine.peek(v,ptr_Creature.flags)
flags:set(51,false) -- alive!
--flags:set(13,true)
--flags:set(12,false) no zombie
engine.poke(v,ptr_Creature.flags,flags)
end
local trgs=selectciv1()
for w,q in pairs(trgs) do
print("pets:"..w)
local flags=engine.peek(q,ptr_Creature.flags)
flags:set(26,true) -- alive!
--flags:set(13,true)
--flags:set(12,false) no zombie
engine.poke(q,ptr_Creature.flags,flags)
end
end
function rum_tools.ControlCiv() -- mass assemble of every one in your fort though they will be non companions if you fast travel
--first three lines same as before (because we will need an offset of creature at location x,y,z)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
local trgs=selectciv()
for k,v in pairs(trgs) do
print("members:"..k)
trgid=engine.peek(vector:getval(0),ptr_Creature.ID) --get players ID
engine.peek(v,ptr_Creature.followID) -- get target creatures "now following ID"
engine.poke(v,ptr_Creature.followID,trgid) -- if not just write the players ID.
end
end
function rum_tools.ControlCiv2() -- this fixes the Fast travel issue and will make them permanently a member of your companions best for military heavy groups and armies.
--first three lines same as before (because we will need an offset of creature at location x,y,z)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
leg=offsets.getEx("Legends")
legvec=engine.peek(leg,ptr_vector)
local trgs=selectciv()
for k,v in pairs(trgs) do
print("members:"..k)
trgid=engine.peek(vector:getval(0),ptr_Creature.ID) --get players ID
playerlegid=rum_tools.getlegendsid(vector:getval(0))
trglegid=rum_tools.getlegendsid(v)
trgid=engine.peek(vector:getval(0),ptr_Creature.ID) --get players ID
engine.poke(v,ptr_Creature.followID,trgid) -- if not just write the players ID.
engine.poke(legvec:getval(trglegid),ptr_legends2.follow,playerlegid)
end
end
function selecttame()
local retvec={} --return vector (or a list)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector) --standart start
for i=0,vector:size()-1 do --check all creatures
local off
off=vector:getval(i)
local flags=engine.peek(off,ptr_Creature.flags)
if flags:get(26)==true then --if tame in anyway...
table.insert(retvec,off)--... add it to return vector
end
end
return retvec --return the "return vector" :)
end
function rum_tools.tamilate() -- this function causes any tame critter to be turn into civ one or apart of your civ number I need to change this so that it just does the latter.
vector=engine.peek(offsets.getEx("AdvCreatureVec"),ptr_vector)
--id=GetCreatureAtPos(getxyz())
local trgs=selecttame()
for k,v in pairs(trgs) do
--print(string.format("Vec:%d cr:%d",vector:size(),id))
print("tamed" ..k)
--off=vector:getval(id)
crciv=engine.peek(v,ptr_Creature.civ)
curciv=engine.peek(vector:getval(0),ptr_Creature.civ)
if curciv==crciv then
print("unlocked-making locked")
engine.poke(v,ptr_Creature.civ,1)
flg=engine.peek(v,ptr_Creature.flags)
flg:set(51,false)
flg:set(26,false)
engine.poke(v,ptr_Creature.flags,flg)
else
print("locked- making unlocked")
engine.poke(v,ptr_Creature.civ,curciv)
flg=engine.peek(v,ptr_Creature.flags)
flg:set(51,false)
flg:set(19,false)
engine.poke(v,ptr_Creature.flags,flg)
end
end
end
function rum_tools.Convert() -- for changing the civ number of the companion to match the adventurer.
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
--id=engine.peekd(offsets.getEx("CreaturePtr"))
--print(string.format("Vec:%d cr:%d",vector:size(),id))
local trgs=selectcomp()
for k,v in pairs(trgs) do
print("members:"..k)
off=v
crciv=engine.peek(off,ptr_Creature.civ)
curciv=engine.peek(vector:getval(0),ptr_Creature.civ)
if curciv==crciv then
print("Friendly")
--engine.poke(off,ptr_Creature.civ,curciv)
flg=engine.peek(off,ptr_Creature.flags)
flg:set(17,false)
engine.poke(off,ptr_Creature.flags,flg)
else
print("Enemy or Adventurer- making friendly")
engine.poke(off,ptr_Creature.civ,curciv)
flg=engine.peek(off,ptr_Creature.flags)
flg:set(17,false)
flg:set(19,false)
engine.poke(off,ptr_Creature.flags,flg)
end
end
end
function rum_tools.deadwarp()
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
local tx,ty,tz
local trgs=selectdead()
for k,v in pairs(trgs) do
tx,ty,tz=getxyz()
print("Warp to coords:"..tx.." "..ty.." "..tz)
engine.poke(v,ptr_Creature.x,tx)
engine.poke(v,ptr_Creature.y,ty)
engine.poke(v,ptr_Creature.z,tz)
end
end
function rum_tools.zomwarp()
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
local tx,ty,tz
local trgs=selectzombie()
for k,v in pairs(trgs) do
tx,ty,tz=getxyz()
print("Warp to coords:"..tx.." "..ty.." "..tz)
engine.poke(v,ptr_Creature.x,tx)
engine.poke(v,ptr_Creature.y,ty)
engine.poke(v,ptr_Creature.z,tz)
end
end
if not(FILE) then -- if not in script mode
rum_tools.menu:add("Toggle wutest",rum_tools.maketest)
rum_tools.menu:add("Change flag",rum_tools.changeflag)
rum_tools.menu:add("Ressurection Fix",rum_tools.ressurect)
--rum_tools.menu:add("?Toggle hostile?",rum_tools.hostilate)
rum_tools.menu:add("?control undead?",rum_tools.ControlZombie)
rum_tools.menu:add("control civ",rum_tools.ControlCiv)
rum_tools.menu:add("?control civ?",rum_tools.ControlCiv2)
rum_tools.menu:add("healer",rum_tools.ressurectcomp)
rum_tools.menu:add("Mass Ressurection",rum_tools.ressurectall)
rum_tools.menu:add("?Reveal ambush?",rum_tools.nosneak)
rum_tools.menu:add("?passive ghost time?",rum_tools.ghostin)
rum_tools.menu:add("?SkeltoZombies?",rum_tools.skeltozombie)
rum_tools.menu:add("?Zombiestoskel?",rum_tools.zombietoskel)
rum_tools.menu:add("Zombies fix",rum_tools.Zombieressurect)
rum_tools.menu:add("?necromancer?",rum_tools.Zombieressurectandcontrol)
rum_tools.menu:add("?harm?",rum_tools.Hurt)
rum_tools.menu:add("?returntofort?",rum_tools.returnfort)
rum_tools.menu:add("?carry?",rum_tools.carry)
rum_tools.menu:add("?carryex?",rum_tools.carryEX)
rum_tools.menu:add("?warp?",rum_tools.warp)
rum_tools.menu:add("?warp2wagon?",rum_tools.warptowag)
rum_tools.menu:add("?piggy backin?",rum_tools.compiggybackride)
rum_tools.menu:add("?group sneak?",rum_tools.compsneak)
rum_tools.menu:add("?bye civ?",rum_tools.nociv)
rum_tools.menu:add("change make member of civ",rum_tools.Fortilate)
rum_tools.menu:add("?make companions fortplayable?",rum_tools.fortcomps)
rum_tools.menu:add("?makefort playable?",rum_tools.fortdy)
rum_tools.menu:add("gut a friendly",rum_tools.butcher)
rum_tools.menu:add("gut a dead",rum_tools.butcherdead)
rum_tools.menu:add("?harm part?",rum_tools.Hurtselected)
rum_tools.menu:add("?werebronze?",rum_tools.lycanressurect)
rum_tools.menu:add("?Companionsracechange?",rum_tools.comprace)
rum_tools.menu:add("?Companionsracechange easier?",rum_tools.compraceez)
rum_tools.menu:add("lock up pets",rum_tools.tamilate)
rum_tools.menu:add("cleanupfloors",rum_tools.fixwarp)
rum_tools.menu:add("move zed",rum_tools.zomwarp)
rum_tools.menu:add("move souls",rum_tools.deadwarp)
rum_tools.menu:add("convert companions",rum_tools.Convert)
--rum_tools.menu:add("Swap to companion",rum_tools.change_adv2comp)
--rum_tools.menu:add("beastmaster",rum_tools.tamingcompanions)
rum_tools.menu:display()
--[[
choices={,{adv_tools.makeghost,"Toggle ghostliness"},{adv_tools.hostilate,"Toggle hostile"},{function () return end,"Quit"}} --make a table of function+string pairs
print("Select choice:")
for p,c in pairs(choices) do
print(p..")."..c[2]) -- print choices names
end
repeat
ans=tonumber(io.stdin:read())
if ans==nil or not(ans<=table.maxn(choices) and ans>0) then
print("incorrect choice")
end
until ans~=nil and (ans<=table.maxn(tdir) and ans>0)
choices[ans][1]() --run the choice
--]]
end<..> Though I Ponder the miss chance of communicating to animals using this,<..>what do you mean? Talking to animals?
<..> that and finally seeing if one can have babies with adventurers in 31.xx.Should not be so hard. (If Runesmith does not give that ability i could look into it.) AFAIK: you need ability to change a few flags for the retired adventurer and maybe his civ?
function rum_tools.fixwarp()
local mapoffset=offsets.getEx("WorldData")--0x131C128+offsets.base()
local x=engine.peek(mapoffset+24,DWORD)
local y=engine.peek(mapoffset+28,DWORD)
local z=engine.peek(mapoffset+32,DWORD)
--vec=engine.peek(mapoffset,ptr_vector)
print("Blocks loaded:"..x.." "..y.." "..z)
print("Select type:")
print("1. All (SLOW)")
print("2. range (x0 x1 y0 y1 z0 z1)")
print("3. One block around pointer")
print("anything else- quit")
q=io.stdin:read()
n2=tonumber(q)
if n2==nil then return end
if n2>3 or n2<1 then return end
local xs,xe,ys,ye,zs,ze
if n2==1 then
xs=0
xe=x-1
ys=0
ye=y-1
zs=0
ze=z-1
elseif n2==2 then
print("enter x0:")
xs=tonumber(io.stdin:read())
print("enter x1:")
xe=tonumber(io.stdin:read())
print("enter y0:")
ys=tonumber(io.stdin:read())
print("enter y1:")
ye=tonumber(io.stdin:read())
print("enter z0:")
zs=tonumber(io.stdin:read())
print("enter z1:")
ze=tonumber(io.stdin:read())
function clamp(t,vmin,vmax)
if t> vmax then return vmax end
if t< vmin then return vmin end
return t
end
xs=clamp(xs,0,x-1)
ys=clamp(ys,0,y-1)
zs=clamp(zs,0,z-1)
xe=clamp(xe,xs,x-1)
ye=clamp(ye,ys,y-1)
ze=clamp(ze,zs,z-1)
else
xs,ys,zs=getxyz()
xs=math.floor(xs/16)
ys=math.floor(ys/16)
xe=xs
ye=ys
ze=zs
end
local xblocks=engine.peek(mapoffset,DWORD)
local flg=bit.bnot(bit.lshift(1,3))
for xx=xs,xe do
local yblocks=engine.peek(xblocks+xx*4,DWORD)
for yy=ys,ye do
local zblocks=engine.peek(yblocks+yy*4,DWORD)
for zz=zs,ze do
local myblock=engine.peek(zblocks+zz*4,DWORD)
if myblock~=0 then
for i=0,255 do
local ff=engine.peek(myblock+0x67c+i*4,DWORD)
ff=bit.band(ff,flg) --set 14 flag to 1
engine.poke(myblock+0x67c+i*4,DWORD,ff)
end
end
end
print("Blocks done:"..xx.." "..yy)
end
end
end
did some play testing with this program over the weekend, works very nice. I thought it would be like your old "FE" but I was surpised to see that using the Embark option seems to make the selected races that have [INTELLIGENT] allow you to change their labors and do normal hauling tasks until you use Friendship, very very nice. But Is there anyway to assign creatures other then dwarves to noble postions or military?I suspect its the same as FE. You need to activate tools->give sentience before that creature comes to map (i.e. before embarking or before migrants come) that way they are added to some super secret vector that allows them to be picked for positions and military (also growing up could also trigger this)
hmm so one could slap this on before embarking into a human town on humans and they will be able to apply to said noble ranks?Offsets now are in hex (it was in base 10 before) and also now it's possible to add script to find new offsets.
also I wonder why the offset in the new one isn't a set of numbers like the last projects you had.
The last -f check seem to fail on CreatureGloss.
sweet thanks will try also could you add a profession changer? so that I can bypass the noble and children canceling the ability to join you.hmm so one could slap this on before embarking into a human town on humans and they will be able to apply to said noble ranks?Offsets now are in hex (it was in base 10 before) and also now it's possible to add script to find new offsets.
also I wonder why the offset in the new one isn't a set of numbers like the last projects you had.
The last -f check seem to fail on CreatureGloss.
And i really need to add some sort of way to get DF version :/. Also is the site down? or is it just me?
EDIT: try new version with "-c" flag Rumrusher.
getting version 1.3, so I will need to use "Give senientance to creature" in the tool menu then use the embark function? and then utimatly embark, to have them to be assigned to milita and noble? and would this also include them getting married and reproducing?from my progress all you need is the Pet tag on the creature for them to start breeding but expect no father's listed. though on the subject of the no towns.
had some trouble with v1.3 the "Friendship" option seems to be broken unless it does not like it when a given creature has been given Sentiant, so I reverted back to 1.2 to see if I get the same problem. Still no luck with assigning noble status or milita but then again its probally a end-user fault (me that is)Hmm can you say what happens exactly in v1.3? And about nobles and militia seems i'm still missing something...
Bumping because added adventurer swapper. Usage: tools->Change Adventurer, type in number you want to change in, do stuff, press enter to get back. Used for: stealing items from unsuspecting npc, starting chaos (attack npc with npc) and most importantly arming your friends.No more Cage traps!
Do other races fall in strange moods?
darn thanks for the info on that I notice that you can input any number and become a unknown creature which save me from death during a bogeyman rush... sadly I was a child and a buzzard and both pretty got wrecked during the attacks.Do other races fall in strange moods?
They do. Had a few troll artifacts.
Also would be very cool to change adventurer "permanently" (i.e. with travelling and quests...) but i think it depends on history entries and thats an uncharted territory.
Edit 3: also caves make a very good houses, till some demon comes and kicks you out. Killed 3 adventurers (+6 henchmen) already.
Is there any chance that embark can be modified to let you select the specific caste of a creature you want along?Will look into it, but no promises.
Invalid peek type
plugins/common.lua:101: attempt to index local 'vec' (a nil value)for embark,race num:0
Invalid peek type
plugins/common.lua:91: attempt to index local 'vec' (a nil value)for friendship, andInvalid peek type
plugins/common.lua:101: attempt to index local 'vec' (a nil value)for migrants. Strangely, simple embark and embark anywhere work fine. I haven't tried change race or adventurer yet.Searching offsets:
Offset "CreatureGloss" Invalid peek type
terminate called after throwing an instance of 'lua::runtime_error'
what(): offsets.lua:37: attempt to index local 'vec' (a nil value)which I assume is the same thing Rumrusher had, but -c does nothing for me.This is the windows version I'm having issues with. Thinking about it, maybe it has issues with the SDL version. Will try that now.have you try going to CMD and getting the file there using the -F function?
Yes, of course. Which version are you using, SDL or Legacy? And which version of DFusion? The newest? Trying to track down where the difference is.can you paste what is printed in the beginning when you run it with "-f". And the dfusion is designed to work best with newest DF SDL version.
This looks great, I can't wait to try it all out. Just a few things, to make sure I have this correctly.Hmm not sure about slaves. The runesmith does have the ability to change creatures civ (though its not hard to make a tool or small lua script for dfusion) and idk if it has the ability to change flags (from invader to friendly) but the part that i have no idea is military and nobles. Oh and usually you don't need to remove [PET] tag for it to work. If you have a large running fort i suggest backing up and just experimenting.
I personally don't care about mixed-race embarks / migrants - not opposed, just not too worried about it. What I really want to do is take Elf/Goblin prisoners and make them citizens (slaves) of my fort - I can do that with tools->race changer, right? (Actually, can't Runesmith do something like that? Have it, but haven't used it yet).
If I do that, then I can use friendship to make them work, right?
Second, Tigermen. If I read this right, I'll have to remove the [PET] tag to give them labors, but they can still be in the military without it? I believe removing the tag means the Elves will stop bringing them tamed. I assume I can wait for them to bring a breeding pair (or three), remove the [PET] tag from the save raws, then use friendship?
Even if not, still a great set of tools I plan to make good use of.
Well, I started a new fort in a Savage Tropical biome, and by mid-summer had caught and tamed a few Tigermen. I removed the PET tag from the raws (think I'll try putting it back in later) and used friendship - they can be assigned labors now, but as far as I can tell they won't actually do any of them. Tried to get them to mine - nothing. Tried to smooth stone - nothing. Tried to get them to just haul stuff around - still nothing. I used Runesmith and changed their Civilization value to the same as my dwarves, then later removed the tame tag. No luck. I'm not much of a modder or programmer (yet), so I don't know what I should try next; just though I'd report on my actions.Did you add tigerman to the races.txt in plugins\friendship ?
I also tried using the Give Sentience tool at one point, but I think it crashed or something. Not too sure what happened there. Later: I just tried again, and after typing the token name, the program just sits there doing nothing. Have to ctrl-c to get out of it.
Now I need to wait for goblins to attack, and see what I can do with them.
Also, I'm running 31.16 for now. I wait for most/all of the utilities to update before changing versions.
CreatureGloss : 0x12e5370
CreaturePtr : 0xacf848
CreatureVec : 0x12df5a0
CurrentRace : 0x10cdaf0
StartDwarfs : 0x4f87e2
Yes, I did that before anything else. Don't think they would have had labors enabled otherwise.Can you upload a save? I happened to me before with dragon (thought maybe megabeastness made him lazy) but maybe there is something else.
And in case anyone asks, yes, I spelled it Tigerman like in the raws, not Tigermen.
H:\df_31_17_win>dffusion -f
lua working ok!
Running lua file:common.lua
Searching offsets:
Offset "CreatureGloss" Invalid peek type
terminate called after throwing an instance of 'lua::runtime_error'
what(): offsets.lua:37: attempt to index local 'vec' (a nil value)
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.I don't suppose you're using .net? I've had issues with .net on my install since forever. Not always, but enough for it to be a possibility, and that termination message looks awfully familiar...Getting the same issue with new version, even with the new offsets you posted :( Really want to try the migrant changer, oh well
H:\deons genesis 3.18 ASCII\deons genesis 3.18 ASCII>dffusionLooking at this more closely... H:\ is an ext3 volume, managed through ext2 volume manager. Apparently it's not liking how directories can be stored on such, because it's seeing patterns.lua as one, which is crazy. I don't even know what's going on here - I'd have to look at the methods you're using for file retrieval. In any case, copying it to my windows partition makes everything peachy.
lua working ok!
Running lua file:common.lua
Found plugins:
1).patterns.lua
2).tools
3).simple_embark
4).migrants
5).friendship
6).embark
1
launching patterns.lua...
cannot open plugins/patterns.lua/plugin.lua: No such file or directory
H:\deons genesis 3.18 ASCII\deons genesis 3.18 ASCII>
<...>
TLDR: I'll just move something off of C:\ to make room for DF :)
Sure, no problem. Never done that before - just upload the region folder from the save folder, right?
http://www.mediafire.com/?6yr2waje2jmm9sx
<...>
I'm running this with .18 but I can't seem to get the adventurer changer to work, how do I do that exactly I get no number and typing in a name doesn't effect anything.well if you type any number you could swap you to someone unless you try that and nothing happens.
well if you type any number you could swap you to someone unless you try that and nothing happens.
just checked the .18 version and OH my same problem. looks like DFusion needs a .18 update.well if you type any number you could swap you to someone unless you try that and nothing happens.
That's what I meant, I typed a number hit enter, and nothing happened, and I can't get -f to work either (It fails on Creature Gloss) I assume the adventure changing issue was because of the Offset labeld "Adv" something or other... anyone have that offset for .18?
and I can't get -f to work either (It fails on Creature Gloss) I assume the adventure changing issue was because of the Offset labeld "Adv" something or other... anyone have that offset for .18?The reason it's failing at Creature Gloss is because you're running -f at the title screen. That won't work, you're supposed to do it in-game in either adventure mode or fortress mode. Anyway, try the offsets darius provided.
Code: [Select]CreatureGloss : 0x12e5370
CreaturePtr : 0xacf848
CreatureVec : 0x12df5a0
CurrentRace : 0x10cdaf0
StartDwarfs : 0x4f87e2
just checked the .18 version and OH my same problem. looks like DFusion needs a .18 update.That's strange, it works for me.
shame to
So -f doesn't work when playing Adventure Mode? (I was getting the creature gloss failure while running DfFusion -f with an adventurer loaded up.)just break
Okay time to go add those lines, thank you Darius
edit: Add the entire line? or just add the "break" after the line?
Oh and i am not sure about "-f" in adv mode.It does work. Just tested it.
It does work. Just tested it.
CreatureGloss : 0x12e5370
CreaturePtr : 0xacf848
CreatureVec : 0x12df5a0
CurrentRace : 0x10cdaf0
StartDwarfs : 0x4f87e2
and do not run the "-f" as it will fail and delete good values.I after looking at the code for swapping I wonder in a "non-coder layman's" term way how adventurer swapping worked."non-coder layman's" first do you know pointers if yes skip this:
Does it boot out the original character and insert the name and number the creature playing?(if so then that would explain why traveling out{with a different body} would lead to a random character... the game must have a extra piece of code that searches for either the number/name of either the last character or the adventurer the game started with, but seems to fail at that so it goes and selects the closest one.).
also I only modded in Bronze Colossi and some reactions and all seem fine except for the adventurer Reactions. which seems to fail.
bummer.
nah doesn't work.It should ask it only once (for every time it does not detect offset in offsets.txt) but due to a logical bug (program never really quits) it never saves the file. That's why you need to ask for race every time.
I even updated the version from 1.5 to 1.6 and still doesn't work, and played as a dwarf.
edit: some how testing this in fort mode lead to access to adventure mode swapping.
but does it have to ask for a Race of char?
plugins/embark/plugin.lua:9: bad argument #1 to 'pairs' (table expected, got function)So...How do I get it working?
anyway to make a plugin or tool that will allow you to replace missing bodyparts (or ones still there) for a certain creature with the orginal tissue or something else (like a milita commmander with a clear diamond eye and a steel arm and leg), and a plugin or tool to add special tags to a certain creature (not race) so say you have the only flying fire breathing cat in the world. Also I updated my guideDamn that sounds dwarven. Although not sure how the first part could work (are there any similar already in game workings?) but the second part could be doable.
EDIT: or a HEAL ALL tool
no, currently scripts have no way to trigger. This is only usefull when you need more then one command.anyway to make a plugin or tool that will allow you to replace missing bodyparts (or ones still there) for a certain creature with the orginal tissue or something else (like a milita commmander with a clear diamond eye and a steel arm and leg), and a plugin or tool to add special tags to a certain creature (not race) so say you have the only flying fire breathing cat in the world. Also I updated my guideDamn that sounds dwarven. Although not sure how the first part could work (are there any similar already in game workings?) but the second part could be doable.
EDIT: or a HEAL ALL tool
let me guess you try to travel using a companion? oh and if the screen goes black(with no sudden close on DF then) try mashing the space bar and movement keys awhile the game needs to search and zoom over to the creature you swap.Excuse me, but how do you get the adventurer swap tool to work? It asks me for my character's race, and refuses to believe that "human" is a valid answer (instead giving me the line "incorrect race" over and over again, with absolutely no indication of what is the correct answer). My adventurer is human, of course.
Okay, it had to be in all caps. Unfortunately, swapping now causes the game to crash as soon as I attempt to move. The entire view screen goes black as well, although the rest of the interface does not. Any suggestions?
Swapping works (besides the crash when it jumps to a creature not revealed), though it doesn't seem to pick up custom races, anyone get this to work with a swap with alternate character races, (Like Genesis with all it's non-van creatures) I can't seem to get it to switch to a Marsh Dwarf (City-based trader dwarves I made.)man I just notice the crashes too.
It's kinda weird, it shows the name of said dwarf , in this case cilub, but when I jump to that name it puts me to the nearest human companion (Again the dwarf is from the Marsh dwarf entity I added)
let me guess you try to travel using a companion? oh and if the screen goes black(with no sudden close on DF then) try mashing the space bar and movement keys awhile the game needs to search and zoom over to the creature you swap.
New version works, although in certain areas it can print several hundred creatures, resulting in the relevant ones running off the top of the list (presumably due to catching a larger-than-average portion of cavern critters or demons or some such). Not really a huge problem; you just need to move somewhere else where this doesn't happen.well with the swapping you could just make a reaction that trains swimming.
The armor I've outfitted my single NPC companion has allowed him to last long enough to become a Legendary Spearman. He's pretty damn badass at this point; he has seventy-odd personal kills at this point, and is perfectly capable of holding his own against several lesser-skilled bandits and murdering them all without any help. He's even started to one-shot people, "BOOM headshot!" style. Plus, he has a lovely collection of scars from back before I got him armor (amazingly none of which caused major disability).
Adventurer Swap definitely makes NPC allies vastly more viable (particularly if they drop an item due to an injury that heals, like when he dropped his spear due to a broken wrist). Now I just need to find a beach somewhere that doesn't freeze (this entire continent seems pretty cold, unhelpfully) and get him to at least Adequate Swimmer so he won't die if he randomly falls in a murky pool again . . . had to savescum twice due to that so far >_>
Um... interesting thing happened: the creature i left in a cave (human fisherman) "attacked" me when i was travelling (had a message you feel uneasy and he appeared standing next to me...)yeah really weird too, you think you just mod the trait to have the "loves adventuring" and removes all blocks so you can ask them your self.
oh darius for self modding Dfusion how would someone like me go through and make swapping/taming creatures just by using the cursor?In adventure mode?
Here a suggestion I don't really need but would be fun to play around.I will try that. Although it might be possible to make a more permanent solution if ill find where DF keeps creatures while they are traveling ( i hope not in files...)
What if you could change the race of the character(though traveling might lead to wolves with human title turning into humans and humans with cat titles turning into cats and vice versa)?
Okay updated! Now adventurer tools have pointer based (that pointer that you get by looking or talking) targeting AND its heavily commented (thats closest i could get to tutorial...).I expect something on par of needing to save the game first before having the changes are permanent. I guess you help pave a small way to playing as proper night creatures and stealing folks for converting purposes. that and for roleplaying experiences.Here a suggestion I don't really need but would be fun to play around.I will try that. Although it might be possible to make a more permanent solution if ill find where DF keeps creatures while they are traveling ( i hope not in files...)
What if you could change the race of the character(though traveling might lead to wolves with human title turning into humans and humans with cat titles turning into cats and vice versa)?
Edit: it worked... but very crashy. Changed before traveling and when landed it still was a dragon, but crashed soon after starting to fight (although it breathed fire)
function adv_tools.racechange()
--first three lines same as before (because we will need an offset of creature at location x,y,z)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff+16,ptr_vector)
indx=GetCreatureAtPos(getxyz())
RaceTable=RaceTable or BuildNameTable() --slow.If loaded don't load again
print("Enter race name ALL CAPS!:")
repeat
entry=io.stdin:read() --get entry
id=RaceTable[entry] -- find race id
until id~=nil -- if not found repeat
engine.poke(vector:getval(indx),ptr_Creature.race,id)
end
insert this into adv_tools/plugin.lua (in the second line)choices={{adv_tools.changeadv,"Change adventurer"},{adv_tools.MakeFollow,"Make creature follow"},{function () return end,"Quit"}} --make a table of function+string pairs
withchoices={{adv_tools.changeadv,"Change adventurer"},{adv_tools.MakeFollow,"Make creature follow"},{adv_tools.racechange,"Change race"},{function () return end,"Quit"}} --make a table of function+string pairs
But be warned: its quite buggy and will crash DF.
don't look at their description.
also don't stand in the line of fire of friendly dragons (does not crash but melts ;) )don't look at their description.
a creature so horrendous the mere description of it's aspect is enough to drive men insane!
STILL don't look into the description of a changed character... even if you saved and travel with them.also don't stand in the line of fire of friendly dragons (does not crash but melts ;) )don't look at their description.
a creature so horrendous the mere description of it's aspect is enough to drive men insane!
STILL don't look into the description of a changed character... even if you saved and travel with them.So you can change your companion to a Colossus or Fiend but you're forbidden to look at them directly ever again? Medusa effect huh? So the Caravan arc will also give new hurdles to jump over...interesting...
well the game will turn to stone and crumble.STILL don't look into the description of a changed character... even if you saved and travel with them.So you can change your companion to a Colossus or Fiend but you're forbidden to look at them directly ever again? Medusa effect huh? So the Caravan arc will also give new hurdles to jump over...interesting...
in memory:
here starts the flags
v
xxxyyyy...
so getting a byte with peek will only get you a sum of flags. Getting individual flag is a bit different. I'll write the code for that soon.ptt_dfflag={}
function ptt_dfflag.flip(self,num) --flip one bit in flags
local of=math.floor (num/8);
self[of]=bit.bxor(self[of],bit.lshift(1,num%8))
end
function ptt_dfflag.get(self,num) -- get one bit in flags
local of=math.floor (num/8);
if bit.band(self[of],bit.lshift(1,num%8))~=0 then
return 1
else
return 0
end
end
function ptt_dfflag.set(self,num,val) --set to on or off one bit in flags
if (self:get(num)~=val) then
self:flip(num)
end
end
function ptt_dfflag.new(size) -- create new flag pattern of size
local ret={}
for i=0,size-1 do
ret[i]={off=i,rtype=BYTE};
end
ret.flip=ptt_dfflag.flip
ret.get=ptt_dfflag.get
ret.set=ptt_dfflag.set
return ret;
end
then somewhere after "ptr_Creature={}" addptr_Creature.flags={off=224,rtype=ptt_dfflag.new(10)}-- not sure if its 10 or more...
Using this now becomes very simple if you have creature offset (with get creature at pos or similar):myoff=offsets.getEx("AdvCreatureVec") -- first find out where "Adventurer creature vector" is
vector=engine.peek(myoff+16,ptr_vector) -- +16 is a little fix...
tval=vector:getval(0) -- get offset of player
flg=engine.peek(tval,ptr_Creature.flags) --get flags
flg:flip(76) -- 76 is ghostliness flag. Other flags (from older versions :1-> dead, 2->insane,3->artifact made,4->merchant and so on...)
engine.poke(tval,ptr_Creature.flags,flg) --save flags
well the flags are a bit special case. Creature flags take up 4 (or more) bytes and indvidual bits are flagsalso I Almost understand what you did in the adv_tools from staring hard enough what I don't get is from realizing all of it goes back to pattens.lua and the creature section (which has a list of numbers and some with "(D Word)" next to it) from what I got from digging round common state these might mean 1 byte 2 byte and 3 byte, which leads to the biggest puzzle with this. Could I swap only the flags of a creature? That and could I find some way to force a pointer(or auto select the next body in line) in DF and allow the user to change to the nearest body around. the latter major hurdle is from not knowing if adding a number(with title to it so the program can connect) between the creature section in the pattern.lua will work and I can test to see which number has the right flag.Code: [Select]in memory:so getting a byte with peek will only get you a sum of flags. Getting individual flag is a bit different. I'll write the code for that soon.
here starts the flags
v
xxxyyyy...
z=engine.peek(someoffset, ptt_vector)
--what this means is read data from someoffset using pattern ptt_vector. That in turn means:
--read someoffset+0 with size DWORD (4bytes) and save it to z.st (because ptt_vector.st={off=0,rtype=DWORD})
--and read someoffset+4 with size DWORD and save it to z.en (ptt_vector.en={off=4,rtype=DWORD})
Patterns can also have functions, those are left unchanged (and copied to end object). function ptr_vector:size() -- the ':' means ptr_vector.size(self)
return (self.en-self.st)/engine.sizeof(self.type)
end
-- so this in turn makes z(loaded before) have function z:size()
-- if you make a lua helper function
function print_all(t)
for k,v in pairs(t) do
print(tostring(k).."=>"..tostring(v))
end
end
--and use it:
print_all(z)
-- you should get everything what is in that object.
Also all code that does that sits in common.lua. See engine.peekpattern/pokepattern. Maybe writing a sentence when you first learn it is harder than deciphering it.Maybe true. I have another hypothesis: less interaction/encouragement and a goal to make something more impressive than DF (that is near impossible).
function adv_tools.notdead()
--this will revive a dead soul from the grave... chances of it following you not so much
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff+16,ptr_vector)
indx=GetCreatureAtPos(getxyz())
flg=engine.peek(vector:getval(indx),ptr_Creature.flags) --get flags
flg:flip(1,76) -- this will turn off the dead flag while turning on Ghostliness
engine.poke(vector:getval(indx),ptr_Creature.flags,flg) --save flags
endif my idea correct one could swap the body with a demon model and swap back, or if I'm wrong should swap back to the human model as a dead demon and swap back.flg:flip(1,76)
does not work as you think it wouldflg:flip(1)
flg:flip(76)
would workflg:set(1,0) --not dead
flg:set(76,1) -- is ghost
function adv_tools.undead()
--this will revive a dead soul from the grave as a somewhat zombie... chances of it following you not so much
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff+16,ptr_vector)
indx=GetCreatureAtPos(getxyz())
flg=engine.peek(vector:getval(indx),ptr_Creature.flags) --get flags
flg:set(1,0)
flg:set(12,1) --note this person is now part live mostly part dead to fully rez further test on bringing back body parts will be needed.
engine.poke(vector:getval(indx),ptr_Creature.flags,flg) --save flags
end function tools.selectall(vector)
tnames={}
rnames={}
--[[print("vector1 size:"..vector:size())
print("vector2 size:"..vector2:size())]]--
for i=0,vector:size() do
--print(string.format("%x",vector:getval(i)))
local name=engine.peek(vector:getval(i),ptt_dfstring):getval()
tnames[i]=name
rnames[name]=i
end
end
indx=rnames[r]
if indx==nil then return
end
end
return indx
end
function tools.zombiemode()
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff+16,ptr_vector)
indx=tools.selectall(vector)
lzombie=engine.peek(vector:getval(indx))
flg=engine.peek(vector:getval(indx),ptr_Creature.flags)
if ~=flg:(1,1) then
flg:set(1,0)
flg:set(12,1)
flg:set(17,1)
end
end
engine.poke(vector:getval(indx),ptr_Creature.flags,flg) --save flags
end
endI kinda got a little 'End' happy here.
function selectall()
local retvec={} --return vector (or a list)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff+16,ptr_vector) --standart start
for i=0,vector:size()-1 do --check all creatures
local off
off=vector:getval(i)
local flags=engine.peek(off,ptr_Creature.flags)
if flags:get(1) then --if dead ...
tables.insert(retvec,off)--... add it to return vector
end
end
return retvec --return the "return vector" :)
end
and then using it:deadthings=selectall()
for _,v in pairs(deadthings) do
flg=engine.peek(v,ptr_Creature.flags)
flg:set(1,0)
flg:set(12,1)
engine.poke(v,ptr_Creature.flags)
end
things like these make me wish that it would be possible to trigger lua scripts from DF (e.g. drop an idol-> a slave zombie army, throw a coin-> summon a golem, eat some creature flesh-> turn into a ghost :) )
function tools.zombiemode()
for _,v in pairs(selectall()) do
flg=engine.peek(v,ptr_Creature.flags)
flg:set(1,0)
flg:set(12,1)
engine.poke(v,ptr_Creature.flags)
end
end
Oh and sorry that it did not work (i am not in university and can't test it)
oh wait about that death thing.Df removes units only if: you abandon fort or you move out of non-important location. If you move out of important location (i think dark fort included) it saves all creatures (prob non-dead though...) into that site.
if you die retiring ends up removing your character from the game... or was that retiring in a nonexistent place (dark fort)lead to the adventurer removal.
this makes me wonder about the hostilities tag?
is it there for the sake of converting wild animals and friendlies to savage beasts and tame pets.
found out that if you didn't strike your demons or your demons didn't strike you.oh wait about that death thing.Df removes units only if: you abandon fort or you move out of non-important location. If you move out of important location (i think dark fort included) it saves all creatures (prob non-dead though...) into that site.
if you die retiring ends up removing your character from the game... or was that retiring in a nonexistent place (dark fort)lead to the adventurer removal.
this makes me wonder about the hostilities tag?
is it there for the sake of converting wild animals and friendlies to savage beasts and tame pets.
Hostilities toggle (which i forgot i added) makes creature either friendly to you civ or invader so its more usefull in fort mode to make gladiator fights between your units.
Oh and there is creature flags from older version of DFHACK:Spoiler (click to show/hide)
you can calm them down by swapping to them and apply hostilities on your character.how do you do this? It supposed to work only in fort mode.
Good news: found a way to make creatures stick (i.e. travel with you) bad news: needs function calling and thats always a pain...well it's the same look at creature function as in the adv_tools stuff and I guess this is close to changing the civ of the creature to yours so if I just swap to the creature and have it's civ copied over to the adventurer then the adventurer would be apart of that (civ while keeping ties to other places)?Quoteyou can calm them down by swapping to them and apply hostilities on your character.how do you do this? It supposed to work only in fort mode.
Edit2: ok made following stick even without function calling. Drawback- target needs to be a historical important figure.
Edit3: also found how to change bodies (permanently) with historically important target
Edit4: updated program
found how to change bodies (permanently) with historically important targetSweet, gonna' try this later and make a certain Emperor be more "proactive" in his kingdoms troubles...THROUGH VIOLENCE!
I tried that with the "lady". Her combat skills sucked and she died very quickly. Now the castle stands without any lord or lady :DOh I know...better check Legends 1st to see a Leader that actually lasted throughout World-Gen's harshness. I know of a certain Empress who kept on losing her newly born children to monsters attacking their fort, as if her child is monster magnet/trigger and the youngest only surviving because gen already stopped...she's itching for vengeance.
Is there an way I could get this in a zip fileChanged the file to zip. But i would suggest getting 7zip (homesite (http://www.7-zip.org/)) clearly whatever program you are using for archives is not powerfull enough (plus 7zip is free).
well it work for some characters but when you swap to a random NPC with no history then it's back to jumping and you can't escape from this by finding a warlord and swapping to them either.
I take it I have to slap a history recorded flag on the person first before swapping or just swap to companions and travel.
edit: well if you die in game you can never come back by retiring. Just found this out from losing Em un-retiring. Unless there a way to remove the Dead/killed flag in legends then there still perma death.
darn should have quick recruit then perma recruit then unperma then perma swap then.Is there an way I could get this in a zip fileChanged the file to zip. But i would suggest getting 7zip (homesite (http://www.7-zip.org/)) clearly whatever program you are using for archives is not powerfull enough (plus 7zip is free).well it work for some characters but when you swap to a random NPC with no history then it's back to jumping and you can't escape from this by finding a warlord and swapping to them either.
I take it I have to slap a history recorded flag on the person first before swapping or just swap to companions and travel.
edit: well if you die in game you can never come back by retiring. Just found this out from losing Em un-retiring. Unless there a way to remove the Dead/killed flag in legends then there still perma death.
Just slapping a flag could be not enough. The reason is that when `DF` recruits a person it checks if it is historically important person, if not makes him important (creates an entry in legends list) and only then flips that flag.
Hey. Just got Dfusion and started playing with to heal a dwarf. I posted this in the runesmith thread, but thought I'd try here, too, since the question is about Dfusion.what version of dwarf fortress do you have... if it's 17 then sorry this only works for 18.
I'm trying to heal a dwarf with a yellow lower leg who is being ignored by the others and is starving to death.
Using DFusion while in fort mode. Do I use adv_tools? If so, this is what I get when I try to change adventurer, I get this (it IS fort mode):
plugins/patterns.lua:33: attempt to perform arithmetic on local 'num' (a nil value)
If I use change race, it asks me to enter a race in all caps, and then gives me the above error message no matter what I enter.
Any way to heal a dwarf in fort mode using Dfusion?
I've also done dfusion -r to update the offsets.txt.
Ah, didn't realize that I needed to use the "look" mode to select the dwarf. Thank you! It's crashing after I changerace-save-reload, but at least it's doing something now!Hey. Just got Dfusion and started playing with to heal a dwarf. I posted this in the runesmith thread, but thought I'd try here, too, since the question is about Dfusion.what version of dwarf fortress do you have... if it's 17 then sorry this only works for 18.
I'm trying to heal a dwarf with a yellow lower leg who is being ignored by the others and is starving to death.
Using DFusion while in fort mode. Do I use adv_tools? If so, this is what I get when I try to change adventurer, I get this (it IS fort mode):
plugins/patterns.lua:33: attempt to perform arithmetic on local 'num' (a nil value)
If I use change race, it asks me to enter a race in all caps, and then gives me the above error message no matter what I enter.
Any way to heal a dwarf in fort mode using Dfusion?
I've also done dfusion -r to update the offsets.txt.
if you have 18 then did you select your dwarf first by using the Look command If not then next time have the pointer on top of the wounded dwarf the program need to know the exact direction the creature is.
If you did that and it's 18 then it must been you hitting the swap adventure function when your in fort mode.
and isn't it -f not -r for getting offsets for dfusion?
edit: I was wondering does the perma adventure swap also grant access to retiring as that character or do I need to swap back to the adventurer after I'm done.
function adv_tools.wagonmode()
--first three lines same as before (because we will need an offset of creature at location x,y,z)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff+16,ptr_vector)
indx=GetCreatureAtPos(getxyz())
--indx=0
--print(string.format("%x",vector:getval(indx)))
flg=engine.peek(vector:getval(indx),ptr_Creature.flags) --get flags
flg:set(1,0)
flg:set(74,0)
engine.poke(vector:getval(indx),ptr_Creature.flags,flg)
r=io.stdin:read() -- repeat for it too work... also creature will be dead.
flg:set(1,0) -- brings back to life
flg:flip(74) -- will scuttle if not repeat.
engine.poke(vector:getval(indx),ptr_Creature.flags,flg)
end adv_tools.menu:add("caravan mode",adv_tools.wagonmode)Not being a programmer, I don't completely understand how to use this so I could really use some help. I have a pet that keeps getting an infection and dying so I want to prevent this by healing it. From what I've understood from this thread you can heal a creature by changing it to another kind of creature (save/travel) and then changing it back (save/travel). I've tried messing with this but can't understand how to use it. Can anyone help me figure this out?Well this cures missing limbs and damaged nerves though I hadn't gone and fix infections with this.
Thanks, that sounds like that could help. Its an infected wound so I guess the demon would be the option to go with. However, my main problem is that I really just can't figure out how to make the program actually do that. I just can't seem to understand how to give the program commands. It just keeps crashing whenever I do anything. An example of what to type in with fill in the blanks or something would be great. Please help a poor non-programmer that is completely lost. :(well sadly you have to use the pointer on top of the creature for it to work. the code for Adv_tools all are on the getting the 'xyz' for finding the creature id to do any work on it.
Ok, so if I am getting this right what I have to do is put the cursor over the pet using look and then go to the Adv_tools. Would I then use the change adventurer tool? Where does the demon part come in? Thanks for all the help you are giving me one this.the demon part comes from using race changer the different random body parts replaces all the ones the creature had including the infected one.
Its a Blightscale Dragon from Legendary Lands. I embarked on the spot just so I could capture the stupid thing and so I can't have it dying from a stupid broken leg infection. If it dies I'll never have my dragon army of doom! Also, my problem is that I don't know what to actually type in. So far I get that I put the cursor over the dragon and then type in the instructions, which I know are part of the Adv_tools section. I just don't know what specifically to type in. Step by step instructions might be necessary.wait fort mode then you best brush up on Deon's creatures Raw name or you might end up not getting back that Blightscale Dragon. oh now I can understand and give a proper step by step.
Thank you so much for helping me all this time. I think I almost have it now. I just don't know what to literally type in. When I just type in the number for change race the whole thing crashes. I've tried typing the 3 with DEMON_1 after it in different ways but it just says incorrect choice. One example of what exactly to type and I think I have this figured out. Thanks again for all the help you are giving me.well is it on top of the creature, and did you type in all caps CAT then save?
function tools.racechange()
myoff=offsets.getEx("CreatureVec")
vector=engine.peek(myoff,ptr_vector)
local offset=0
tx,ty,tz=getxyz()
for i=0,vector:size() do
x=engine.peek(vector:getval(i),ptr_Creature.x)
y=engine.peek(vector:getval(i),ptr_Creature.y)
z=engine.peek(vector:getval(i),ptr_Creature.z)
if x==tx and y==ty and z==tz then
offset=vector:getval(i)
break;
end
end
if offset==0 then
print("Failed to find creature!")
return
end
RaceTable=RaceTable or BuildNameTable() --slow.If loaded don't load again
print("Enter race name ALL CAPS!:")
repeat
entry=io.stdin:read() --get entry
id=RaceTable[entry] -- find race id
until id~=nil -- if not found repeat
engine.poke(offset,ptr_Creature.race,id)
end
tools.menu:add("Change creature race",tools.racechange)
function adv_tools.wagonmode()
--first three lines same as before (because we will need an offset of creature at location x,y,z)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff+16,ptr_vector)
indx=GetCreatureAtPos(getxyz())
--indx=0
--print(string.format("%x",vector:getval(indx)))
flg=engine.peek(vector:getval(indx),ptr_Creature.flags) --get flags
flg:set(1,0)
flg:set(74,0)
engine.poke(vector:getval(indx),ptr_Creature.flags,flg)
print("To stay normal press y, else hit Enter turn Wagon mode on.")
r=io.stdin:read() -- repeat for it too work... also creature will be dead.
if r== "y" then
flg=engine.peek(vector:getval(indx),ptr_Creature.flags)
flg:set(1,0)
engine.poke(vector:getval(indx),ptr_Creature.flags,flg)
else
flg=engine.peek(vector:getval(indx),ptr_Creature.flags)
flg:set(1,0)
flg:flip(74)
engine.poke(vector:getval(indx),ptr_Creature.flags,flg)
end
endsadly I wonder why does it only work when the creature is dead. guess it from the fact it only meant to be use only for caravans in fort mode and those where pulled by some type of animal, oh well makes me wonder oh well still wonder why that zombie mod doesn't work.function adv_tools.insertflag()
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff+16,ptr_vector)
indx=GetCreatureAtPos(getxyz())
flg=engine.peek(vector:getval(indx),ptr_Creature.flags)
print("insert flag:")
entry=io.stdin:read()
flg:flip(entry)
engine.poke(vector:getval(indx),ptr_Creature.flags,flg)
end
Okay i'm back. Just tried zombies and the problem is (i think) with the resurrected creatures that they have no body so next action involving body (attack defense or sth) will crash DF.also if you slap on Resurrection limb healing with Zombie you could fix that crashing issue since they revive with no limbs.
EDIT: added two plugins by rumrusher, ALSO: RESSURECTION!!!!11ONE with limb healing!!!!
Yeah had that idea after releasing... But now I just found out that i must do another homework for university :(no big though I might have to find a way to get "v" in the zombie command to fit into the "Indx" in the resurrection code and I don't think placing indx=v would work.
function adv_tools.zombie()
local trgs=selectall()
for k,v in pairs(trgs) do
print("Zombie:"..k)
v2=engine.peek(v,ptr_Creature.hurt1)
for i=0,v2:size()-1 do
v2:setval(i,0)
end
v2=engine.peek(v,ptr_Creature.hurt2)
v2.type=DWORD
for i=0,v2:size()-1 do
v2:setval(i,0)
end
engine.poke(v,ptr_Creature.bloodlvl,60000) --give blood
engine.poke(v,ptr_Creature.bleedlvl,0) --stop some bleeding...
local flg=engine.peek(v,ptr_Creature.flags)
local flags=engine.peek(v,ptr_Creature.flags)
flg:set(1,0) --ALIVE
flags:set(12,1) --zombie
flg:set(39,0) -- leave body yet again
flg:set(37,0) -- something todo with wounds- lets you walk again.
engine.poke(v,ptr_Creature.flags,flags)
end
end
something like this, but have not time to test:oh shoot that's what I got...Code: [Select]function adv_tools.zombie()
local trgs=selectall()
for k,v in pairs(trgs) do
print("Zombie:"..k)
v2=engine.peek(v,ptr_Creature.hurt1)
for i=0,v2:size()-1 do
v2:setval(i,0)
end
v2=engine.peek(v,ptr_Creature.hurt2)
v2.type=DWORD
for i=0,v2:size()-1 do
v2:setval(i,0)
end
engine.poke(v,ptr_Creature.bloodlvl,60000) --give blood
engine.poke(v,ptr_Creature.bleedlvl,0) --stop some bleeding...
local flg=engine.peek(v,ptr_Creature.flags)
local flags=engine.peek(v,ptr_Creature.flags)
flg:set(1,0) --ALIVE
flags:set(12,1) --zombie
flg:set(39,0) -- leave body yet again
flg:set(37,0) -- something todo with wounds- lets you walk again.
engine.poke(v,ptr_Creature.flags,flags)
end
end
function adv_tools.Zombieressurect()
local trgs=selectall()
for k,v in pairs(trgs) do
--indx=GetCreatureAtPos(v)
--indx=engine.peek(v,ptr_creature.ID)
print("Zombie:"..k)
v2=engine.peek(v,ptr_Creature.hurt1)
for i=0,v2:size()-1 do
v2:setval(i,0)
end
v2=engine.peek(v,ptr_Creature.hurt2)
v2.type=DWORD
for i=0,v2:size()-1 do
v2:setval(i,0)
end
engine.poke(v,ptr_Creature.bloodlvl,60000) --give blood
engine.poke(v,ptr_Creature.bleedlvl,0) --stop some bleeding...
local flags=engine.peek(v,ptr_Creature.flags)
flags:set(1,0) -- alive!
flags:set(12,1) --zombie
engine.poke(v,ptr_Creature.flags,flags)
end
end it was puzzling but I figured out that the problem was the vector getting value so I remove all of it and replace it with v.function adv_tools.Zombieressurectandcontrol()
local trgs=selectall()
for k,v in pairs(trgs) do
--indx=GetCreatureAtPos(v)
--indx=engine.peek(v,ptr_creature.ID)
print("Zombie:"..k)
v2=engine.peek(v,ptr_Creature.hurt1)
for i=0,v2:size()-1 do
v2:setval(i,0)
end
v2=engine.peek(v,ptr_Creature.hurt2)
v2.type=DWORD
for i=0,v2:size()-1 do
v2:setval(i,0)
end
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff+16,ptr_vector)
local trgs=selectall()
for k,v in pairs(trgs) do
trgid=engine.peek(vector:getval(0),ptr_Creature.ID) --get players ID
engine.peek(v,ptr_Creature.followID) -- get target creatures "now following ID"
engine.poke(v,ptr_Creature.followID,trgid) -- if not just write the players ID.
end
engine.poke(v,ptr_Creature.bloodlvl,60000) --give blood
engine.poke(v,ptr_Creature.bleedlvl,0) --stop some bleeding...
local flags=engine.peek(v,ptr_Creature.flags)
flags:set(1,0) -- alive!
flags:set(12,1) --zombie
engine.poke(v,ptr_Creature.flags,flags)
end
end
function adv_tools.ressurectall()
local trgs=selectall()
for k,v in pairs(trgs) do
--indx=GetCreatureAtPos(v)
--indx=engine.peek(v,ptr_creature.ID)
print("Zombie:"..k)
v2=engine.peek(v,ptr_Creature.hurt1)
for i=0,v2:size()-1 do
v2:setval(i,0)
end
v2=engine.peek(v,ptr_Creature.hurt2)
v2.type=DWORD
for i=0,v2:size()-1 do
v2:setval(i,0)
end
engine.poke(v,ptr_Creature.bloodlvl,60000) --give blood
engine.poke(v,ptr_Creature.bleedlvl,0) --stop some bleeding...
local flags=engine.peek(v,ptr_Creature.flags)
flags:set(1,0) -- alive!
flags:set(39,0) -- leave body yet again
flags:set(37,0) -- something todo with wounds- lets you walk again.
engine.poke(v,ptr_Creature.flags,flags)
end
end
function adv_tools.ControlZombie()
--first three lines same as before (because we will need an offset of creature at location x,y,z)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff+16,ptr_vector)
local trgs=selectzombie()
for k,v in pairs(trgs) do
trgid=engine.peek(vector:getval(0),ptr_Creature.ID) --get players ID
engine.peek(v,ptr_Creature.followID) -- get target creatures "now following ID"
engine.poke(v,ptr_Creature.followID,trgid) -- if not just write the players ID.
end
end
function selectalive()
local retvec={} --return vector (or a list)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff+16,ptr_vector) --standart start
for i=0,vector:size()-1 do --check all creatures
local off
off=vector:getval(i)
local flags=engine.peek(off,ptr_Creature.flags)
if flags:get(1)==0 then --if dead ...
table.insert(retvec,off)--... add it to return vector
end
end
return retvec --return the "return vector" :)
end
function selectzombie()
local retvec={} --return vector (or a list)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff+16,ptr_vector) --standart start
for i=0,vector:size()-1 do --check all creatures
local off
off=vector:getval(i)
local flags=engine.peek(off,ptr_Creature.flags)
if flags:get(12)==1 then --if dead ...
table.insert(retvec,off)--... add it to return vector
end
end
return retvec --return the "return vector" :)
end I was going to add in a perma zombie res control but then it was to much code to cut and paste into right... that and having horrible zombies who will attack you unless you're a ghost isn't what I had in mind. oh well with this it would make the process of making them follow much easier.Yeah, if you ever make it again, it would be grand :). I miss firebreathing statues.I missed making fire breathing weapons for adventure mode. man those where the days in fact I think making spells was the thing that cause me to stumble into adventurer breeding.
lol I was changing adventures and i set the cursor in the wrong spot now I'm in HFS and a Clown :oyeah best way out of that jam is to find some one that is historic like a lady or a townsmen and perma adv change into them or kill thing to make what ever body your in added to the legends and you won't jump around when you Travel.
Edit: every time i sleep and travel i end up as a diffrent creature now i'm a plump helmet man...
function selectcomp()
local retvec={} --return vector (or a list)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff+16,ptr_vector) --standart start
for i=0,vector:size()-1 do --check all creatures
local off
off=vector:getval(i)
lfollow=engine.peek(off,ptr_Creature.followID) -- get target creatures "now following ID"
if lfollow ~=0xFFFFFFFF then --if its set
table.insert(retvec,off)--... add it to return vector
end
end
return retvec --return the "return vector" :)
end
function adv_tools.comprace()
--first three lines same as before (because we will need an offset of creature at location x,y,z)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff+16,ptr_vector)
--indx=GetCreatureAtPos(getxyz())
local trgs=selectcomp()
for k,v in pairs(trgs) do
--RaceTable=RaceTable or BuildNameTable() --slow.If loaded don't load again
--print("Enter race name ALL CAPS!:")
--repeat
entry=io.stdin:read() --get entry
--id=RaceTable[entry] -- find race id
--until id~=nil -- if not found repeat
engine.poke(v,ptr_Creature.race,entry)
end
end
function adv_tools.lycanressurect()
repeat
local trgs=selectall()
for k,v in pairs(trgs) do
--indx=GetCreatureAtPos(v)
--indx=engine.peek(v,ptr_creature.ID)
print("Werewolf:"..k)
v2=engine.peek(v,ptr_Creature.hurt1)
for i=0,v2:size()-1 do
v2:setval(i,0)
end
v2=engine.peek(v,ptr_Creature.hurt2)
v2.type=DWORD
for i=0,v2:size()-1 do
v2:setval(i,0)
end
engine.peek(v,ptr_Creature.civ)
engine.poke(v,ptr_Creature.civ,-1)
engine.poke(v,ptr_Creature.bloodlvl,60000) --give blood
engine.poke(v,ptr_Creature.bleedlvl,24) --stop some bleeding...
local flags=engine.peek(v,ptr_Creature.flags)
flags:set(1,0) -- alive!
flags:set(12,0) --zombie
flags:set(17,1)
flags:set(19,1)
engine.poke(v,ptr_Creature.flags,flags)
engine.poke(v,ptr_Creature.race,151)
end
until r==7
end
function adv_tools.ressurectcomp()
local trgs=selectcomp()
for k,v in pairs(trgs) do
--indx=GetCreatureAtPos(v)
--indx=engine.peek(v,ptr_creature.ID)
print("Companion:"..k)
v2=engine.peek(v,ptr_Creature.hurt1)
for i=0,v2:size()-1 do
v2:setval(i,0)
end
v2=engine.peek(v,ptr_Creature.hurt2)
v2.type=DWORD
for i=0,v2:size()-1 do
v2:setval(i,0)
end
engine.poke(v,ptr_Creature.bloodlvl,60000) --give blood
engine.poke(v,ptr_Creature.bleedlvl,0) --stop some bleeding...
local flags=engine.peek(v,ptr_Creature.flags)
flags:set(1,0) -- alive!
flags:set(39,0) -- leave body yet again
flags:set(37,0) -- something todo with wounds- lets you walk again.
engine.poke(v,ptr_Creature.flags,flags)
end
end
so far killing a creature twice will cause the killer's legend data to be buggy and will cause a crash if unless you don't have them as a companion and or didn't rekill something. so I wonder if one could remove the creature from legend mode?You could try editing its legend id (e.g. setting it to 0 or -1 or something like that) then killing then restoring.hmm so I have to code in the revival to have this legend remove first before killing, I might go test that oh one thing about the hurt pattern in creature is there a way one could select different parts of the body to be affected? I ask so that I could see to making a death requirement function where if someone dies/wounded a certain way (which will be able to be trigger by syndromes) they will be turn.
I can't get this to run.what did you try?
I mean when I open it it basecly closes imedetly.I can't get this to run.what did you try?
DFfusion.exe
pause
then save, run and type what is reported.
do you have do you have Dwarf fortress running? it automatically closes when that happens.Yes
Create a new file called whatever.bat and paste this:I just tryed this and the same thing happens, it opens the immediately closes.Code: [Select]DFfusion.exethen save, run and type what is reported.
pause
DFfusion.exe>log.txt
inside test.bat. Run test.bat and then paste log.txt
hmm... try this then:Wheres test.batCode: [Select]DFfusion.exe>log.txtinside test.bat. Run test.bat and then paste log.txt
oh Darius about the removing legend information I really don't know how to do that... or target different body parts so that creatures with syndrome can cause a conversion.
engine.poke(creatureptr,ptr_Creature.legends,-1)
should work. As for second part, I don't quite understand what you mean...Awesome not everything is broken :D now just to try to fix everything else...oh man let me say
v2=engine.peek(vector:getval(indx),ptr_Creature.hurt1)
v2:setval(0,7) --remove zero-th limb or something... same with hurt2
Now i'm not really sure, i dont know what wounds vector does...
To target specific limb you need to change only one value in vectors (hurt1,hurt2 and/or wounds). Which corresponds to which limb i don't know. E.g:sweet atleast now I can throw in an if to the Select functionsCode: [Select]v2=engine.peek(vector:getval(indx),ptr_Creature.hurt1)Now i'm not really sure, i dont know what wounds vector does...
v2:setval(0,7) --remove zero-th limb or something... same with hurt2
function rum_tools.Hurtselected()
--repeat
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
indx=GetCreatureAtPos(getxyz())
if indx<0 then return end
--print(string.format("%x",vector:getval(indx)))
v2=engine.peek(vector:getval(indx),ptr_Creature.hurt1)
v3=engine.peek(vector:getval(indx),ptr_Creature.hurt2)
v3.type=DWORD
print("select body part 0=upperbody,4=lowerbody,8=head,12=right front leg,16=left front leg,20=")
r=io.stdin:read()
print("select infliction")
d=io.stdin:read()
v2:setval(r,d)
v3:setval(r,d) --remove zero-th limb or something... same with hurt2
end
This isn't a really important bug, but there is a redundancy in your code. In the file "common.lua", the method "GetCreatureAtPos(x,y,z)" isn't really using the "x,y,z" parameters. The first line of the method is "x,y,z=getxyz()". You should either remove that line, or have the method not take any parameters, so that "getxyz()" isn't being called twice for one use.Good catch. Fixed it and updated.
hmm so since the XYZ code is patch I might be able to get working on a Summon Teammates over to location.This isn't a really important bug, but there is a redundancy in your code. In the file "common.lua", the method "GetCreatureAtPos(x,y,z)" isn't really using the "x,y,z" parameters. The first line of the method is "x,y,z=getxyz()". You should either remove that line, or have the method not take any parameters, so that "getxyz()" isn't being called twice for one use.Good catch. Fixed it and updated.
Also added teleportation to adv_tools as requested by rumrusher.
function rum_tools.butcher()
--first three lines same as before (because we will need an offset of creature at location x,y,z)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
indx=GetCreatureAtPos(getxyz())
--indx=0
--print(string.format("%x",vector:getval(indx)))
flg=engine.peek(vector:getval(indx),ptr_Creature.flags) --get flags
flg:flip(49) -- 49 is slaughter flag.
--flg:set(1,0) -- alive
--flg:set(13,1) -- skeleton
engine.poke(vector:getval(indx),ptr_Creature.flags,flg) --save flags
enda butcher any creature code for those who want to snuff human caravans or nobles under the knife.in plugins\tools\plugin.lua:
print("Caste name:"..engine.peekstr(off).."...")
off=engine.peekd(off+0x514) -- <--change this to off=engine.peekd(off+0x524)
if(bit.band(engine.peekb(off+7),2)==2) then
will be updated next release.Just noticed that give sentience does not work with new version, quick fix:hmm also I was wondering do you find the address with a Hex editor like Cheat engine and write a code around it or do you do something different? I ask for the site changer been holding some outdated address and wonder how to fix it for getting a feel on how to add more plugins and maybe finding offsets for you.Code: [Select]in plugins\tools\plugin.lua:will be updated next release.
print("Caste name:"..engine.peekstr(off).."...")
off=engine.peekd(off+0x514) -- <--change this to off=engine.peekd(off+0x524)
if(bit.band(engine.peekb(off+7),2)==2) then
Also quite cool to have a troll miner (with a kitty as a pet) which you can trim :D (and kobolds, they should lay eggs but started with three guys...)
for k,v in pairs(offsets.getvectors()) do -- for each entry (here k is address of vector, v is times used)
vec=engine.peek(k,ptr_vector) -- load vector
print("Looking into:"..string.format("%x used:%d size=%d",k,v,vec:size())) --print all info...
end
Pasted that into research\plugin.lua and ran when DF was in legends mode (excerpt):for k,v in pairs(offsets.getvectors()) do
vec=engine.peek(k,ptr_vector)
if vec:size()==55 then -- look only for vector with 55 as size
print("Looking into:"..string.format("%x used:%d size=%d",k-offsets.base(),v,vec:size())) -- note the k-offsets.base()
end
end
Now there is only one hit and its:Looking into:131de24 used:8 size=55
Lets test it. In tools\plugins.lua there is function "tools.getsite(names)". In that function update the offsites line:local offsites=0x131DE24+offsets.base() --todo make normal offset
and test tools->change site.wow cool! Gonna play with it now... Actually it would not be that hard to implement this into DFusion (after all the offsets are known)tried using the pointer?
Edit: Tweak not working for me. Finds process and tile edit crashes when trying to read something.
mapoffset=offsets.getEx("WorldData")
x=engine.peek(mapoffset+24,DWORD)
y=engine.peek(mapoffset+28,DWORD)
z=engine.peek(mapoffset+32,DWORD)
xblocks=engine.peek(mapoffset,DWORD)
for xx=0,x-1 do
for yy=0,y-1 do
for zz=0,z-1 do
yblocks=engine.peek(xblocks+xx*4,DWORD)
zblocks=engine.peek(yblocks+yy*4,DWORD)
myblock=engine.peek(zblocks+zz*4,DWORD)
if myblock~=0 then
for i=0,255 do
ff=engine.peek(myblock+0x67c+i*4,DWORD)
ff=bit.bor(ff,bit.lshift(1,14)) --set 14 flag to 1
engine.poke(myblock+0x67c+i*4,DWORD,ff)
end
end
end
end
end
and into offsets.lua:function f_world()
local pos=offsets.base()
pos=offsets.find(pos+6,0xa1,ANYDWORD,0x8b,0x4c,0x88,0xFC,EOL)
print("offset:"..string.format("%x",pos))
if pos~=0 then
return engine.peekd(pos+1)-offsets.base()
end
return 0
end
offsets.new("WorldData",f_world)
and into offsets.txt (this is for 31.20):WorldData : 0x1322128
Also not yet sure if all offsets work with 31.20 but it looks okay...Hehe deleted with release of new version. It was 10x10 stone hut with cellar and a 20x10 crypt. One thing was annoying - it was a 4x4 embark so traveling into it and out took a lot of time. It's way easier to embar 2x2 and build something there. (almost) Did that on 31.20 but halfway through it got attacked by a titan :/oh man I used Nano fort to make a 1x1 tile that way I won't have to walk 2 Embark tiles to my sites. also I wonder reclaim spam will build enough of a peasant army to protect the area at night.
EDIT: OMG even reclaiming is so easy when everything does not scatter everywhere...
well good news I discover how to store items... using Tweak. All I did was check on occupancy's 14-blood which cause any item on that tile to stay there when you leave
...built a first house for my adventurer
It was 10x10 stone hut with cellar and a 20x10 crypt.
...
EDIT: OMG even reclaiming is so easy when everything does not scatter everywhere...
'Retiring' forts is a crazy popular suggestion. Just below gunpowder and steampunk in it's perennial nature.
Now another question: Can you play in two fortress this way :D (play in one-> adv mode-> travel -> fort mode in second-> adv mode->travel ->etc...)Mind Blown. wait so this will work if you took a Lair and convert it to a fort as well right? oh to remove/add "Is resident" from dwarves it's flag (51) so if I get as far as you guys in exploring Fort adv then running a code to search and remove add is key.
Woah it worked... Unfortunately everyone killed each other (unpaused in arena mode) so horse traveled...
Found an interesting thing... If you go to other fort with adventurer it no longer is same size as it was. I suspect that made me lose last fort (my only adventurer moved too far...)so is there a way to save in fort mode once you get there in adventure mode?
Edit: nope that does not work... It just quits after a while... :/
function rum_tools.carry()
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
indx=GetCreatureAtPos(getxyz())
--[[print("grab person how? N S E W") -- this was supposed to make it possible to grab the person in any direction other than West but if you could get it to work be I'm okay with it.
--repeat
r=io.stdin:read()
if r=="N" then
enty=(engine.peek(vector:getval(0),ptr_Creature.y)+1)
end
elseif r=="S" then
enty=(engine.peek(vector:getval(0),ptr_Creature.y)-1)
end
elseif r=="W" then
entx=(engine.peek(vector:getval(0),ptr_Creature.x)-1)
end
elseif r=="E" then
entx=(engine.peek(vector:getval(0),ptr_Creature.x)+1)
end]]--
repeat
flg=engine.peek(vector:getval(0),ptr_Creature.flags)
flg2=engine.peek(vector:getval(0),ptr_Creature.flags)
--print("how high?")
--entry=io.stdin:read()
Crepos=engine.peek(vector:getval(0),ptr_Creature.x)-1 --+entx
move=engine.peek(vector:getval(0),ptr_Creature.z)+1 --this was for stunning enemies who would just use their new position to attack you for friendlies best remove this
--print("W and E")
--entry=io.stdin:read()
--move2=engine.peek(vector:getval(0),ptr_Creature.x)
--print("N and S") old code I had before you release your version
--entry=io.stdin:read()
move3=engine.peek(vector:getval(0),ptr_Creature.y) --+enty
engine.poke(vector:getval(indx),ptr_Creature.z,move)
engine.poke(vector:getval(indx),ptr_Creature.x,Crepos)
engine.poke(vector:getval(indx),ptr_Creature.y,move3)
until flg:get(15) ==1 or flg2:get(1) ==1
endFor DF version: 0.31.21
For DF version: MultipleOr, at least the description should mention backwards compatibility...?
Question:I tried it's only for 31.21 you could attempt to get the offsets (-f)for any of the older versions but yeah you might end up not getting all features.
The DFFD download page (http://dffd.wimbli.com/file.php?id=3354) says that the DFusion download is:QuoteFor DF version: 0.31.21
So, is only guaranteed compatible with 0.31.21? Or is backwards compatible as well?
If it is the latter, then perhaps the download page should say this instead?:QuoteFor DF version: MultipleOr, at least the description should mention backwards compatibility...?
Well, that's a problem for me. :(really one of my problems with Dfusion or any Warmist work is that removal of the old versions.
Recently, I was excited about the new features of the latest DFusion and so I downloaded the new version, while deleting the old version. Now I find out that DFusion is version specific (unlike DFHack). I had already decided to stick with .18 and my old fort for a while longer. (Also, I'm waiting for a few more bug fixes and for more mods to catch up.)
So now I'm really wishing I had not deleted the old version...
I was not expecting the same level of backwards compatibility as DFHack, with support for versions from long ago. But I was expecting support of at least a few recent versions. (I think the way DFHack does this is by keeping all the old offsets and some of the old code and it checks the version of DF you have installed, automatically matching the offsets and code with the correct version.)
I can appreciate that you support Toady and his new releases. But there were major changes and lots of bugs with the recent versions. And not everyone is willing to just abandon their well established forts and/or their megaprojects every time a new release comes out.
Perhaps you would consider uploading a couple of the most recent DFusion versions on a free file host such as mediafire (http://www.mediafire.com/) or dropbox (http://www.dropbox.com/)? At least, some of the more popular mods and tools do this, such as the Lazy Newb Pack (http://www.bay12forums.com/smf/index.php?topic=59026.0), Phoebus' Graphic Set (http://www.bay12forums.com/smf/index.php?topic=57557.0), and Ironhand's Graphics Set (http://www.bay12forums.com/smf/index.php?topic=53180.0). For that matter, I doubt the Dwarf Fortress File Depot (http://dffd.wimbli.com/) would mind if you kept a few of the old versions around a while.
AdvCreatureVec : 0x12a12c4
CreatureGloss : 0x12e5370
CreaturePtr : 0xacf848
CreatureVec : 0x12a12d4
CurrentRace : 0x10cdaf0
Legends : 0x12a1344
PlayerLegend : 0x1438bb4
StartDwarfs : 0x4f87e2
WordVec : 0x12e5520
Xpointer : 0x7127f0
function rum_tools.carryEX()
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
indx=GetCreatureAtPos(getxyz())
print("grab person how? N S E W")
--repeat
r=io.stdin:read()
if r=="N" then
repeat
flg=engine.peek(vector:getval(0),ptr_Creature.flags)
flg2=engine.peek(vector:getval(indx),ptr_Creature.flags)
enty=engine.peek(vector:getval(0),ptr_Creature.y)+1
entx=engine.peek(vector:getval(0),ptr_Creature.x)
move=engine.peek(vector:getval(0),ptr_Creature.z)
engine.poke(vector:getval(indx),ptr_Creature.z,move)
engine.poke(vector:getval(indx),ptr_Creature.x,entx)
engine.poke(vector:getval(indx),ptr_Creature.y,enty)
until flg:get(15) ==1 or flg2:get(1) ==1
elseif r=="S" then
repeat
flg=engine.peek(vector:getval(0),ptr_Creature.flags)
flg2=engine.peek(vector:getval(indx),ptr_Creature.flags)
enty=engine.peek(vector:getval(0),ptr_Creature.y)-1
entx=engine.peek(vector:getval(0),ptr_Creature.x)
move=engine.peek(vector:getval(0),ptr_Creature.z)
engine.poke(vector:getval(indx),ptr_Creature.z,move)
engine.poke(vector:getval(indx),ptr_Creature.x,entx)
engine.poke(vector:getval(indx),ptr_Creature.y,enty)
until flg:get(15) ==1 or flg2:get(1) ==1
elseif r=="W" then
repeat
flg=engine.peek(vector:getval(0),ptr_Creature.flags)
flg2=engine.peek(vector:getval(indx),ptr_Creature.flags)
entx=engine.peek(vector:getval(0),ptr_Creature.x)-1
enty=engine.peek(vector:getval(0),ptr_Creature.y)
move=engine.peek(vector:getval(0),ptr_Creature.z)
engine.poke(vector:getval(indx),ptr_Creature.z,move)
engine.poke(vector:getval(indx),ptr_Creature.x,entx)
engine.poke(vector:getval(indx),ptr_Creature.y,enty)
until flg:get(15) ==1 or flg2:get(1) ==1
elseif r=="E" then
repeat
flg=engine.peek(vector:getval(0),ptr_Creature.flags)
flg2=engine.peek(vector:getval(indx),ptr_Creature.flags)
entx=engine.peek(vector:getval(0),ptr_Creature.x)+1
enty=engine.peek(vector:getval(0),ptr_Creature.y)
move=engine.peek(vector:getval(0),ptr_Creature.z)
engine.poke(vector:getval(indx),ptr_Creature.z,move)
engine.poke(vector:getval(indx),ptr_Creature.x,entx)
engine.poke(vector:getval(indx),ptr_Creature.y,enty)
until flg:get(15) ==1 or flg2:get(1) ==1
end
end also I'm going to work on combining both the carryEX with my wagon mode so that one could push the companion along their journey which means companion storage and if I'm lucky quick warp to the wagon if their wounded.
function ptt_dfflag.set(self,num,val) --set to on or off one bit in flags
if(val==0) then val=false end --hehe c++ like fix...
if (self:get(num)~=val) then
self:flip(num)
end
end
F:\df_linux_31_21\df_31_21_win\df_fusion>DfFusion.exeRaces.txt:
lua working ok!
Running lua file:common.lua
Found plugins:
1).patterns.lua
2).embark
3).friendship
4).migrants
5).simple_embark
6).research
7).adv_tools
8).tools
3
launching friendship...
race num:226
Invalid peek type
plugins/common.lua:99: attempt to index local 'vec' (a nil value)
F:\df_linux_31_21\df_31_21_win\df_fusion>echo Kay, hit enter.
Kay, hit enter.
F:\df_linux_31_21\df_31_21_win\df_fusion>pause
Press any key to continue . . .
DWARFAm I doing something wrong? Or is there an offset problem?
HUMAN
well good news I discover how to store items... using Tweak. All I did was check on occupancy's 14-blood which cause any item on that tile to stay there when you leave...built a first house for my adventurerIt was 10x10 stone hut with cellar and a 20x10 crypt.
...
EDIT: OMG even reclaiming is so easy when everything does not scatter everywhere...
Holy crab apples! That's awesome! :o
Now all that's missing is a way to combine DFusion with DFMode (http://www.bay12forums.com/smf/index.php?topic=58809.0) in a way that allows swapping between Fortress Mode and Adventure Mode without all those unpleasant side effects (http://www.bay12forums.com/smf/index.php?topic=58809.msg2060966#msg2060966).
I don't suppose there is a way to prevent our pets and creatures from dying after Abandon fortress, is there? (Perhaps changing the ownership or friendship before Abandon?) Or maybe a way to prevent our dwarves from leaving the site area after Abandon? (Maybe by changing the parent civilization or something beforehand?)
I'm looking forward to the day when we can "Retire" a Fortress without actually Abandoning the site. And I'm not the only one:'Retiring' forts is a crazy popular suggestion. Just below gunpowder and steampunk in it's perennial nature.
Oh I should try that so you found out how to get Merchants or migrants with 'withering' if you Move into a mountain home as a adventurer and swap over to fort mode?
yeah withering what shows up on the header when it happens. from what I found if your on the embark site and swap over to fort mode then save you will be able to play it out but from my test of moving entire group of settlers over to a embark site 2 tiles away that the game after I think 2 weeks causes a force abandon. though I haven't tested the possibility of moving them back to the previous site to see if it still Force abandon or not. what I do know is you can just swap over to adventure mode and sleep past the day it strikes making the fort playable again.(The problem with this solution is that I think I'm missing out on either getting merchants, sieges, and more Dwarves.)Oh I should try that so you found out how to get Merchants or migrants with 'withering' if you Move into a mountain home as a adventurer and swap over to fort mode?
I've only really tried fortress->adventure yet, in truth I'm just looking for a way to gracefully "retire" a fort so I can go on to build a new one.
I'll try adventure->fortress tomorrow (I don't have a working version of Tweak, though, so I don't know how to go about building stuff if fortress mode doesn't work properly).
I believe you mentioned something about automatic abandon after some time when you build an adventurer fort? Is that what you meant by "withering"?
yeah withering what shows up on the header when it happens. from what I found if your on the embark site and swap over to fort mode then save you will be able to play it out but from my test of moving entire group of settlers over to a embark site 2 tiles away that the game after I think 2 weeks causes a force abandon. though I haven't tested the possibility of moving them back to the previous site to see if it still Force abandon or not. what I do know is you can just swap over to adventure mode and sleep past the day it strikes making the fort playable again.(The problem with this solution is that I think I'm missing out on either getting merchants, sieges, and more Dwarves.)
Oh I found out that using the flag changer 51 or if that doesn't work use runesmith and remove the 'is resident tag' make the the nonplayable dwarfs that are on site playable. so that you could get your adventurer to build on the site though slapping on tame(number 26 if using Dfusion flag changer) tag also work too just remember to remove it.yeah withering what shows up on the header when it happens. from what I found if your on the embark site and swap over to fort mode then save you will be able to play it out but from my test of moving entire group of settlers over to a embark site 2 tiles away that the game after I think 2 weeks causes a force abandon. though I haven't tested the possibility of moving them back to the previous site to see if it still Force abandon or not. what I do know is you can just swap over to adventure mode and sleep past the day it strikes making the fort playable again.(The problem with this solution is that I think I'm missing out on either getting merchants, sieges, and more Dwarves.)
It seems that's because there's still a missing flag on units that indicates they are a member of the fortress. No units on map that have the "member of fortress" flag turned on = withering away at the next check.
If you find that flag and switch it on for at least one unit that might prevent the withering. Maybe it's civ membership? Maybe you need to create a civ subgroup that "owns" that fortress, and move over civ membership to that group?
or maybe just hijack an existing civ subgroup (perhaps from a previous player fortress).
As to getting merchants/migrants, there's something in the fort data that isn't initialized properly (again maybe parent civ/civ subgroup relations?).
For now I just plan to schlep adventurers to a site then embark/reclaim there if I want to put my adventurers in a fort. I'm going to think of it as needing to hire a dwarven construction crew if I want to build something.
Any way to get DFusion updated to the new releases? I'm missing my good features! :'(-f in the CMD command.
The -f compiles the new offsets, but none of them match for the 31.24 Phoebus. >:( Gah! I want more embarkment dwarves.dang it .25 just came out. I think Darius is in hiding until the update wave calms down sorry best think now is to either help find the offsets or settle down with the reasonable Dfusion version and wait out the update storm. I'd stop at 21 or 19 at best.
Hehe i almost came out when 24 was out :DThe -f compiles the new offsets, but none of them match for the 31.24 Phoebus. >:( Gah! I want more embarkment dwarves.dang it .25 just came out. I think Darius is in hiding until the update wave calms down sorry best think now is to either help find the offsets or settle down with the reasonable Dfusion version and wait out the update storm. I'd stop at 21 or 19 at best.
oh yeah I found out that teleport waste can be clean up by removing the creature tag on the tile the creature was on before teleporting. so coding a previous tile flag removal might free up space.Hehe i almost came out when 24 was out :DThe -f compiles the new offsets, but none of them match for the 31.24 Phoebus. >:( Gah! I want more embarkment dwarves.dang it .25 just came out. I think Darius is in hiding until the update wave calms down sorry best think now is to either help find the offsets or settle down with the reasonable Dfusion version and wait out the update storm. I'd stop at 21 or 19 at best.
Now i'll wait for a day or something (new version will be out on weekend for sure maybe earlier)
Fort got killed by goblins. Later my adventurers killed two forgotten beasts (they were walled off in fort) but got killed by a goblin spearman. Now i'm too lazy to level up an adventurer to make it to that epic fort (although now it has a lot of epic stuff). Newest idea is to make a fort to make adamantine items+ some steel weapons, maybe adamantine clothes :D and then travel to my fort :)oh yeah I found out that teleport waste can be clean up by removing the creature tag on the tile the creature was on before teleporting. so coding a previous tile flag removal might free up space.Hehe i almost came out when 24 was out :DThe -f compiles the new offsets, but none of them match for the 31.24 Phoebus. >:( Gah! I want more embarkment dwarves.dang it .25 just came out. I think Darius is in hiding until the update wave calms down sorry best think now is to either help find the offsets or settle down with the reasonable Dfusion version and wait out the update storm. I'd stop at 21 or 19 at best.
Now i'll wait for a day or something (new version will be out on weekend for sure maybe earlier)
Darius how's your Adventure forts? because I learn that recent embark forts are safer than old embarks which I should have figured that when you tested out the double fort thing.
oh from what I know you could go straight from Adventure mode to the fort and not have to deal with the weak abandoning issue if you do the retire thing. I could be wrong and it simpler than that.Fort got killed by goblins. Later my adventurers killed two forgotten beasts (they were walled off in fort) but got killed by a goblin spearman. Now i'm too lazy to level up an adventurer to make it to that epic fort (although now it has a lot of epic stuff). Newest idea is to make a fort to make adamantine items+ some steel weapons, maybe adamantine clothes :D and then travel to my fort :)oh yeah I found out that teleport waste can be clean up by removing the creature tag on the tile the creature was on before teleporting. so coding a previous tile flag removal might free up space.Hehe i almost came out when 24 was out :DThe -f compiles the new offsets, but none of them match for the 31.24 Phoebus. >:( Gah! I want more embarkment dwarves.dang it .25 just came out. I think Darius is in hiding until the update wave calms down sorry best think now is to either help find the offsets or settle down with the reasonable Dfusion version and wait out the update storm. I'd stop at 21 or 19 at best.
Now i'll wait for a day or something (new version will be out on weekend for sure maybe earlier)
Darius how's your Adventure forts? because I learn that recent embark forts are safer than old embarks which I should have figured that when you tested out the double fort thing.
which version of dwarf fortress is dfusion compatible for right now? cause i cannot get the resurrect option to work at all in the newest dwarf fort version, and previous ones either.I stop at .21 since after that was just bug fixes.
Is it possible to use this with .25?
Hehe i almost came out when 24 was out :D
Now i'll wait for a day or something (new version will be out on weekend for sure maybe earlier)
well kinda found out that the site changer still bonked. so no ability to turn a players fort into a hamlet.Is it possible to use this with .25?
I tried it, couldn't find the correct offsets.Hehe i almost came out when 24 was out :D
Now i'll wait for a day or something (new version will be out on weekend for sure maybe earlier)
Darius says this weekend, so I'm going to wait till Monday. Otherwise the last working version seems to be for .21.
well kinda found out that the site changer still bonked. so no ability to turn a players fort into a hamlet.Is it possible to use this with .25?
I tried it, couldn't find the correct offsets.Hehe i almost came out when 24 was out :D
Now i'll wait for a day or something (new version will be out on weekend for sure maybe earlier)
Darius says this weekend, so I'm going to wait till Monday. Otherwise the last working version seems to be for .21.
Is it possible to use this with .25?
I tried it, couldn't find the correct offsets.Hehe i almost came out when 24 was out :D
Now i'll wait for a day or something (new version will be out on weekend for sure maybe earlier)
Darius says this weekend, so I'm going to wait till Monday. Otherwise the last working version seems to be for .21.
Is it possible to use this with .25?
I tried it, couldn't find the correct offsets.Hehe i almost came out when 24 was out :D
Now i'll wait for a day or something (new version will be out on weekend for sure maybe earlier)
Darius says this weekend, so I'm going to wait till Monday. Otherwise the last working version seems to be for .21.
Let him come out when he feels comfortable. :D
Having trouble with world offset (this one is used to get tile data).
That really helped.Having trouble with world offset (this one is used to get tile data).
Tile data offsets (http://df.magmawiki.com/index.php/DF2010:Memory_hacking#Tile_data_offsets) changed between 0.31.21 and .22; could that be causing issues?
I feel like I am missing some obvious step. How exactly do you run DFusion?do you have a xp x64? because that the same issue I have on my "new" PC.
I have a fresh un-modded 31.25 version of DF
I click DfFusion and a box pops up
DfFusion.exe - Application Error
The application failed to initialize properly (0x0150002), Click on OK to terminate the application.
I feel like I am missing some obvious step. How exactly do you run DFusion?do you have a xp x64? because that the same issue I have on my "new" PC.
I have a fresh un-modded 31.25 version of DF
I click DfFusion and a box pops up
DfFusion.exe - Application Error
The application failed to initialize properly (0x0150002), Click on OK to terminate the application.
function selectcomp()
local retvec={} --return vector (or a list)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector) --standart start
for i=0,vector:size()-1 do --check all creatures
local off
off=vector:getval(i)
lfollow=engine.peek(off,ptr_Creature.followID) -- get target creatures "now following ID"
if lfollow ~=0xFFFFFFFF then --if its set
table.insert(retvec,off)--... add it to return vector
end
end
return retvec --return the "return vector" :)
end
function rum_tools.fortcomps()
local trgs=selectcomp()
for k,v in pairs(trgs) do
--indx=GetCreatureAtPos(v)
--indx=engine.peek(v,ptr_creature.ID)
print("Companion:"..k)
local flags=engine.peek(v,ptr_Creature.flags)
flags:set(1,false) -- alive!
flags:set(51,false) -- remove the is resident flag on companions
flags:set(47,false) -- something todo with wounds- lets you walk again.
engine.poke(v,ptr_Creature.flags,flags)
end
end
function rum_tools.fortdy()
--first three lines same as before (because we will need an offset of creature at location x,y,z)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
indx=GetCreatureAtPos(getxyz())
--indx=0
--print(string.format("%x",vector:getval(indx)))
flg=engine.peek(vector:getval(indx),ptr_Creature.flags) --get flags
flg:set(51,false) -- 76 is ghostliness flag.
--flg:set(1,0) -- alive
--flg:set(13,1) -- skeleton
engine.poke(vector:getval(indx),ptr_Creature.flags,flg) --save flags
end
function rum_tools.Fortilate()
vector=engine.peek(offsets.getEx("CreatureVec"),ptr_vector)
id=engine.peekd(offsets.getEx("CreaturePtr"))
print(string.format("Vec:%d cr:%d",vector:size(),id))
off=vector:getval(id)
crciv=engine.peek(off,ptr_Creature.civ)
curciv=engine.peekd(offsets.getEx("CurrentRace")-12)
if curciv==crciv then
print("Friendly")
--engine.poke(off,ptr_Creature.civ,curciv)
flg=engine.peek(off,ptr_Creature.flags)
flg:set(17,false)
engine.poke(off,ptr_Creature.flags,flg)
else
print("Enemy or Adventurer- making friendly")
engine.poke(off,ptr_Creature.civ,curciv)
flg=engine.peek(off,ptr_Creature.flags)
flg:set(17,false)
flg:set(19,false)
engine.poke(off,ptr_Creature.flags,flg)
end
end.
Ok probably it's MSVCR80.DLL that is neede by lua.dll (i hate this windows dependancy mess) i might try recompiling lua.dll or just integrating it. Till then either install microsoft visual c redistribute (not sure witch version) or just google for this file.
function selectciv()
local retvec={} --return vector (or a list)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector) --standart start
for i=0,vector:size()-1 do --check all creatures
local off
off=vector:getval(i)
local crciv=engine.peek(off,ptr_Creature.civ)
local curciv=engine.peek(vector:getval(0),ptr_Creature.civ)
if curciv==crciv then
--[[local flags=engine.peek(off,ptr_Creature.flags)
if flags:get(1)==false then]]-- --if dead ...
table.insert(retvec,off)--... add it to return vector
end
end
return retvec --return the "return vector" :)
end
function rum_tools.returnfort()
--this should select and remove is resident from fort
myoff=offsets.getEx("AdvCreatureVec")
local trgs=selectciv()
for k,v in pairs(trgs) do
--vector=engine.peek(myoff,ptr_vector)
--indx=GetCreatureAtPos(getxyz())
--indx=0
--print(string.format("%x",vector:getval(indx)))
flg=engine.peek(v,ptr_Creature.flags) --get flags
flg:set(51,false) -- 76 is ghostliness flag.
--flg:set(1,0) -- alive
--flg:set(13,1) -- skeleton
engine.poke(v,ptr_Creature.flags,flg) --save flags
end
function rum_tools.civFollow()
--first three lines same as before (because we will need an offset of creature at location x,y,z)
myoff=offsets.getEx("AdvCreatureVec")
local trgs=selectciv()
for k,v in pairs(trgs) do
print(string.format("current creature:%x",k))
trgid=engine.peek(vector:getval(0),ptr_Creature.ID)
engine.peek(v,ptr_Creature.followID) --get players ID
--[[lfollow=engine.peek(v,ptr_Creature.followID) -- get target creatures "now following ID"
if lfollow ~=0xFFFFFFFF then --if its set]]--
engine.poke(v,ptr_Creature.followID,trgid) -- if not just write the players ID.
end
end
Tried to use this to change a site type but no matter what I type into the search parameter, I never get a site to change. Am I supposed to do this while in Dwarf Mode, Adventure Mode, Embark?? I just want to make a player-controlled mountain hall into a not-player controlled (abandoned, though, I'm not trying to retire a fort, yet). Can somebody walk me through this? A very slow, very detailed, suitable for children kind of walkthrough would be the best kind.one we need to know your pc specs and which DF version you have this could be a case of outdated site offset(oh and you can use Site changer in any mode even legends). I'm really confused in your suggestion as langdon retiring turns a players fort(what it's called in Site changer) into non playable Mountain halls. though I guess your in a fort now and want another player site converted. well I'll tell you this doing so will wipe all work on the fort and leave nothing but a empty flat plane.
I'm using DF .25 on Win7 with the latest DFusion. I didn't realize changing the site type would wipe out the fortress. I thought it would just change the way it was treated when you were looking at it from the map (that it couldn't be reclaimed). I wanted to change a player fort into a mountain halls (so it couldn't be reclaimed) but I didn't want to wipe out the fort.simple you have to retire an adventurer/fort pull up a dummy one walk over to the site switch to fort mode then murder the adventurer using a utility then switch back into adventure mode. then end the game. you will then have to just remember not to REclaim the site next time but will be known as a mountain home.
If there's another way to set up an abandoned player fort so that it is no longer available to be reclaimed, I'd be happy to do it that way.
simple you have to retire an adventurer/fort pull up a dummy one walk over to the site switch to fort mode then murder the adventurer using a utility then switch back into adventure mode. then end the game. you will then have to just remember not to REclaim the site next time but will be known as a mountain home.
I appreciate all the effort you guys have put into this, but some decent tutorials would help immensely on using DFusion.
-- import debug -- not sure if needed
print(debug.traceback())
programmer's tool it is. I made just about 30 different commands and functions for this thing from temp controlling zombies, companions, to making a makeshift grab command for dragging companions, friendlies, enemies across areas that they can't path through. I have to say thanks Darius for getting me into Df hacking.QuoteI appreciate all the effort you guys have put into this, but some decent tutorials would help immensely on using DFusion.
Hehe... this was originally intended as a programmers tool to make something more user-friendly later. This however never moved on to the user-friendliness. I guess a gui would help a lot?..
Rumrusher: your signature link is broken.
Also what helps debuggin:Code: [Select]-- import debug -- not sure if needed
print(debug.traceback())
this shows a stack trace (in theory... would be more useful if called on error...)
programmer's tool it is. I made just about 30 different commands and functions for this thing from temp controlling zombies, companions, to making a makeshift grab command for dragging companions, friendlies, enemies across areas that they can't path through. I have to say thanks Darius for getting me into Df hacking.
I think Darius explain this when he added it but the first can be done any where it that you need the non plural word of the name like flowersgates has to be typed out as "FLOWER" "GATE"programmer's tool it is. I made just about 30 different commands and functions for this thing from temp controlling zombies, companions, to making a makeshift grab command for dragging companions, friendlies, enemies across areas that they can't path through. I have to say thanks Darius for getting me into Df hacking.
And it looks like a great tool! Alright, let's start simply:
1. Where should I be in the game when I open up DFusion and select option 7 (tools), sub-option 6 (site type). Should I be in adventure mode? Fortress mode? Should I be in adventure mode at the site in question? Assume I have just abandoned my fortress and I'd like to change its site type (or fix items or whatever else is available in option 7).
2. When the tool prompts me with "Type words that are in the site name, FULLCAPS..." should I be typing in the a substring of the site name, the full name, its translated name or what?
I know if may seem tedious to explain this to a schlomo, but I promise I'll use it for good.
function err(msg) --function that intercepts error
print (msg) --print old message
print (debug.traceback()) -- print stack (the function call list)
end
function dofile(filename)
return xpcall(loadfile(filename),err)
end
This is compatable with the latest version of DF, right?
How do I use this to swap to an adventurer while playing fort?Adv_tools
Hmm, just tried this for the first time, on an unmodded 31.25, with the stock scripts. Apologies if this has been asked before, I paged through about ten pages of the thread, with no mention of it yet. Woop.If you use friendship too late (when the map already is started) you can't appoint THOSE creatures to nobles/military but new waves (and children who grow up) will be allowed to be nobles and/or military. This is due to how DF makes lists and does not update them until it needs to. I forget but maybe even old creatures are added to those list later...
Used embark with the defaults, and correctly got a kobold, gremlin and elf as part of the initial seven.
Used friendship and they started doing their jobs.
However, I still can't appoint them as nobles. Is there anything else I have to do to make this work or is it not possible? Chief medical gremlin wants his work.
Ah, awesome, thank you. I somehow got the impression you had to use friendship after the map was loaded. Woops.Unfortunately not yet. You need to run both friendship and embark setting when in map selecting where to embark for best effect.
Is there any way to select caste, rather than just race, during embark? :o
Heheh, thank you for the quick responses.MUAHJAHAHA
Alas, yeah, I just remembered I already asked about the caste thing back on page 3. Woopsie. Still probably my most wanted feature.
so does this mean I can swap around castes with the race changer oh and is Site changer fixed?
oh and due to issues I can't get a hex memory editor due to some of my games are crazy over those programs.
darn I wonder if the utility could search for an custom attack and give it dragon fire or webber or a material breath attack?so does this mean I can swap around castes with the race changer oh and is Site changer fixed?
oh and due to issues I can't get a hex memory editor due to some of my games are crazy over those programs.
Hehe nope (not very hard but will probably crash DF just like race changing) and nope but will look into site changer. And yeah some games dont like these programs although MHS has some anti-detection built in.
You mean on attack do something. I plan to add some functionality for detecting if some function is called and then calling other functions. Last try failed because same approach as Spellcraft did not work (and it's not the best way).darn I wonder if the utility could search for an custom attack and give it dragon fire or webber or a material breath attack?so does this mean I can swap around castes with the race changer oh and is Site changer fixed?
oh and due to issues I can't get a hex memory editor due to some of my games are crazy over those programs.
Hehe nope (not very hard but will probably crash DF just like race changing) and nope but will look into site changer. And yeah some games dont like these programs although MHS has some anti-detection built in.
darn well at-least we got telepathy and site clean up from telepathy down pack. I might pick up 3.0 once Site changer fixed and go on testing if one could convert a small lair or castle into a playable fortress in fort mode.You mean on attack do something. I plan to add some functionality for detecting if some function is called and then calling other functions. Last try failed because same approach as Spellcraft did not work (and it's not the best way).darn I wonder if the utility could search for an custom attack and give it dragon fire or webber or a material breath attack?so does this mean I can swap around castes with the race changer oh and is Site changer fixed?
oh and due to issues I can't get a hex memory editor due to some of my games are crazy over those programs.
Hehe nope (not very hard but will probably crash DF just like race changing) and nope but will look into site changer. And yeah some games dont like these programs although MHS has some anti-detection built in.
how do i revert the changes i made with this? ???Ehehe... Which changes? If friendship/embark/immigrant hacks saving exiting and reloading should revert everything as for others it would be more... difficult (some impossible)
things like change race(tools) which strangely after changing race destroys my fort.how do i revert the changes i made with this? ???Ehehe... Which changes? If friendship/embark/immigrant hacks saving exiting and reloading should revert everything as for others it would be more... difficult (some impossible)
what operating system are you using
ok what about your dwarf fortress version (full vesion as in 31.25 not just 31) and what is the exact procedure you took to run it (from the point after downloading to running itwhat operating system are you using
oh, yes. sorry. Windows xp professional 64x
i dont know how to help but one thing that you forgot to mention did you extract ALL of the folders contents and not just the exe
function rum_tools.zombiearmy()
local trgs=selectwoundead()
for k,v in pairs(trgs) do
--indx=GetCreatureAtPos(v)
--indx=engine.peek(v,ptr_creature.ID)
print("Zombie:"..k)
v2=engine.peek(v,ptr_Creature.hurt1)
for i=0,v2:size()-1 do
v2:setval(i,0)
end
v2=engine.peek(v,ptr_Creature.hurt2)
v2.type=DWORD
for i=0,v2:size()-1 do
v2:setval(i,0)
end
--engine.poke(creatureptr,ptr_Creature.legends,-1)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff+16,ptr_vector)
local trgs=selectall()
for k,v in pairs(trgs) do
trgid=engine.peek(vector:getval(0),ptr_Creature.ID) --get players ID
engine.peek(v,ptr_Creature.followID) -- get target creatures "now following ID"
engine.poke(v,ptr_Creature.followID,trgid) -- if not just write the players ID.
end
engine.poke(v,ptr_Creature.bloodlvl,60000) --give blood
engine.poke(v,ptr_Creature.bleedlvl,0) --stop some bleeding...
local flags=engine.peek(v,ptr_Creature.flags)
flags:set(1,false) -- alive!
flags:set(12,true) --zombie
engine.poke(v,ptr_Creature.flags,flags)
local flags=engine.peek(vector:getval(0),ptr_Creature.flags)
flags:set(1,false) -- alive!
flags:set(12,false) --zombie
engine.poke(vector:getval(0),ptr_Creature.flags,flags)
end
end
function selectwoundead()
local retvec={} --return vector (or a list)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector) --standart start
for i=0,vector:size()-1 do --check all creatures
local off
off=vector:getval(i)
local v2=engine.peek(off,ptr_Creature.hurt1)
if v2:getval(12)>=1 then
table.insert(retvec,off)--... add it to return vector
end
local flags=engine.peek(off,ptr_Creature.flags)
if flags:get(1)==true then --if dead ...
table.insert(retvec,off)--... add it to return vector
end
end
return retvec --return the "return vector" :)
end
rum_tools.menu:add("zomarmy",rum_tools.zombiearmy)
...wait never mind these are nested eggs not spawn in mid air ones shoot. If only there was a way to take adventure reaction eggs and hatch them instantly. oh well we are SOooo close to summons it's crazy,It's only a matter of time before enough new features are added to DF to allow a creative modder to figure out how to do summons.
hey daruis I just found a weird recreatable situration when you use this
<...>
edit: looks like the eggs has to be lay in the building and not just in the nest boxthat and item destroying seems to not work well.
function items.test3()
myoff=offsets.getEx("Items") -- first find out where "item vector" is
vector=engine.peek(myoff,ptr_vector) -- get list of items
for i=0,vector:size()-1 do --look at each item
flg=engine.peek(vector:getval(i),ptr_item.flags)
entry=io.stdin:read() -- 17 poofs items, 19 forbids and 14 removes item ties to the fort and can add if you have set on false.
print("Was:"..tostring(flg:get(entry)))
flg:flip(entry)
print("Now:"..tostring(flg:get(entry)))
engine.poke(vector:getval(i),ptr_item.flags,flg)
end
endhey daruis I just found a weird recreatable situration when you use this
<...>
edit: looks like the eggs has to be lay in the building and not just in the nest boxthat and item destroying seems to not work well.
What do you mean weird?
Also do you mean you could place eggs in any building (e.g. workshop?) and it would work?!
0x00000001 - on ground -0
0x00000002 - tasked -1
0x00000004 - ? -2
0x00000008 - in inventory/container -3
0x00000010 - lost (artifact) -4
0x00000020 - part of building -5
0x00000040 - ? -6
0x00000080 - ? -7
0x00000100 - rotten -8
0x00000200 - ? -9
0x00000400 - ? -10
0x00000800 - ? -11
0x00001000 - ? (previously flagged artifacts) -12
0x00002000 - ? -13
0x00004000 - imported/foreign (in parentheses) -14
0x00008000 - ? (previously marked trade goods) -15
0x00010000 - owned by dwarf -16
0x00020000 - poof -17
0x00040000 - ? -18
0x00080000 - forbidden -19
0x00100000 - ? -20
0x00200000 - dump -21
0x00400000 - on fire -22
0x00800000 - melt -23
0x01000000 - hidden -24
0x02000000 - ? -25
0x04000000 - ? -26
0x08000000 - ? -27
0x10000000 - ? -28
0x20000000 - ? -29
0x40000000 - ? -30
0x80000000 - ? -31
Not sure about stacks (although in DFhack thread i think i read that 16x16 map has it's own item list) but I updated DFusion with simple item editor. Lets you change material, flags (not very confortable) and if its covered in something it lets you change that (e.g. water into venom ;) ).hmm between this and giving weapons names is what people on the Adventure forum been asking.
Fun fact DF supports named creature items (like Urist mcMiner bone dagger) but reactions don't make them for some reason. If you mess with materials enough you can change that and have named dragon pike (like i do now :P)
function selectitem()
local retvec={} --return vector (or a list)
myoff=offsets.getEx("Items")
vector=engine.peek(myoff,ptr_vector)
for i=0,vector:size()-1 do --check all creatures
local off
off=vector:getval(i)
--local RTI=engine.peek(off,ptr_item.RTI)
--local itmser=ptr_item.getname(nil,RTI)
local flags=engine.peek(off,ptr_item.flags)
if flags:get(3)==true then --if a weapon in anyway...
table.insert(retvec,off)--... add it to return vector
end
end
return retvec --return the "return vector" :)
end
function selectitem2()
local retvec={} --return vector (or a list)
myoff=offsets.getEx("Items")
vector=engine.peek(myoff,ptr_vector)
for i=0,vector:size()-1 do --check all creatures
off=vector:getval(i)
RTI=engine.peek(off,ptr_item.RTI)
itmser=ptr_item.getname(nil,RTI)
--local flags=engine.peek(off,ptr_item.flags)
if itmser=="item_weaponst" then --if a weapon in anyway...
table.insert(retvec,off)--... add it to return vector
end
end
return retvec --return the "return vector" :)
end
function items.wepbrn()
local trgs=selectitem2()
for _,v in pairs(trgs) do
flg=engine.peek(v,ptr_item.flags)
flg:set(22,1)
engine.poke(v,ptr_item.flags,flg)
end
end
function items.disarm()
local trgs=selectitem2()
for _,v in pairs(trgs) do
flg=engine.peek(v,ptr_item.flags)
flg:set(0,1)
engine.poke(v,ptr_item.flags,flg)
end
end
patterns2.lua seems to be missing from the zip at dffd making all the cool stuff unworkable. dang.sorry about that, ill fix it with next ver.
Working on an old 40d fort. Is there a version of DFusion that will work with 40d?
darius I'm kinda stuck on few things,
first is getting an egg to be placed in a nest. so adventure made eggs can be hatched
second is to have a control over a creature possession of items.
so far the edit item only effect drop items.
third is with adventure decoration how would one get Dfusion to check if an item has a "raise dead" rune or a "sentry" rune?
Hey there
whenever I try to run this in wine, a command prompt opens and then promptly closes. DFWorld Tinker works fine in Wine even DF is running outside, so I know that's not it. I don't suppose anyone could tell me what needs to be done to get it working?
plugins/itempatterns.lua:lua79: '=' expected near '+'
plugins/itempatterns.lua:14: attempt to index global 'ptt_dfflag' (a nil value)
stack traceback:
init.lua:6: in function <init.lua:4>
plugins/itempatterns.lua:14: in main chunk
[C]: in function 'xpcall'
init.lua:11: in function 'dofile'
plugins/common.lua:408: in main chunk
[C]: in function 'xpcall'
init.lua:11: in function 'dofile'
init.lua:19: in main chuckall the commands don't work.
Sweet looks like I could get into a jump start on giving companions armor.
or work on a pack mule command.
Though I guess I need to have it select the creature with the special back pack and then store the item in said back pack.
wait this giving me an errorCode: [Select]plugins/itempatterns.lua:lua79: '=' expected near '+'all the commands don't work.
plugins/itempatterns.lua:14: attempt to index global 'ptt_dfflag' (a nil value)
stack traceback:
init.lua:6: in function <init.lua:4>
plugins/itempatterns.lua:14: in main chunk
[C]: in function 'xpcall'
init.lua:11: in function 'dofile'
plugins/common.lua:408: in main chunk
[C]: in function 'xpcall'
init.lua:11: in function 'dofile'
init.lua:19: in main chuck
function items.trade_adv() --only allows access to edit companions items no trading.
vec=engine.peek(offsets.getEx("CreatureVec"),ptr_vector)
local trgs=selectcomp()
for k,v in pairs(trgs) do
items.edit(items.select_creature(v))
end
end
function selectcomp()
local retvec={} --return vector (or a list)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector) --standart start
for i=0,vector:size()-1 do --check all creatures
local off
off=vector:getval(i)
lfollow=engine.peek(off,ptr_Creature.followID) -- get target creatures "now following ID"
if lfollow ~=0xFFFFFFFF then --if its set
table.insert(retvec,off)--... add it to return vector
end
end
return retvec --return the "return vector" :)
end
function items.wepbrn2(offset)
flg=engine.peek(offset,ptr_item.flags)
flg:set(22,1)
engine.poke(offset,ptr_item.flags,flg)
end
function items.point_adv()
vec=engine.peek(offsets.getEx("CreatureVec"),ptr_vector)
indx=GetCreatureAtPos(getxyz())
items.wepbrn2(items.select_creature(vec:getval(indx)))
endfunction items.cross(offset)
Advitem=engine.peek(vec:getval(0),ptr_Creature.itemlist1)
Advitem2=engine.peek(vec:getval(0),ptr_Creature.itemlist2)
compitem=engine.peek(offset,ptr_Creature.itemlist2)
compitem2=engine.peek(offset,ptr_Creature.itemlist1)
engine.poke(vec:getval(0),ptr_Creature.itemlist2,compitem)
engine.poke(vec:getval(0),ptr_Creature.itemlist1,compitem2)
end
Actually i have no idea how itemlist1 is used :/ so try without it and also if you are doing anything with pointers (in this case you are :) ) crash sometimes could be avoided by adding:
okay this command doesn't work and will just crash the game.Code: [Select]function items.cross(offset)
Advitem=engine.peek(vec:getval(0),ptr_Creature.itemlist1)
Advitem2=engine.peek(vec:getval(0),ptr_Creature.itemlist2)
compitem=engine.peek(offset,ptr_Creature.itemlist2)
compitem2=engine.peek(offset,ptr_Creature.itemlist1)
engine.poke(vec:getval(0),ptr_Creature.itemlist2,compitem)
engine.poke(vec:getval(0),ptr_Creature.itemlist1,compitem2)
end
debuger.suspend()
<... your code >
debuger.resume()
Debuger lib (in dfusion) is undocumented and mostly crashes DF but this should be relatively safe.
using it causes all items your holding to disappear then the game crash. Having the command flip where tries to take the item from the creature does nothing.Actually i have no idea how itemlist1 is used :/ so try without it and also if you are doing anything with pointers (in this case you are :) ) crash sometimes could be avoided by adding:
okay this command doesn't work and will just crash the game.Code: [Select]function items.cross(offset)
Advitem=engine.peek(vec:getval(0),ptr_Creature.itemlist1)
Advitem2=engine.peek(vec:getval(0),ptr_Creature.itemlist2)
compitem=engine.peek(offset,ptr_Creature.itemlist2)
compitem2=engine.peek(offset,ptr_Creature.itemlist1)
engine.poke(vec:getval(0),ptr_Creature.itemlist2,compitem)
engine.poke(vec:getval(0),ptr_Creature.itemlist1,compitem2)
endCode: [Select]debuger.suspend()Debuger lib (in dfusion) is undocumented and mostly crashes DF but this should be relatively safe.
<... your code >
debuger.resume()
Advitem=engine.peek(vec:getval(0),ptr_Creature.itemlist2)
it=engine.peekd(Advitem:getval(0)) -- first item
compitem=engine.peek(offset,ptr_Creature.itemlist2)
it2=engine.peekd(compitem:getval(0))
engine.poked(compitem:getval(0),it)
engine.poked(Advitem:getval(0),it2)
if engine.getmod("triggers_main") then
loadTriggers()
FILE="A" --work around for now... will split functions and its menu later
dofile("plugins/triggers/functions.lua") -- this is where the magic lies
func.PrintMessage("Oh such a nice wheather here.",6,1) -- last two are color and intensity
FILE=nil
else
print("Error: triggers plugin must be installed to run this!")
end
You know... with the current direction of DFHack, we could totally join forces and proceed towards world domination :)Does this mean all my work which goes into a plugin.lua for DFusion will be now stuck into a plugin of Dfusion which is a plugin for DFhack?
I'm putting stuff into the DF binary through a shim library between DF and SDL. Works like a charm. Your LUA stuff could live inside DFHack as a plugin, possibly removing a lot of code and becoming cross-platform at the same time. It would be awesome.
function func.PrintMessage1_()
print("Type a message:")
msg="Rise from your grave, you save my daughter!"
func.PrintMessage(msg,2,1)
end
function func.PrintMessage2_()
print("Type a message:")
msg="Stand there!"
func.PrintMessage(msg,2,1)
end
function func.PrintMessage3_()
print("Type a message:")
msg="Channeling souls here!"
func.PrintMessage(msg,5,1)
end
to place these into the Trigger folder
and to use them in a normal Rum_mod function or any really
just stick this
func.PrintMessage3_(msg)
in either the beginning or end of the command.
though due to the fact adventure mode won't announce if you have the pointer out but will be shown in the announcements. happy flavor adding
You know... with the current direction of DFHack, we could totally join forces and proceed towards world domination :)
I'm putting stuff into the DF binary through a shim library between DF and SDL. Works like a charm. Your LUA stuff could live inside DFHack as a plugin, possibly removing a lot of code and becoming cross-platform at the same time. It would be awesome.
which version of Dwarf fortress and Dfusion are your currently using?
the new ones should just send an error and not crash.
AAAHHH WHAT THE HELL IS WITH THIS THING I RAN EMBARK BY ACCIDENT THEN SIMPLE EMBARK AND NOW DF WON"T GO INTO DWARF FORTRESS MODE HOW DO I FIX THIS????uhh have you try to reset DF?
function adv_tools.ressurect()
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
indx=GetCreatureAtPos(getxyz())
if indx<0 then indx=0 end
--print(string.format("%x",vector:getval(indx)))
v2=engine.peek(vector:getval(indx),ptr_Creature.hurt1)
for i=0,v2:size()-1 do
v2:setval(i,0)
end
v2=engine.peek(vector:getval(indx),ptr_Creature.hurt2)
v2.type=DWORD
for i=0,v2:size()-1 do
v2:setval(i,0)
end
engine.poke(vector:getval(indx),ptr_Creature.bloodlvl,60000) --give blood
engine.poke(vector:getval(indx),ptr_Creature.bleedlvl,0) --stop some bleeding...
local flg=engine.peek(vector:getval(indx),ptr_Creature.flags)
flg:set(1,0) --ALIVE
flg:set(39,0) -- leave body yet again
flg:set(37,0) -- something todo with wounds- lets you walk again.
engine.poke(vector:getval(indx),ptr_Creature.flags,flg)
endfunction ptt_dfflag.get(self,num) -- get one bit in flags
local of=math.floor (num/8);
if bit.band(self[of],bit.lshift(1,num%8))~=0 then
return true
else
return false
end
endthe fix here would be to go through adventure tools and rewrite all the 0 and 1 to true and false.function adv_tools.ressurect()
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
indx=GetCreatureAtPos(getxyz())
if indx<0 then indx=0 end
--print(string.format("%x",vector:getval(indx)))
v2=engine.peek(vector:getval(indx),ptr_Creature.hurt1)
for i=0,v2:size()-1 do
v2:setval(i,0)
end
v2=engine.peek(vector:getval(indx),ptr_Creature.hurt2)
v2.type=DWORD
for i=0,v2:size()-1 do
v2:setval(i,0)
end
engine.poke(vector:getval(indx),ptr_Creature.bloodlvl,60000) --give blood
engine.poke(vector:getval(indx),ptr_Creature.bleedlvl,0) --stop some bleeding...
local flg=engine.peek(vector:getval(indx),ptr_Creature.flags)
flg:set(1,false) --ALIVE
flg:set(39,false) -- leave body yet again
flg:set(37,false) -- something todo with wounds- lets you walk again.
engine.poke(vector:getval(indx),ptr_Creature.flags,flg)
end
function adv_tools.wagonmode() --by rumrusher
--first three lines same as before (because we will need an offset of creature at location x,y,z)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
indx=GetCreatureAtPos(getxyz())
--indx=0
--print(string.format("%x",vector:getval(indx)))
flg=engine.peek(vector:getval(indx),ptr_Creature.flags) --get flags
flg:set(1,false)
flg:set(74,false)
engine.poke(vector:getval(indx),ptr_Creature.flags,flg)
print("To stay normal press y, else hit Enter turn Wagon mode on.")
r=io.stdin:read() -- repeat for it too work... also creature will be dead.
if r== "y" then
flg=engine.peek(vector:getval(indx),ptr_Creature.flags)
flg:set(1,false)
engine.poke(vector:getval(indx),ptr_Creature.flags,flg)
else
flg=engine.peek(vector:getval(indx),ptr_Creature.flags)
flg:set(1,false)
flg:flip(74)
engine.poke(vector:getval(indx),ptr_Creature.flags,flg)
end
end
function selectall()
local retvec={} --return vector (or a list)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector) --standart start
for i=0,vector:size()-1 do --check all creatures
local off
off=vector:getval(i)
local flags=engine.peek(off,ptr_Creature.flags)
if flags:get(1)==true then --if dead ...
table.insert(retvec,off)--... add it to return vector
end
end
return retvec --return the "return vector" :)
end
function adv_tools.hostilate()
vector=engine.peek(offsets.getEx("AdvCreatureVec"),ptr_vector)
id=GetCreatureAtPos(getxyz())
print(string.format("Vec:%d cr:%d",vector:size(),id))
off=vector:getval(id)
crciv=engine.peek(vector:getval(id),ptr_Creature.civ)
curciv=engine.peek(vector:getval(0),ptr_Creature.civ)
if curciv==crciv then
print("Friendly-making enemy")
engine.poke(off,ptr_Creature.civ,-1)
flg=engine.peek(off,ptr_Creature.flags)
flg:set(17,true)
engine.poke(off,ptr_Creature.flags,flg)
else
print("Enemy- making friendly")
engine.poke(off,ptr_Creature.civ,curciv)
flg=engine.peek(off,ptr_Creature.flags)
flg:set(17,false)
flg:set(19,false)
engine.poke(off,ptr_Creature.flags,flg)
end
end
which I did to save time in doing so.
sorry, but what...? I barely understood ANY of that! try to fix your typos.Rum's rough guide to DfusionSpoiler (click to show/hide)
if you can't do anything of these things then type out the first error you see and either Darius or I/me will answer.
if you excuse me I need to rest my wrist for writing up this "'non-developer' guide."
This project is now officially open source (in github)Now THAT is awesome. I'll see what could be done about putting this into the new dfhack as a plugin when I'm done with what I'm working on right now (adding a thread-safe console)
This project is now officially open source (in github)Now THAT is awesome. I'll see what could be done about putting this into the new dfhack as a plugin when I'm done with what I'm working on right now (adding a thread-safe console)
EDIT: hmm... I don't know where I'd start either. This will need some serious research :)
Hmm.. let me explain stuff better. The new dfhack basically lives inside DF. A dfhack plugin can stop DF and take complete control over it. This means full access to everything, as long as you can find it (have the offset) and describe its layout in C++ types (the actual layout of objects can be left to the compiler). All this is done in sync with DF and it's thread-safe, so you can be *SURE* you'll never, ever break things because of some timing problem. You can use malloc/free/new/delete on DF's memory, because it's also your memory.
This new dfhack has a few extra bits:
A (in the near future thread-safe) console you can type in commands exported by the plugins.
It listens for the zoom hotkeys of DF and can invoke commands by name when the player pushes those hotkeys - this is F1-F8 and Shift+F1 - Shift-F8. Commands can be assigned to them using the in-game hotkey menu.
The plugins can have a function that's run after DF completes every game step.
DFusion (or some kind of similar LUA thing) would be a DFHack plugin, exporting various commands, so they can be invoked by the console or from the hotkeys. Some parts of DFusion would need tweaking, some don't really make sense - this needs research. If you're OK with it though :)
:-[yeah that was address a couple of pages ago.
i forgot to fix += somewhere in code before releasing.
Change self.en+=engine.sizeof(self.type) into self.en=self.en+engine.sizeof(self.type) in patterns.lua for now...
Thanks :Dnah this issue was a DFusion one given I had it too and I'm not running on a mac.
It works now, though it can't find the thread. This is likely a problem with WINE and the fact that I'm running DF outside of WINE as opposed to an issue with DFusion.
No, I meant the original issue is solved thanks to the info you provided. DFusion can't find DF now though, and that's probably a problem with wineThanks :Dnah this issue was a DFusion one given I had it too and I'm not running on a mac.
It works now, though it can't find the thread. This is likely a problem with WINE and the fact that I'm running DF outside of WINE as opposed to an issue with DFusion.
...Take the line of code where it say "makes them breathe" and "gives them sight"
paste that in the same spot in the original adv_tool resurrect
for all I did was take the original and added some missing flags due to people tend to suffocate or come out blind when I revive them.
Added....Take the line of code where it say "makes them breathe" and "gives them sight"
paste that in the same spot in the original adv_tool resurrect
for all I did was take the original and added some missing flags due to people tend to suffocate or come out blind when I revive them.
Those sound like very useful additions to the Ressurection plugin. Will they eventually get added to the Resurrection portion of the new DFusion DFHack plugin?
function Adv_tools.Zombieressurect() --fix to zombism
repeat
local trgs=selectall()
for k,v in pairs(trgs) do
--indx=GetCreatureAtPos(v)
--indx=engine.peek(v,ptr_creature.ID)
print("Zombie:"..k)
v2=engine.peek(v,ptr_Creature.hurt1)
for i=0,v2:size()-1 do
v2:setval(i,1)
end
v2=engine.peek(v,ptr_Creature.hurt2)
v2.type=DWORD
for i=0,v2:size()-1 do
v2:setval(i,1)
end
--engine.peek(v,ptr_Creature.civ)
--engine.poke(v,ptr_Creature.civ,-1)
engine.poke(v,ptr_Creature.bloodlvl,60000) --give blood
engine.poke(v,ptr_Creature.bleedlvl,24) --stop some bleeding...
local flags=engine.peek(v,ptr_Creature.flags)
flags:set(1,false) -- alive!
flags:set(12,true) --zombie
flags:set(17,true)
flags:set(19,true)
engine.poke(v,ptr_Creature.flags,flags)
--engine.poke(v,ptr_Creature.legends,-1)
end
until r==7
end
function Adv_tools.carryEX() --have the pointer on the creature you want to hold on to.
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
indx=GetCreatureAtPos(getxyz())
print("grab person how? N S E W")
--repeat
r=io.stdin:read()
if r=="N" then
repeat
flg=engine.peek(vector:getval(0),ptr_Creature.flags)
flg2=engine.peek(vector:getval(indx),ptr_Creature.flags)
enty=engine.peek(vector:getval(0),ptr_Creature.y)+1
entx=engine.peek(vector:getval(0),ptr_Creature.x)
move=engine.peek(vector:getval(0),ptr_Creature.z)
engine.poke(vector:getval(indx),ptr_Creature.z,move)
engine.poke(vector:getval(indx),ptr_Creature.x,entx)
engine.poke(vector:getval(indx),ptr_Creature.y,enty)
until flg:get(15) ==true or flg2:get(1) ==true
elseif r=="S" then
repeat
flg=engine.peek(vector:getval(0),ptr_Creature.flags)
flg2=engine.peek(vector:getval(indx),ptr_Creature.flags)
enty=engine.peek(vector:getval(0),ptr_Creature.y)-1
entx=engine.peek(vector:getval(0),ptr_Creature.x)
move=engine.peek(vector:getval(0),ptr_Creature.z)
engine.poke(vector:getval(indx),ptr_Creature.z,move)
engine.poke(vector:getval(indx),ptr_Creature.x,entx)
engine.poke(vector:getval(indx),ptr_Creature.y,enty)
until flg:get(15) ==true or flg2:get(1) ==true
elseif r=="W" then
repeat
flg=engine.peek(vector:getval(0),ptr_Creature.flags)
flg2=engine.peek(vector:getval(indx),ptr_Creature.flags)
entx=engine.peek(vector:getval(0),ptr_Creature.x)-1
enty=engine.peek(vector:getval(0),ptr_Creature.y)
move=engine.peek(vector:getval(0),ptr_Creature.z)
engine.poke(vector:getval(indx),ptr_Creature.z,move)
engine.poke(vector:getval(indx),ptr_Creature.x,entx)
engine.poke(vector:getval(indx),ptr_Creature.y,enty)
until flg:get(15) ==true or flg2:get(1) ==true
elseif r=="E" then
repeat
flg=engine.peek(vector:getval(0),ptr_Creature.flags)
flg2=engine.peek(vector:getval(indx),ptr_Creature.flags)
entx=engine.peek(vector:getval(0),ptr_Creature.x)+1
enty=engine.peek(vector:getval(0),ptr_Creature.y)
move=engine.peek(vector:getval(0),ptr_Creature.z)
engine.poke(vector:getval(indx),ptr_Creature.z,move)
engine.poke(vector:getval(indx),ptr_Creature.x,entx)
engine.poke(vector:getval(indx),ptr_Creature.y,enty)
until flg:get(15) ==true or flg2:get(1) ==true
end
--[[flg=engine.peek(vector:getval(0),ptr_Creature.flags)
flg2=engine.peek(vector:getval(indx),ptr_Creature.flags)
--print("how high?")
--entry=io.stdin:read()
--Crepos=engine.peek(vector:getval(0),ptr_Creature.x)+entx
move=engine.peek(vector:getval(0),ptr_Creature.z)
--print("W and E")
--entry=io.stdin:read()
move2=engine.peek(vector:getval(0),ptr_Creature.x)
--print("N and S")
--entry=io.stdin:read()
move3=engine.peek(vector:getval(0),ptr_Creature.y)
repeat
engine.poke(vector:getval(indx),ptr_Creature.z,move)
engine.poke(vector:getval(indx),ptr_Creature.x,entx)
engine.poke(vector:getval(indx),ptr_Creature.y,enty)
until flg:get(15) ==1 or flg2:get(1) ==1]]--
end
function selectdead()
local retvec={} --return vector (or a list)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector) --standart start
for i=0,vector:size()-1 do --check all creatures
local off
off=vector:getval(i)
local flags=engine.peek(off,ptr_Creature.flags)
if flags:get(1)==true then --if dead ...
table.insert(retvec,off)--... add it to return vector
end
end
return retvec --return the "return vector" :)
end
function Adv_tools.deadwarp()
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
local tx,ty,tz
local trgs=selectdead()
for k,v in pairs(trgs) do
tx,ty,tz=getxyz()
print("Warp to coords:"..tx.." "..ty.." "..tz)
engine.poke(v,ptr_Creature.x,tx)
engine.poke(v,ptr_Creature.y,ty)
engine.poke(v,ptr_Creature.z,tz)
end
func.PrintMessage3_(msg)
end
function selectcomp()
local retvec={} --return vector (or a list)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector) --standart start
for i=0,vector:size()-1 do --check all creatures
local off
off=vector:getval(i)
lfollow=engine.peek(off,ptr_Creature.followID) -- get target creatures "now following ID"
if lfollow ~=0xFFFFFFFF then --if its set
table.insert(retvec,off)--... add it to return vector
end
end
return retvec --return the "return vector" :)
end
function Adv_tools.compwarp() --teleport companions if you used Control Civ you might teleport your self aswell
func.PrintMessage2_(msg)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
local tx,ty,tz
local trgs=selectcomp()
for k,v in pairs(trgs) do
tx,ty,tz=getxyz()
print("Warp to coords:"..tx.." "..ty.." "..tz)
engine.poke(v,ptr_Creature.x,tx)
engine.poke(v,ptr_Creature.y,ty)
engine.poke(v,ptr_Creature.z,tz)
end
end
function selectzombie()
local retvec={} --return vector (or a list)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector) --standart start
for i=0,vector:size()-1 do --check all creatures
local off
off=vector:getval(i)
local flags=engine.peek(off,ptr_Creature.flags)
if flags:get(12)==true then --if undead in anyway...
table.insert(retvec,off)--... add it to return vector
end
end
return retvec --return the "return vector" :)
end
function Adv_tools.zomwarp() --teleport zombies
func.PrintMessage2_(msg)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
local tx,ty,tz
local trgs=selectzombie()
for k,v in pairs(trgs) do
tx,ty,tz=getxyz()
print("Warp to coords:"..tx.." "..ty.." "..tz)
engine.poke(v,ptr_Creature.x,tx)
engine.poke(v,ptr_Creature.y,ty)
engine.poke(v,ptr_Creature.z,tz)
end
end
function Adv_tools.fixwarp() --fixing the large invisible blocks that slows movement
local mapoffset=offsets.getEx("WorldData")--0x131C128+offsets.base()
local x=engine.peek(mapoffset+24,DWORD)
local y=engine.peek(mapoffset+28,DWORD)
local z=engine.peek(mapoffset+32,DWORD)
--vec=engine.peek(mapoffset,ptr_vector)
print("Blocks loaded:"..x.." "..y.." "..z)
print("Select type:")
print("1. All (SLOW)")
print("2. range (x0 x1 y0 y1 z0 z1)")
print("3. One block around pointer")
print("anything else- quit")
q=io.stdin:read()
n2=tonumber(q)
if n2==nil then return end
if n2>3 or n2<1 then return end
local xs,xe,ys,ye,zs,ze
if n2==1 then
xs=0
xe=x-1
ys=0
ye=y-1
zs=0
ze=z-1
elseif n2==2 then
print("enter x0:")
xs=tonumber(io.stdin:read())
print("enter x1:")
xe=tonumber(io.stdin:read())
print("enter y0:")
ys=tonumber(io.stdin:read())
print("enter y1:")
ye=tonumber(io.stdin:read())
print("enter z0:")
zs=tonumber(io.stdin:read())
print("enter z1:")
ze=tonumber(io.stdin:read())
function clamp(t,vmin,vmax)
if t> vmax then return vmax end
if t< vmin then return vmin end
return t
end
xs=clamp(xs,0,x-1)
ys=clamp(ys,0,y-1)
zs=clamp(zs,0,z-1)
xe=clamp(xe,xs,x-1)
ye=clamp(ye,ys,y-1)
ze=clamp(ze,zs,z-1)
else
xs,ys,zs=getxyz()
xs=math.floor(xs/16)
ys=math.floor(ys/16)
xe=xs
ye=ys
ze=zs
end
local xblocks=engine.peek(mapoffset,DWORD)
local flg=bit.bnot(bit.lshift(1,3))
for xx=xs,xe do
local yblocks=engine.peek(xblocks+xx*4,DWORD)
for yy=ys,ye do
local zblocks=engine.peek(yblocks+yy*4,DWORD)
for zz=zs,ze do
local myblock=engine.peek(zblocks+zz*4,DWORD)
if myblock~=0 then
for i=0,255 do
local ff=engine.peek(myblock+0x67c+i*4,DWORD)
ff=bit.band(ff,flg) --set 14 flag to 1
engine.poke(myblock+0x67c+i*4,DWORD,ff)
end
end
end
print("Blocks done:"..xx.." "..yy)
end
end
end
function selectciv()
local retvec={} --return vector (or a list)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector) --standart start
for i=0,vector:size()-1 do --check all creatures
local off
off=vector:getval(i)
local crciv=engine.peek(off,ptr_Creature.civ)
local curciv=engine.peek(vector:getval(0),ptr_Creature.civ)
if curciv==crciv then
--[[local flags=engine.peek(off,ptr_Creature.flags)
if flags:get(1)==false then]]-- --if dead ...
table.insert(retvec,off)--... add it to return vector
end
end
return retvec --return the "return vector" :)
end
function Adv_tools.ControlCiv2() --those who has the same civ number as the adventurer will become the adventurer's companion might need to run this again after you travel out for they stop being companions after you travel and need to reapply one more time.
--first three lines same as before (because we will need an offset of creature at location x,y,z)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
leg=offsets.getEx("Legends")
legvec=engine.peek(leg,ptr_vector)
local trgs=selectciv()
for k,v in pairs(trgs) do
print("members:"..k)
trgid=engine.peek(vector:getval(0),ptr_Creature.ID) --get players ID
playerlegid=rum_tools.getlegendsid(vector:getval(0))
trglegid=rum_tools.getlegendsid(v)
trgid=engine.peek(vector:getval(0),ptr_Creature.ID) --get players ID
engine.poke(v,ptr_Creature.followID,trgid) -- if not just write the players ID.
engine.poke(legvec:getval(trglegid),ptr_legends2.follow,playerlegid)
end
end
function Adv_tools.Convert() --makes companions the same civ
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
--id=engine.peekd(offsets.getEx("CreaturePtr"))
--print(string.format("Vec:%d cr:%d",vector:size(),id))
local trgs=selectcomp()
for k,v in pairs(trgs) do
print("members:"..k)
off=v
crciv=engine.peek(off,ptr_Creature.civ)
curciv=engine.peek(vector:getval(0),ptr_Creature.civ)
if curciv==crciv then
print("Friendly")
--engine.poke(off,ptr_Creature.civ,curciv)
flg=engine.peek(off,ptr_Creature.flags)
flg:set(17,false)
engine.poke(off,ptr_Creature.flags,flg)
else
print("Enemy or Adventurer- making friendly")
engine.poke(off,ptr_Creature.civ,curciv)
flg=engine.peek(off,ptr_Creature.flags)
flg:set(17,false)
flg:set(19,false)
engine.poke(off,ptr_Creature.flags,flg)
end
end
end
Adv_tools.menu:add("?control civ?",Adv_tools.ControlCiv2)
Adv_tools.menu:add("Zombies fix",Adv_tools.Zombieressurect)
Adv_tools.menu:add("?carryex?",Adv_tools.carryEX)
Adv_tools.menu:add("arrange companions",Adv_tools.compwarp)
Adv_tools.menu:add("move zed",Adv_tools.zomwarp)
Adv_tools.menu:add("move souls",Adv_tools.deadwarp)
Adv_tools.menu:add("convert companions",Adv_tools.Convert)
note: the original headers where change from Rum_tools to Adv_tools for easier adding.
When I try to use any of the adv tools it says creature not found.
So how exactly do you add a plug in to DFhack?
more so for Deviled have you try using the pointer on a creature who is alive?hehe tottaly forgot how it works :D
ADv_tools greatest hurdle is just the teaching folks you need to use the pointer on top of the creature you want to affect.
Warmist you didn't add the perma adventurer swap and perma follow for the Dfhack version of DFusion?
I guess there removed until dfhack version works properly.
more so for Deviled have you try using the pointer on a creature who is alive?
ADv_tools greatest hurdle is just the teaching folks you need to use the pointer on top of the creature you want to affect.
Oh warmist I got a question I'm having trouble with getting a site to be change due to the dfusion doesn't recognize SCALE as a word and Dfusion can't search for sites by one word.
The issue here is from attempting to change a elven resort over to a hamlet so I can steal their princess for my fort.
So has he not released the official Plugin-version for DF Hack, I'm honestly stumped as to how I use DFusion as a plugin for DFhack.
function OnTick()
DoCarry()
end
Docarry(rum_tools.carry)
wait a minute why is it that the list shows only "g"s?"g" is a bug (currently have no idea why... could be something with lua lib)
that the first time seeing OnTick before. Does this replace the "repeat until commands" or do I have to insert the function as a call to like so?Code: [Select]Docarry(rum_tools.carry)
function rum_tools.carry()
-- some questions maybe?
--some settup
OnTick=function ()
-- do stuff what is written here every "tick"
end
end
function rum_tools.Gitcarry()
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
indx=GetCreatureAtPos(getxyz())
print("grabbing person")
OnTick=function ()
flg=engine.peek(vector:getval(0),ptr_Creature.flags)
flg2=engine.peek(vector:getval(indx),ptr_Creature.flags)
enty=engine.peek(vector:getval(0),ptr_Creature.y)+1
entx=engine.peek(vector:getval(0),ptr_Creature.x)
move=engine.peek(vector:getval(0),ptr_Creature.z)
engine.poke(vector:getval(indx),ptr_Creature.z,move)
engine.poke(vector:getval(indx),ptr_Creature.x,entx)
engine.poke(vector:getval(indx),ptr_Creature.y,enty)
if flg:get(15) ==true or flg2:get(1) ==true then
end
end
endthe issue of using this is you can't let go of the target and the game is slow.
When and how exactly should I use simple embark? I got to the prepare for the journey carefully screen, but when I use simple embark, nothing happens, there's no prompt asking me for the required number of dwarves or something like that.before you embark, there no prompt but you can still enter the number oh and the number has to be above 7 or else the game will crash.
Buildings : 0x12C4DA8
Also onfunction trigger for levers:onfunction.AddFunction(0x3D5886+offsets.base(),"Flip",{building="esi"})
Also some building patterns:ptr_building={}
ptr_building.RTI={off=0,rtype=DWORD}
ptr_building.xs={off=4,rtype=DWORD}
ptr_building.ys={off=6,rtype=DWORD}
ptr_building.zs={off=8,rtype=DWORD}
ptr_building.xe={off=12,rtype=DWORD}
ptr_building.ye={off=16,rtype=DWORD}
ptr_building.ze={off=20,rtype=DWORD}
ptr_building.flags={off=24,rtype=ptt_dfflag.new(4)}
ptr_building.materials={off=28,rtype=DWORD}
ptr_building.builditems={off=228,rtype=ptr_vector}
function ptr_building.getname(self,RTI)
if RTI == nil then
return string.sub(RTTI_GetName(self.RTI),5,-3)
else
return string.sub(RTTI_GetName(RTI),5,-3)
end
end
ptr_subbuilding={}
ptr_subbuilding["building_trapst"]={}
ptr_subbuilding["building_trapst"].state={off=250,rtype=DWORD} -- atleast lever has this
ptr_subbuilding["building_doorst"]={}
ptr_subbuilding["building_doorst"].flg={off=248,rtype=WORD} --maybe flags?
ptr_subbuilding["building_doorst"].state={off=250,rtype=DWORD}
offsets.new("Buildings", <?????????)buildings=buildings or {} -- if there is table named "buildings" leave it alone, if not create an empty one.
The function also needs to be changed a bit (disclaimer writing before going to bed/not tested):function buildings.select()
myoff=offsets.getEx("Buildings")
vector=engine.peek(myoff,ptr_vector)
tx,ty,tz=getxyz()
T={}
for i=0,vector:size()-1 do --this finds all item offsets that are on pointer
itoff=vector:getval(i)
xs=engine.peek(itoff,ptr_building.xs)
xe=engine.peek(itoff,ptr_building.xe)
ys=engine.peek(itoff,ptr_building.ys)
ye=engine.peek(itoff,ptr_building.ye)
zs=engine.peek(itoff,ptr_building.zs)
ze=engine.peek(itoff,ptr_building.ze)
if tx>=xs and ty>=ys and tz>=zs and tx<=xe and ty<=ye and tz<=ze then
table.insert(T,itoff)
end
end
print("Buildings under cursor:")
i=1
for _,v in pairs(T) do
RTI=engine.peek(v,ptr_building.RTI)
print(i..". "..ptr_building.getname(nil,RTI))
i=i+1
end
print("Type number to edit or 'q' to exit")
while true do
q=io.stdin:read()
if q=='q' then return end
if tonumber(q) ~=nil and tonumber(q)<i then break end
end
return T[tonumber(q)]
end
Don't remember if this works correctly but could help (generic function to edit anything that has a pattern entry)ModPattern(itoff,ptr_building) -- first argument is offset (could be gotten with buildings.select) and second which pattern to use (could be ptr_subbuilding[name])
Don't we need some kind of function in the offsets.lua file too ?
offsets.new("Buildings",f_buildings)
function f_buildings
pos=offsets.find(??????????????????????????)
.....
end
function ControlCiv3()
--first three lines same as before (because we will need an offset of creature at location x,y,z)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
leg=offsets.getEx("Legends")
legvec=engine.peek(leg,ptr_vector)
local trgs=selectciv()
for k,v in pairs(trgs) do
--print("members:"..k)
trgid=engine.peek(vector:getval(0),ptr_Creature.ID) --get players ID
playerlegid=getlegendsid(vector:getval(0))
trglegid=getlegendsid(v)
trgid=engine.peek(vector:getval(0),ptr_Creature.ID) --get players ID
engine.poke(v,ptr_Creature.followID,trgid) -- if not just write the players ID.
engine.poke(legvec:getval(trglegid),ptr_legends2.follow,playerlegid)
engine.poke(vector:getval(0),ptr_Creature.followID,-1)
engine.poke(legvec:getval(trglegid),ptr_legends2.follow,-1)
end
end
function selectciv()
local retvec={} --return vector (or a list)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector) --standart start
for i=0,vector:size()-1 do --check all creatures
local off
off=vector:getval(i)
local crciv=engine.peek(off,ptr_Creature.civ)
local curciv=engine.peek(vector:getval(0),ptr_Creature.civ)
if curciv==crciv then
--[[local flags=engine.peek(off,ptr_Creature.flags)
if flags:get(1)==false then]]-- --if dead ...
table.insert(retvec,off)--... add it to return vector
end
end
return retvec --return the "return vector" :)
end
function selectcomp()
local retvec={} --return vector (or a list)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector) --standart start
for i=0,vector:size()-1 do --check all creatures
local off
off=vector:getval(i)
lfollow=engine.peek(off,ptr_Creature.followID) -- get target creatures "now following ID"
if lfollow ~=0xFFFFFFFF then --if its set
table.insert(retvec,off)--... add it to return vector
end
end
return retvec --return the "return vector" :)
end
function Convert()
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
--id=engine.peekd(offsets.getEx("CreaturePtr"))
--print(string.format("Vec:%d cr:%d",vector:size(),id))
local trgs=selectcomp()
for k,v in pairs(trgs) do
print("members:"..k)
off=v
crciv=engine.peek(off,ptr_Creature.civ)
curciv=engine.peek(vector:getval(0),ptr_Creature.civ)
if curciv==crciv then
--print("Civ Align")
else
--print("Civ not set up- setting")
engine.poke(off,ptr_Creature.civ,curciv)
end
end
end
onfunction.SetCallback("Move",ControlCiv3)
onfunction.SetCallback("Move",ControlCiv3)
So, sorry if anyone asked it already, but how do I put non-dwarves in my military? I ran Embark and Friendship at embark to start with 3 dorfs, 3 kobolds and 3 modded tigermen. All are [INTELLIGENT], could get skill points in embark and I can manually assign them jobs, but they don't seem to actually do any work, and only the dorfs appear on the military screen. What am I doing wrong?you either a) run friendship beforehand and have a citizen on the fort be leader of the squad the rest of the creatures should be to work.
EDIT: repeated friendship solved the problem, though now I have a tantrum spiral brewing for no apparent reason- the guys "lost a friend", even when I only butchered some stray animals. And it crashes when I activate multi-race migrants... sadly, I didn't get the sex distribution of my founders right at first, so it will soon be a dwarf-only fort :-\
Umm...sorry for being a noob, would someone please point me to a step-by-step guide to race changing? It's not quite self-evident in Runesmith.which one adventure race changing or Fort race changing?
Hi, I'm new to Dwarf Fortress, and I read here: http://www.bay12forums.com/smf/index.php?topic=95060.0well there might be a case of Civ number having an effect on the creature hostility if it's -1 it will attack no matter what, then there the chance of getting a kill quest which will also make it hostile to you(well that and befriending it will betray the site you got the quest from and banish you from the area.), if the dragon hit you or if you attack it first it already aggro with you and you lose the ability to tame it*, oh then there the case of it attacked your site before might make it hostile to you on the spot.
that DFusion could make other creatures into companions(Adventurer mode) I am wondering how to do that. I tried it with a dragon, and it became a companion, but still attacked me.
Wow, I didn't expect to get a reply so soon.yes. Though good luck not getting caught in the cross fire of it's dragon breathe.
Thanks, that's a bit confusing, but if I found a creature not from a quest, used DFusion to tame it, and used something like Runesmith to change the civ number, i might get a tamed dragon?
MAybe I'm not using it right. But I dl'd 3.8, installed it to my dwarf fortress root directory (where DwarfFortress.exe is at), and when I run it, I guess "can not find DF".well Dfusion 3.8 doesn't need to be in the DF folder for it to work.
31.25is it SDL df or legacy?
windows. I'm using the lazy new pack, but I have a straight 31.25 I was using. Wuz the difference? It's capable of running in a window. It's the standard version dl'd from bay12games.
I did get it working with dfhack r8 package. :) Just not with the standalone package.
Tee hee 20 dorfs!
function derot()
myoff=offsets.getEx("Items") -- first find out where "item vector" is
vector=engine.peek(myoff,ptr_vector) -- get list of items
for i=0,vector:size()-1 do --look at each item
flg=engine.peek(vector:getval(i),ptr_item.flags)
flg:set(5,0)
engine.poke(vector:getval(i),ptr_item.flags,flg)
end
end
function Dfolder()
DeathMsg()
Ghost()
makeghost()
end
function Mfolder()
derot()
end
function Bfolder()
Burn()
end
function Hfolder()
DeathMsg()
end
stick this under the first "onfunction.setcallback" line --onfunction.SetCallback("Die",Dfolder)
onfunction.SetCallback("Move",Mfolder)
onfunction.SetCallback("Flip",Bfolder)
lnp is sdl. It's possible I was using legacy with another df I had (31.25). But I'm not sure. At this point I'm not sure if I care if the new dfhack r8 has the latest dfusion, cuz I got it worked with dfhack r8.dfhack only updated dfusion in r7, r8 just an addon to Minecraft. oh well hopefully you can prevent scattering and soon playing with "turn dead to zombies" mode in no time.
Sorry if I sound dumb or the subject's been answered, but is there a way to make some of the embark creatures females? I seem to only have males on embark. And I plan on killing every single migrant who comes to my fort.well you could make a race of dwarves that the males lay eggs. race change one dwarf to that one, then run egg hatcher and race change the first female born to a normal dwarf.
Hm...I heard it is possible to make half-breeds...I have a half-elf raw file, now how do I do the whole human-elf breeding thing so I can put this raw into action? I know it involves race-changer, but the only functions I use are the ones pertaining to fortress mode (embark, friendship, migrants), so how do I attempt half-breeds?okay Dfusion from Dfhack removed Adventure tools warmist didn't add them back so you just have to use dfusion 3.8 or copy paste the race change function from that into Dfhack dfusion.
function trait() --this here is the central hub for adventure mode ongoing functions based on the creature's race, this will work in fort mode if you set up one of the members in the area as the "adventurer"
RaceTable=RaceTable or BuildNameTable() --slow.If loaded don't load again
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
trai=engine.peek(vector:getval(0),ptr_Creature.race)
tra=RaceTable["KEEPER_INFECTED"] --all these are set for different creature races the adventurer could be, one can change this to what ever they want
tra4=RaceTable["FRAWD"]
tra2=RaceTable["KEEPER"]
tra3=RaceTable["DWARF"]
tra5=RaceTable["MAGE"]
tra6=RaceTable["INTERN"]
if trai==tra then --this is the 'folder' section that checks if the adventurer is either a Keeper infected and if so then runs the functions in it.
--ControlZom3()
keeptrack() --these are functions stored in the folder if the above is true dfusion will run the functions
ControlRace()
end
if trai==tra2 or Trai==tra4 then
ControlCiv3()
end
if trai==tra5 then
--Magi()
Keeptrack()
end
if trai==tra6 then
Nightfriend()
end
if trai==tra3 then
--ControlCiv3()
--wepbrn2()
ControlRace()
--Voodoo1()
end
Voodoo2() --this goes to a function that does the same thing Trait does but to items and tracks them through material and item type.
end
function Voodoo2() --stick normal spells here to add or make a spell you need to use Dfusion item edit to find out the item itmser,mat,submat,submat2 number
myoff=offsets.getEx("Items")
vector=engine.peek(myoff,ptr_vector)
for i=0,vector:size()-1 do --check all items
off=vector:getval(i)
itmser=ptr_item.getname(nil,RTI)
mat=engine.peek(off,ptr_item.mat)
submat=engine.peek(off,ptr_item.submat)
submat2=engine.peek(off,ptr_item.submat2)
lid=engine.peek(off,ptr_item.legendid)
RTI=engine.peek(off,ptr_item.RTI)
if itmser=="item_verminst" then --this checks if the item is a vermin
if mat==(293) then --this checks if the item is a certain type of vermin which as of now checks to see if it's a fluffly wambler
Nightfriend()
flg=engine.peek(off,ptr_item.flags) --this should destroy the wambler to prevent the above function to repeat each move
flg:set(17,true)
end
end
if itmser=="item_boulderst" then
if mat==(129) then
print("it really works")
Nightfriend()
end
if submat2==(305) then
--ControlZom3()
Zombieressurect()
end
if submat2==(306) then
print("teleport spell goes here")
end
end
if mat==(0) and submat2==(304) then
print("works")
end
if itmser=="item_statuest" then
if submat2==(275) then
print("this is the trigger")
end
if submat2==(306) then
print("teleport here")
itemwarp()
end
end
if itmser=="item_eggst" then
if mat==(129) then
print("it really works")
end
end
end
end
function Dfolder() --these folders are here because Onfunction doesn't run all commands if you attach them to the bottom, so I though why not make a function that does that for me. this is the on death folder which holds key commands that trigger if someone dies.
DeathMsg()
Ghost()
makeghost()
end
function Mfolder() --this is the on move folder which holds functions I want to run forever, or if someone moves. so playing adventure mode this will happen constantly
raceconvert()
--ControlCiv3()
derot()
--Zombieressurect()
--zombiearmy()
trait()
--Nightfriend()
makeghost()
end
function Bfolder() --this is the on building flip folder if someone pulls a level this triggers
Burn()
end
function Hfolder()--this is on hurt suppose to flip off when someone is damaged haven't found use for it as of now.
DeathMsg()
end
if mypos then
print("Onfunction already installed")
--onfunction.patch(0x189dd6+offsets.base())
else
onfunction.install()
dofile("dfusion/onfunction/locations.lua")
--onfunction.SetCallback("Die",Dfolder) --this is where the folders go
onfunction.SetCallback("Move",Mfolder)
onfunction.SetCallback("Flip",Bfolder)
end
Is there a way to toggle the size of the armor that armorsmiths make? Or can elves and humans wear the same armor as their dwarven fortmates?Easy way- nope. But AFAIK some of them share the same armor size. And armorsmith makes armor that fits himself. So if you have a troll army you will need troll smiths too. I think because there is no easy way to manage this is the main reason why multirace forts are not enabled by Toady One.
f_table={}
--fill in the table with choices
f_table[RaceTable["KEEPER_INFECTED"]]=function () keeptrack();ControlRace() end
f_table[RaceTable["FRAWD"]]=ControlCiv3
f_table[RaceTable["KEEPER"]]=ControlCiv3
f_table[RaceTable["DWARF"]]=ControlRace
f_table[RaceTable["MAGE"]]=Keeptrack
f_table[RaceTable["INTERN"]]=Nightfriend
--f_table[ raceid]= some function, if you need more then one function you can do inplace functions i.e. like KEEPER_INFECTED above.
if f_table[trai] ~= nil then
f_table[trai]() -- call the function from the table
else
Voodoo2() -- did not find this race so call default function
end
this is like switch statements in other programming languages.
function Voodoo2() --stick normal spells here
mattbl=mattbl or BuildMaterialTable() -- could be slow so if there is a table don't do it again
myoff=offsets.getEx("Items")
vector=engine.peek(myoff,ptr_vector)
for i=0,vector:size()-1 do --check all creatures
local off=vector:getval(i)
local mat=engine.peek(off,ptr_item.mat)
local submat=engine.peek(off,ptr_item.submat)
local submat2=engine.peek(off,ptr_item.submat2)
local lid=engine.peek(off,ptr_item.legendid)
local RTI=engine.peek(off,ptr_item.RTI)
local itmser=ptr_item.getname(nil,RTI)
q=mattbl["ADAMANTINE"]
q2=mattbl["SPELL_ZOM"]
q3=mattbl["SPELL_TEL"]
q4=mattbl["SPELL_TRAIT"]
q5=mattbl["SPELL_TRAIT2"]
q6=mattbl["SPELL_TRAIT3"]
q7=mattbl["PERMAICE"]
--[[if submat2==q then
--print("Thank's Warmist")
end]]--
if itmser=="item_backpackst" then
if submat2==q2 then
--print("works")
zombiearmy2()
end
end
if itmser=="item_boulderst" then
if submat2==q4 then
--print("it really works")
Nightfriend()
flg=engine.peek(off,ptr_item.flags)
flg:set(17,1)
end
if submat2==q2 then
--ControlZom3()
--Zombieressurect()
flg=engine.peek(off,ptr_item.flags)
flg:set(17,true)
end
end
if itmser=="item_statuest" then
if submat2==mattbl["SLADE"] then
print("this is the target")
end
if submat2==q3 then
--print("teleport here")
itemwarp()
flg=engine.peek(off,ptr_item.flags)
flg:set(17,true)
end
if submat2==q2 then
Zombieressurect()
flg=engine.peek(off,ptr_item.flags)
flg:set(17,true)
end
end
if itmser=="item_eggst" then
if mat==(129) then
makeghost()
print("it really works")
flg=engine.peek(off,ptr_item.flags)
flg:set(17,true)
end
end
end
end
So now I just need to do is go back to my old rumtools functions and swap out the whole use pointer bits with item placement maybe have yes and no be items that if true will disappear(to clear the function and to prevent horrible game crashes from certain functions.).
Is there a way to toggle the size of the armor that armorsmiths make? Or can elves and humans wear the same armor as their dwarven fortmates?
well it's based on Race than size really. the size bit is just their for flavor text and to explain which race can fit that.Is there a way to toggle the size of the armor that armorsmiths make? Or can elves and humans wear the same armor as their dwarven fortmates?
Elves can wear dwarven armor, they're the same size as our dwarves. But humans can't wear it.
Did it ever work?well it's based on Race than size really. the size bit is just their for flavor text and to explain which race can fit that.Is there a way to toggle the size of the armor that armorsmiths make? Or can elves and humans wear the same armor as their dwarven fortmates?
Elves can wear dwarven armor, they're the same size as our dwarves. But humans can't wear it.
edit: hey when did Prevent scatter stop working in Hamlets?
And yet I havent found a single community fort using this yet. Why not?The game census itself only reads actual dwarves. A quick glance at "z" is no longer accurate for the total fort population. Related to this, the current version of Dwarf Therapist only reads actual dwarves, and thus you'll have quite a few fort denizens who have to be toggled manually. Perhaps there are other big reasons, but those two certainly don't help. It's too bad. It's a nifty program!
Oh, I was only talking about multi-species forts. For that, changing the controlling race still leaves all the other races out in the cold, census-wise.I think IamanElfCollaborator meant that you could cycle through races i.e. do a census/DT on dwarves, on elves, then on trolls. The most annoying thing that i have to tackle is migrants sometimes ignore the list (tested with only dogs as migrants but still dwarves appeared).
EDIT: Unless you mean that it's possible to have more than one controlling race. Is it?
well... hmm the last time I remember using it was Tweak where I physically changed the area to that.Did it ever work?well it's based on Race than size really. the size bit is just their for flavor text and to explain which race can fit that.Is there a way to toggle the size of the armor that armorsmiths make? Or can elves and humans wear the same armor as their dwarven fortmates?
Elves can wear dwarven armor, they're the same size as our dwarves. But humans can't wear it.
edit: hey when did Prevent scatter stop working in Hamlets?
Would someone tell me how to equip companions in Adventurer mode with this utility? In a noob-compatible way if possible, please ;)First place the X pointer on the companion you want to change to.
Look.both actually even throw/fire works.
function itemanimalwarp()
--[[if itoff==nil then
itoff=selectstatue3()
end]]--
local myoff=offsets.getEx("AdvCreatureVec")
local vector=engine.peek(myoff,ptr_vector)
--local indx=0
local sx,sy,sz
local curoff=vector:getval(0)
local trgs=selectstatue2()
for k,v in pairs(trgs) do
local trgs=selectwild()
for t,b in pairs(trgs) do
ix=engine.peek(v,ptr_item.x)
iy=engine.peek(v,ptr_item.y)
iz=engine.peek(v,ptr_item.z)
sx=engine.peek(b,ptr_Creature.x)
sy=engine.peek(b,ptr_Creature.y)
sz=engine.peek(b,ptr_Creature.z)
--r=io.stdin:read()
local tx,ty,tz
tx=ix
ty=iy
tz=iz
engine.poke(b,ptr_Creature.x,tx)
engine.poke(b,ptr_Creature.y,ty)
engine.poke(b,ptr_Creature.z,tz)
local flags=engine.peek(b,ptr_Creature.flags)
engine.poke(b,ptr_Creature.flags,flags)
end
end
end
function selectstatue2()
mattbl=mattbl or BuildMaterialTable() -- could be slow so if there is a table don't do it again
local retvec={} --return vector (or a list)
myoff=offsets.getEx("Items")
vector=engine.peek(myoff,ptr_vector)
for i=0,vector:size()-1 do --check all creatures
off=vector:getval(i)
mat=engine.peek(off,ptr_item.mat)
submat=engine.peek(off,ptr_item.submat)
submat2=engine.peek(off,ptr_item.submat2)
lid=engine.peek(off,ptr_item.legendid)
RTI=engine.peek(off,ptr_item.RTI)
--entry=io.stdin:read()
q=mattbl["SPELL_TEL"]
--if q~=nil then return end
itmser=ptr_item.getname(nil,RTI)
--local flags=engine.peek(off,ptr_item.flags)
if itmser=="item_statuest" and submat2==q then --if a weapon in anyway...
table.insert(retvec,off)--... add it to return vector
--print("drugs")
end
end
return retvec --return the "return vector" :)
end
function selectwild()
local retvec={} --return vector (or a list)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector) --standart start
for i=0,vector:size()-1 do --check all creatures
local off
off=vector:getval(i)
local crciv=engine.peek(off,ptr_Creature.civ)
curciv=engine.peekd(offsets.getEx("CurrentRace")-12)
wild=(-1)
if crciv==curciv then
else
table.insert(retvec,off)--... add it to return vector
end
end
return retvec --return the "return vector" :)
end
okay here's a fresh batch of item functions that a personal necromancer would love.
sadly
code]function itemghostwarptest(off) --this will take the item(from voodoo2) that triggered it and teleport all ghosts to it's coordinates. usefullness depends on what you do to the ghosts.
--[[if itoff==nil then
itoff=selectstatue3()
end]]--
local myoff=offsets.getEx("AdvCreatureVec")
local vector=engine.peek(myoff,ptr_vector)
--local indx=0
local sx,sy,sz
local curoff=vector:getval(0)
local trgs=selectghost()
for t,b in pairs(trgs) do
ix=engine.peek(off,ptr_item.x)
iy=engine.peek(off,ptr_item.y)
iz=engine.peek(off,ptr_item.z)
sx=engine.peek(b,ptr_Creature.x)
sy=engine.peek(b,ptr_Creature.y)
sz=engine.peek(b,ptr_Creature.z)
--r=io.stdin:read()
local tx,ty,tz
tx=ix
ty=iy
tz=iz
engine.poke(b,ptr_Creature.x,tx)
engine.poke(b,ptr_Creature.y,ty)
engine.poke(b,ptr_Creature.z,tz)
local flags=engine.peek(b,ptr_Creature.flags)
engine.poke(b,ptr_Creature.flags,flags)
end
end
function itemcompwarptest(off) --a code set up to teleport companions to places you want them to be, like on the roof, several feet into lava, or with you so they don't end up chasing off for some hard to kill animal during a raid
--[[if itoff==nil then
itoff=selectstatue3()
end]]--
local myoff=offsets.getEx("AdvCreatureVec")
local vector=engine.peek(myoff,ptr_vector)
--local indx=0
local sx,sy,sz
local curoff=vector:getval(0)
local trgs=selectcomp()
for t,b in pairs(trgs) do
ix=engine.peek(off,ptr_item.x)
iy=engine.peek(off,ptr_item.y)
iz=engine.peek(off,ptr_item.z)
sx=engine.peek(b,ptr_Creature.x)
sy=engine.peek(b,ptr_Creature.y)
sz=engine.peek(b,ptr_Creature.z)
--r=io.stdin:read()
local tx,ty,tz
tx=ix
ty=iy
tz=iz
engine.poke(b,ptr_Creature.x,tx)
engine.poke(b,ptr_Creature.y,ty)
engine.poke(b,ptr_Creature.z,tz)
local flags=engine.peek(b,ptr_Creature.flags)
engine.poke(b,ptr_Creature.flags,flags)
end
end
function selectghost()
local retvec={} --return vector (or a list)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector) --standart start
for i=0,vector:size()-1 do --check all creatures
local off
off=vector:getval(i)
local flags=engine.peek(off,ptr_Creature.flags)
if flags:get(76)==true then --if dead ...
table.insert(retvec,off)--... add it to return vector
end
end
return retvec --return the "return vector" :)
end
function selectcomp()
local retvec={} --return vector (or a list)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector) --standart start
for i=0,vector:size()-1 do --check all creatures
local off
off=vector:getval(i)
lfollow=engine.peek(off,ptr_Creature.followID) -- get target creatures "now following ID"
if lfollow ~=0xFFFFFFFF then --if its set
table.insert(retvec,off)--... add it to return vector
end
end
return retvec --return the "return vector" :)
end
I might get started working on two way teleporters or the kind that warps folks if they walk over it.the 'races.txt' files for Friendship and Migrants is all wonky. This is in the intergrated DFusion for the newest version of DFhack r8. How do I use it? all the Races are jammed together with nospaces all on one line. I was used to the old DFusion where each race had to be on it's own line, and when I format to fit that way I get loading fails and crashes.I think it happened because of different newline format (linux vs windows newline format). It still needs to be one race per line.
EDIT2:Totally confused now... Should work either way. Oh and races.txt will probably go, but before i need to think of some better way to enter races.
Nvm it was my error, surpised I didn't see it before. The races.txt must be altered BEFORE running DF and/or DFhack, You guys probally have that written somewhere.
Its out already? Oh. I don't need migrants. I was thinking about somehow converting one faction (civ) to another. Like thieves kidnapping and training a random civilian.
Well Dfusion does have access to creature flags and Creature civs so you could just make a function that does that for you.Its out already? Oh. I don't need migrants. I was thinking about somehow converting one faction (civ) to another. Like thieves kidnapping and training a random civilian.
In a way you can, it requires runesmith and the Friendship option on here. If I think I know what your talking about, say you get invaded and a goblin/kobold/elf gets caught in a cage trap you can use runesmith to remove all the hostile flags and add the friendly ones then change his civ number to yours.
Then use friendship to allow control over your "enslaved" invader, of course if he/she kills a pet/member of your civ he/she is now a horrible cause of a loyalty cascade. But using friendship causes oddies such as your dwarves insisting they must bury all the dead that you specify in the races.txt in the friendship foulder.
and or if you don't stick the race you using in the list it will count all of them as tamed and end the fort.
function selectcaged()
local retvec={} --return vector (or a list)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector) --standart start
for i=0,vector:size()-1 do --check all creatures
local off
off=vector:getval(i)
--[[local crciv=engine.peek(off,ptr_Creature.civ)
local curciv=engine.peek(vector:getval(0),ptr_Creature.civ)
if curciv==crciv then]]--
local flags=engine.peek(off,ptr_Creature.flags)
if flags:get(25)==true then --if caged ...
table.insert(retvec,off)--... add it to return vector
end
end
return retvec --return the "return vector" :)
end
function convertcage()
local trgs=selectcaged()
for k,v in pairs(trgs) do
flags=engine.peek(v,ptr_Creature.flags)
flags:set(17,false)
flags:set(19,false)
flags:set(26,true) --this is the tamed flag
local crciv=engine.peek(v,ptr_Creature.civ)
local curciv=engine.peekd(offsets.getEx("CurrentRace")-12)
engine.poke(v,ptr_Creature.civ,curciv)
end
end
this will take any one caged and safely turn them into apart of the fort tamed. hopefully you guys know how to open up a plugin.lua file using notepad and edit it in right?
Its out already? Oh. I don't need migrants. I was thinking about somehow converting one faction (civ) to another. Like thieves kidnapping and training a random civilian.on this subject I remember I could kidnap(use dfusion to force joining) a couple royal men and women from their forts and walk them into my fort then made them breed(through race changing them to a identical race that just reproduce by laying eggs) to fuel my royal army(with use of egg hatcher).
Meh, I'll just take my pick from the normal batch of migrants, the ones for the original fort civ.oh one thing I also found out that if you slap on "is resident" on a military unit they don't need to feed any more.
okay the On command is when you use command dfusion to do it.
which could be done through sticking something kinda like this
" items.menu:add("prompt name of function here that comes up when you go into that menu",items.functionnamehere)"
with the rest of coding similar to it that's at the bottom of the entire page.
Hugo,Iaman I never known lua when I started coding for it or to mess with it on Darius level I just fiddle with the existing code and slightly modify it to see if it works.Its out already? Oh. I don't need migrants. I was thinking about somehow converting one faction (civ) to another. Like thieves kidnapping and training a random civilian.on this subject I remember I could kidnap(use dfusion to force joining) a couple royal men and women from their forts and walk them into my fort then made them breed(through race changing them to a identical race that just reproduce by laying eggs) to fuel my royal army(with use of egg hatcher).
I'm acually more confused on which plugin.lua I need to drop/work this into because:
1. there is one in almost every foulder in the DFhack's version of DFusion
2. all the .lua and .txt files have lost all form of formatting and are basically compacted to one line :-/
Armok be damned. I just...somehow...got a baby out of a fire imp and dwarf marriage. That means...he's a half breed. But...that's impossible. SOMEBODY EXPLAIN WHAT IN ARMOKS NAME IS GOING ON IN HERE?!ehehe... probably should put a disclaimer somewhere... Because i have no f idea what could go wrong (or right). My experiments before shown that there could not be interracial babies. But i guess new version friendship is even more... friendly :D
Wait, what?! Well if anything happens the baby would either be a dwarf/imp that can't be look at to tell the descriptions with out crashing the game, or you can and I was going through mixrace breeding all wrong.Armok be damned. I just...somehow...got a baby out of a fire imp and dwarf marriage. That means...he's a half breed. But...that's impossible. SOMEBODY EXPLAIN WHAT IN ARMOKS NAME IS GOING ON IN HERE?!ehehe... probably should put a disclaimer somewhere... Because i have no f idea what could go wrong (or right). My experiments before shown that there could not be interracial babies. But i guess new version friendship is even more... friendly :D
function selectcaged()
local retvec={} --return vector (or a list)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector) --standart start
for i=0,vector:size()-1 do --check all creatures
local off
off=vector:getval(i)
--[[local crciv=engine.peek(off,ptr_Creature.civ)
local curciv=engine.peek(vector:getval(0),ptr_Creature.civ)
if curciv==crciv then]]--
local flags=engine.peek(off,ptr_Creature.flags)
if flags:get(25)==true then --if caged ...
table.insert(retvec,off)--... add it to return vector
end
end
return retvec --return the "return vector" :)
end
function convertcage()
local trgs=selectcaged()
for k,v in pairs(trgs) do
flags=engine.peek(v,ptr_Creature.flags)
flags:set(17,false)
flags:set(19,false)
flags:set(26,true) --this is the tamed flag
local crciv=engine.peek(v,ptr_Creature.civ)
local curciv=engine.peekd(offsets.getEx("CurrentRace")-12)
engine.poke(v,ptr_Creature.civ,curciv)
end
end
Yes. She's friends with 3 other fire imps, 2 male one female if that helps. Hm...
Maybe she wanted a little adventure in her life? :P
EDIT: Actually, this is intresting enough that I might track the story of Asmel.
'The Story of Asmel Wheelscalded, Impborn.'
'Never has such a creation existed, neither shall it exist again.'
I'll be posting the story in the Community Stories forum, and I'll be posting here the progress of the mysterious half-breed.
EDIT2: For some reason, if I try to look at Asmel's description now, it crashes. What happened?
EDIT3:Look's like this world's screwed. IT crashes before I can do much else anyway. :(
Yes. She's friends with 3 other fire imps, 2 male one female if that helps. Hm...hmm did you close out of DF then reload, maybe you need friendship running to view?
Maybe she wanted a little adventure in her life? :P
EDIT: Actually, this is intresting enough that I might track the story of Asmel.
'The Story of Asmel Wheelscalded, Impborn.'
'Never has such a creation existed, neither shall it exist again.'
I'll be posting the story in the Community Stories forum, and I'll be posting here the progress of the mysterious half-breed.
EDIT2: For some reason, if I try to look at Asmel's description now, it crashes. What happened?
EDIT3:Look's like this world's screwed. IT crashes before I can do much else anyway. :(
Ah. In that case I have actually sort of gotten farther than you by getting two different races to be married and have children. Most of my dwellers are friends as well. Maybe adventure mode halfbreed mechanics are different from fort mode?there no Adventure mode breeding mechanics, or I haven't seen them.
modpos,modsize=engine.loadmod("dfusion/migrants/migrants.o","Migrants")
to something likemodpos,modsize=engine.loadmod("dfusion/migrants/migrants.o","Migrants",400) -- make space for 100 migrant races...
i think all the civs want to trade with me... and at the same time.
i think all the civs want to trade with me...
all the civs want to trade with me...If this could be mastered... There could be more then just your parent civ trading with you...
I haven't played DF in a while. I remember the last time I used this mod, it was to resurrect my slain adventurer.you should have flip on Ghost mode first before finishing the revival.
Unfortunately, the enemies simply killed me every time I was brought back to life.
It was depressing.
Hell, theres a lot of !!SCIENCE!! to go through here. I'll be working to see if I can replicate Asmel Impborn.I remember way back when I created my first half breed hybrid.
I must petition you for a gender change mode. That way, !!SCIENCE!! using half-breeds in fort mode can be more easily conducted.well I think runesmith has a female male gender change. but then why stop at gender and go full fiddling with caste swapping.
function selectcaged()
local retvec={} --return vector (or a list)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector) --standart start
for i=0,vector:size()-1 do --check all creatures
local off
off=vector:getval(i)
--[[local crciv=engine.peek(off,ptr_Creature.civ)
local curciv=engine.peek(vector:getval(0),ptr_Creature.civ)
if curciv==crciv then]]--
local flags=engine.peek(off,ptr_Creature.flags)
if flags:get(25)==true then --if caged ...
table.insert(retvec,off)--... add it to return vector
end
end
return retvec --return the "return vector" :)
end
function convertcage()
local trgs=selectcaged()
for k,v in pairs(trgs) do
flags=engine.peek(v,ptr_Creature.flags)
flags:set(17,false)
flags:set(19,false)
flags:set(26,true) --this is the tamed flag
local crciv=engine.peek(v,ptr_Creature.civ)
local curciv=engine.peekd(offsets.getEx("CurrentRace")-12)
engine.poke(v,ptr_Creature.civ,curciv)
end
end
Hate to be a noob, but it'd be great if someone could walk me through putting that code into the embedded Dfusion/Dfhack thing. and also to point out any errors. I'm thinking of making a multirace fort in a new world, which should be interesting.Code: [Select]function selectcaged()
local retvec={} --return vector (or a list)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector) --standart start
for i=0,vector:size()-1 do --check all creatures
local off
off=vector:getval(i)
--[[local crciv=engine.peek(off,ptr_Creature.civ)
local curciv=engine.peek(vector:getval(0),ptr_Creature.civ)
if curciv==crciv then]]--
local flags=engine.peek(off,ptr_Creature.flags)
if flags:get(25)==true then --if caged ...
table.insert(retvec,off)--... add it to return vector
end
end
return retvec --return the "return vector" :)
end
function tools.convertcage()
local trgs=selectcaged()
for k,v in pairs(trgs) do
flags=engine.peek(v,ptr_Creature.flags)
flags:set(17,false)
flags:set(19,false)
flags:set(26,true) --this is the tamed flag
local crciv=engine.peek(v,ptr_Creature.civ)
local curciv=engine.peekd(offsets.getEx("CurrentRace")-12)
engine.poke(v,ptr_Creature.civ,curciv)
end
end
tools.menu:add("convert caged animals",tools.convertcage)find the plugin.lua for Tools folder(if you have notepad or say Flash develop that might make this easier) then stick in my modified version of the code I did in your quote in the plugin.lua, Looks like interracial marriages are more common than i thought... Serpent man (man) with dwarf (woman) had a healthy little (dwarf) girl. I probably need to add ability to make different races for mixed breeds (with something like "DWARF+ELF=DWELF" where DWELF was added by modding)well that means you have to fix how dwarf fortress handles parental descriptions. also I'm one step ahead with interns safe crossing breeding with humans for they have the same detail descriptions the only difference is interns lay eggs and have mind flayer attacks.
Hm....in that case I'll need to be even further above you and make a creature able to breed in between dwarves, humans, elves, goblins, kobolds, and so many other creatures.Wait how did you do this feature any way? Using Migrants or just straight friendship mode? or did you did the friendship at the beginning to get multiple creature races access to noble jobs?
!!SCIENCE!! TO BE DONE!
Has anyone written there a Leaving Your Fort on Autopilot for Dummies guide? I just want to let my fort keep running while I go adventuring and start other forts. I never was able to do this with DFusion when I tried a while back.1. AFAIK impossible changing into adventure mode stops everything.
Also, is this all going to be significantly screwed up by the new release?
Well you can't get the fort to continue working on making metal swords when you switch over to adventure mode but you can set up a main hall where every one spawned will walk towards.Has anyone written there a Leaving Your Fort on Autopilot for Dummies guide? I just want to let my fort keep running while I go adventuring and start other forts. I never was able to do this with DFusion when I tried a while back.1. AFAIK impossible changing into adventure mode stops everything.
Also, is this all going to be significantly screwed up by the new release?
2. Yes it will be screwed quite significantly. But not as much as dfusion (old one) or spellcraft(dead with one version change :/ )
Run friendship (migrants too if you want to have multirace migrants coming) and if there is no other race creatures in military list (dunno why but sometimes it happens) try tool->set race and change "main" race to something else (e.g. TROLL) set squads and then (optionally) set it back.Even after that there's no other race units in military list.
pre-embarkRun friendship (migrants too if you want to have multirace migrants coming) and if there is no other race creatures in military list (dunno why but sometimes it happens) try tool->set race and change "main" race to something else (e.g. TROLL) set squads and then (optionally) set it back.Even after that there's no other race units in military list.
Should I run friendship pre- or postembark?
Well, it finally works in new world, but I still can't create squad out of creatures obtained after embark through Runesmith (Human caravan guards and serpent man, for example), maybe it doesn't display some flags?That's because if their not migrants, or born into the civ, they would be lock out of access the noble selections and being a leader to a military group is part of it.
That's because if their not migrants, or born into the civ, they would be lock out of access the noble selections and being a leader to a military group is part of it.But I can't add them even to squad with dwarven leader, they're simply not in the list.
you need to make dwarf(normal) leaders that has a multirace squadmembers for it to work (now), or make the new converted men and women have children so the children could be enlisted.
That's where the half-breed problem crops up.well the half breed issue comes from the facial(random generated) descriptions of the two creatures are different and the game calling for one set while looking at a creature who set up with something different.
had you tried checking if they have: "is resident" flag check off, The Tame flag check off, have the civ number correct to the civ your in, a dwarf in the leaders spot.That's because if their not migrants, or born into the civ, they would be lock out of access the noble selections and being a leader to a military group is part of it.But I can't add them even to squad with dwarven leader, they're simply not in the list.
you need to make dwarf(normal) leaders that has a multirace squadmembers for it to work (now), or make the new converted men and women have children so the children could be enlisted.
Also, is there some way to deal with tile occupancy bug?
Well you can't get the fort to continue working on making metal swords when you switch over to adventure mode but you can set up a main hall where every one spawned will walk towards.Has anyone written there a Leaving Your Fort on Autopilot for Dummies guide? I just want to let my fort keep running while I go adventuring and start other forts. I never was able to do this with DFusion when I tried a while back.AFAIK impossible changing into adventure mode stops everything.