Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 34 35 [36] 37 38

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

IamanElfCollaborator

  • Bay Watcher
  • Resident Shipper God and Freyjapiller
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #525 on: January 05, 2012, 07:40:38 pm »

Depressing?

Losing is fun.

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #526 on: January 05, 2012, 07:48:40 pm »

I haven't played DF in a while. I remember the last time I used this mod, it was to resurrect my slain adventurer.

Unfortunately, the enemies simply killed me every time I was brought back to life.

It was depressing.
you should have flip on Ghost mode first before finishing the revival.
that way you can safely walk a good distance away from spawn killers.

Wait so is this migrants only or do stolen folks work also?

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.
her name was Olon Toolpalaces but this was back when toady one didn't include race detailing.
« Last Edit: January 05, 2012, 08:10:16 pm 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

IamanElfCollaborator

  • Bay Watcher
  • Resident Shipper God and Freyjapiller
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #527 on: January 05, 2012, 08:27:21 pm »

I must have more halfbreeds....

I at least found a way to display mental characteristics. DT.

IamanElfCollaborator

  • Bay Watcher
  • Resident Shipper God and Freyjapiller
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #528 on: January 05, 2012, 10:04:01 pm »

I must petition you for a gender change mode. That way, !!SCIENCE!! using half-breeds in fort mode can be more easily conducted.

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #529 on: January 06, 2012, 03:44:23 am »

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

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #530 on: January 06, 2012, 04:14:34 am »

Damn this is getting messier by the second... Need some way to track versions, do documentations, add user made code... Also tracking wishes would be nice.

Reudh

  • Bay Watcher
  • Perge scelus mihi diem perficias.
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #531 on: January 06, 2012, 05:31:51 am »

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 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
« Last Edit: January 06, 2012, 05:34:44 am by Reudh »
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #532 on: January 06, 2012, 07:50:07 am »

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
Code: [Select]
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,
then take the tools.menu:add line and insert it into the bottom set of coding in the tools's plugin.lua.
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

Reudh

  • Bay Watcher
  • Perge scelus mihi diem perficias.
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #533 on: January 06, 2012, 08:00:26 am »

Thanks Rumrusher.

Now I'm off to test it.

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #534 on: January 06, 2012, 08:30:06 am »

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)

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #535 on: January 06, 2012, 10:01:28 am »

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

IamanElfCollaborator

  • Bay Watcher
  • Resident Shipper God and Freyjapiller
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #536 on: January 07, 2012, 04:19:57 am »

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.

!!SCIENCE!! TO BE DONE!

Reudh

  • Bay Watcher
  • Perge scelus mihi diem perficias.
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #537 on: January 07, 2012, 05:39:38 am »

Ah, Rumrusher, it simply doesn't appear. My lua knowledge is scant, but does --end mean 'end of file' as opposed to 'end of code snippet'?

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #538 on: January 07, 2012, 01:58:24 pm »

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.

!!SCIENCE!! TO BE DONE!
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?
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

Cardinal

  • Bay Watcher
    • View Profile
Re: DFusion - a lua based plugin system (integrated into DFHack)
« Reply #539 on: January 08, 2012, 04:22:51 pm »

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.

Also, is this all going to be significantly screwed up by the new release?
Logged
Engraved is an image of a Human and a video game. The Human is making a plaintive gesture.
Pages: 1 ... 34 35 [36] 37 38