Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 31 32 [33] 34 35 ... 38

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

Tirion

  • Bay Watcher
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #480 on: December 10, 2011, 05:20:36 am »

By the X pointer, you mean [l]ook, or tal[k]? Both bring up an X.
Logged
"Fools dig for water, corpses, or gold. The earth's real treasure is far deeper."

IamanElfCollaborator

  • Bay Watcher
  • Resident Shipper God and Freyjapiller
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #481 on: December 10, 2011, 11:40:15 am »

Look.

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #482 on: December 10, 2011, 05:46:00 pm »

Look.
both actually even throw/fire works.

edit: here's my lever function for those dealing with wild animals, demons, bandits any thing that's not apart of your civ.
Code: [Select]
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


this goes to the flip switch called  Bfolder.
« Last Edit: December 12, 2011, 04:32:08 am by Rumrusher »
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

darius

  • Bay Watcher
  • ^^
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #483 on: December 12, 2011, 06:42:15 am »

Are there any lizard men in vanilla df? Also what other cool races are there?

Spoiler: next version (click to show/hide)
Logged

IamanElfCollaborator

  • Bay Watcher
  • Resident Shipper God and Freyjapiller
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #484 on: December 12, 2011, 10:38:48 am »

Nope. There are serpentmen and snake men.

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #485 on: December 12, 2011, 07:48:53 pm »

Code: [Select]
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.
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

Hugo_The_Dwarf

  • Bay Watcher
  • Modding Mentor
    • View Profile
    • Regeneration: Forced Evolution
Re: DFusion - a lua based plugin system v3.8
« Reply #486 on: December 25, 2011, 11:24:14 pm »

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

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #487 on: December 26, 2011, 06:40:44 am »

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.

Hugo_The_Dwarf

  • Bay Watcher
  • Modding Mentor
    • View Profile
    • Regeneration: Forced Evolution
Re: DFusion - a lua based plugin system v3.8
« Reply #488 on: December 26, 2011, 10:20:04 am »

for Friendship it works when I have

DWARFHUMAN

but fails when I put it as (cannot load module)

DWARF
HUMAN

Also I'm using Win 7 Pro SP1 just in case the OS is the main issue

but with the

DWARFHUMAN

I have no idea if it's acaully working or making some random creature up....

EDIT:
Ok now it just completely crapped out :/
 this is what happens if I place each race on seperate lines


And if I leave it on the same line I now (finally) get the error of "No such things as DAWRFHUMAN"

EDIT2:
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.
« Last Edit: December 26, 2011, 11:02:41 am by Hugo_The_Dwarf »
Logged

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #489 on: December 26, 2011, 03:40:54 pm »

EDIT2:
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.
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.

Hugo_The_Dwarf

  • Bay Watcher
  • Modding Mentor
    • View Profile
    • Regeneration: Forced Evolution
Re: DFusion - a lua based plugin system v3.8
« Reply #490 on: December 26, 2011, 04:43:32 pm »

I was making changes to the Races.txt while I was playing (always before I run Dfusion tho) Idk either it is kinda hit and miss here.
Logged

IamanElfCollaborator

  • Bay Watcher
  • Resident Shipper God and Freyjapiller
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #491 on: December 31, 2011, 04:09:30 am »

Also, when are multi-civ forts going to be possible? I was thinking of making a fort with three separate factions in it.

Hugo_The_Dwarf

  • Bay Watcher
  • Modding Mentor
    • View Profile
    • Regeneration: Forced Evolution
Re: DFusion - a lua based plugin system v3.8
« Reply #492 on: December 31, 2011, 12:30:39 pm »

I was going to try with that, but migrants are broken. DF crashes as soon as a migrant comes... Wait maybe its because I only have one DWARF entry doesn't DFusion freak out if the Migrant function only has one entry?

Anyways since I can't get the migrated other civs, I can't use friendship. I'll probally try with filling the races.txt with more entries and see if im just stupid
Logged

IamanElfCollaborator

  • Bay Watcher
  • Resident Shipper God and Freyjapiller
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #493 on: December 31, 2011, 09:00:03 pm »

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.

Hugo_The_Dwarf

  • Bay Watcher
  • Modding Mentor
    • View Profile
    • Regeneration: Forced Evolution
Re: DFusion - a lua based plugin system v3.8
« Reply #494 on: December 31, 2011, 10:15:16 pm »

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.
Logged
Pages: 1 ... 31 32 [33] 34 35 ... 38