Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 28 29 [30] 31 32 ... 38

Author Topic: DFusion - a lua based plugin system (integrated into DFHack)  (Read 149685 times)

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #435 on: October 02, 2011, 11:19:49 pm »

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

Not necessary. This is used only when dfusion is run without offsets.txt

mstram

  • Bay Watcher
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #436 on: October 03, 2011, 12:14:11 pm »

Ok, I have the names of the buildings being displayed.

"building_screw_pumpst", seems to be the only recognizable mechanism "actuator"

I guess I can start with that and use the address in cheat engine

Any idea where the lever and pressure plate are ?

And do you know what the address for the buildings offset is for version 28.40d ?

   building_cabinetst
   building_statuest

   building_workshopst

   building_traction_benchst
   building_chairst
   building_bedst
   building_coffinst
   building_wellst
   building_civzonest

   building_gear_assemblyst
   building_windmillst
   building_weaponst
   building_hatchst

   building_screw_pumpst

   building_floodgatest
   building_grate_floorst
   building_bridgest
   building_weaponrackst
   building_armorstandst
   building_furnacest

   building_doorst
   building_cagest
   building_trapst
   building_chainst
   building_tablest
   building_boxst
   building_farmplotst
   building_stockpilest
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #437 on: October 12, 2011, 12:48:08 am »

I wrote up a guide on how to use Site changer and how to manually search for the site number if site changer's own search engine doesn't work.
part 1
part 2
part 3
hopefully this would clear up some issues.

oh here's a onfunction command that will make any one of the same civ companions to the adventurer, so folks who want to hotseat playstyle can swap around companions and not lose every one on board except for new recruits which then the convert function kicks in and fixes that.
Code: [Select]
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 Warmist are the new locations that was updated for your copy of dfhack Dfusion can be applied to dfusion location.lua or do I need the extra bits to get them to work properly?
I want to make a ingame teleporter, but don't know the proper way to do so.
Logged
I thought I would I had never hear my daughter's escapades from some boy...
DAMN YOU RUMRUSHER!!!!!!!!
"body swapping and YOU!"
Adventure in baby making!Adv Homes

Tirion

  • Bay Watcher
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #438 on: October 13, 2011, 10:28:20 am »

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?

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  :-\
« Last Edit: October 13, 2011, 01:19:33 pm by Tirion »
Logged
"Fools dig for water, corpses, or gold. The earth's real treasure is far deeper."

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #439 on: October 13, 2011, 03:57:04 pm »

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?

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  :-\
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.
b) change their race to match the one currently running the fort go into military and add them in(they might not be able to be leaders of their squads so make sure you have a normal citizen assign before you go changing the race of a dragon.) make sure to change the creature's race back once you enlist them to the army C) use race changer to flip over to the other race and add them into the military. oh best to make sure the creature has the is resident flag off which can be checked through runesmith.
Logged
I thought I would I had never hear my daughter's escapades from some boy...
DAMN YOU RUMRUSHER!!!!!!!!
"body swapping and YOU!"
Adventure in baby making!Adv Homes

Tirion

  • Bay Watcher
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #440 on: October 13, 2011, 04:13:44 pm »

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.
Logged
"Fools dig for water, corpses, or gold. The earth's real treasure is far deeper."

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #441 on: October 13, 2011, 10:27:29 pm »

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?
both work similar but leads to two different functions
Adventure race change: change the creature race(dwarf to human or Human to Cat)
Fort race change: change the playable race of the fort(if you ever play a modded Df where they had multiple races to play in fort mode? well this here command will allow you to change hope runs the fort and flip control. like if you have a tigerman slave in a dwarf civ you can change the race to Tigerman and get Tigerman Migrants and get to control the Tigerman while the Dwarfs act friendly)

Adventure Race change can be done by having the "x"pointer on the creature you want to change and selecting the function, the utility will look for the creature under the X pointer race and ask you for the name of race you want to change to IN ALL CAPS and the RAW name(which means you need to dive into the raw/object folder and search for the creature's name if you don't already know and even then Race changing Is crash happy if you unpause or fail to save the game after changing for unless the creature you swap to has the same body type and facial descriptions it don'g any task will break the game though you only using this to trick DF into allowing the creature access to military and can revert the process after you are done).(note this is in old dfusion where adventure tools still work)
Fort mode Race change can be done by just simply typing in the RAW name of the creature you want to play as in fort mode, but beware the creature must be apart of the civ or else the game will switch see no sentient works around and end it.

and usually all this knowledge is from Me going through trial and error(and diving into the plugin.lua to read the developer text which explains what parts do what) and asking what does this do to Darius when he introduces them.
Logged
I thought I would I had never hear my daughter's escapades from some boy...
DAMN YOU RUMRUSHER!!!!!!!!
"body swapping and YOU!"
Adventure in baby making!Adv Homes

darkRenegade

  • Escaped Lunatic
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #442 on: October 28, 2011, 11:05:28 pm »

Hi, I'm new to Dwarf Fortress, and I read here: http://www.bay12forums.com/smf/index.php?topic=95060.0
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.
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #443 on: October 29, 2011, 12:26:22 am »

Hi, I'm new to Dwarf Fortress, and I read here: http://www.bay12forums.com/smf/index.php?topic=95060.0
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.
well 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.



*there ways to regain it's trust but It's to costly and I haven't perfected it yet.
Logged
I thought I would I had never hear my daughter's escapades from some boy...
DAMN YOU RUMRUSHER!!!!!!!!
"body swapping and YOU!"
Adventure in baby making!Adv Homes

darkRenegade

  • Escaped Lunatic
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #444 on: October 29, 2011, 12:46:18 am »

Wow, I didn't expect to get a reply so soon.
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?
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #445 on: October 29, 2011, 12:58:57 am »

Wow, I didn't expect to get a reply so soon.
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?
yes. Though good luck not getting caught in the cross fire of it's dragon breathe.
Logged
I thought I would I had never hear my daughter's escapades from some boy...
DAMN YOU RUMRUSHER!!!!!!!!
"body swapping and YOU!"
Adventure in baby making!Adv Homes

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #446 on: November 06, 2011, 06:13:48 pm »

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".

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #447 on: November 06, 2011, 06:21:14 pm »

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.
question which version of DF are you using?
Logged
I thought I would I had never hear my daughter's escapades from some boy...
DAMN YOU RUMRUSHER!!!!!!!!
"body swapping and YOU!"
Adventure in baby making!Adv Homes

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #448 on: November 06, 2011, 06:24:03 pm »

31.25

Taricus

  • Bay Watcher
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #449 on: November 06, 2011, 06:25:49 pm »

Is DF running when you use it? It needs DF actively running for it to access it.
Logged
Quote from: evictedSaint
We sided with the holocaust for a fucking +1 roll
Pages: 1 ... 28 29 [30] 31 32 ... 38