Bay 12 Games Forum

Please login or register.

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

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

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #495 on: December 31, 2011, 11:29:47 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.

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.
Well Dfusion does have access to creature flags and Creature civs so you could just make a function that does that for you.
now making a function that does that depends on if you want it to run always or on command.

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
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?
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 #496 on: December 31, 2011, 11:47:31 pm »

I do yes... Well I have only dabbled in lua. But I know how to open one up, And i've worked with a few programming languages.

I'm acaully interested in the "on command" feature, which Plugin.lua will I have to open and how to do the "On Command"?
Logged

IamanElfCollaborator

  • Bay Watcher
  • Resident Shipper God and Freyjapiller
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #497 on: January 01, 2012, 12:43:08 am »

I can open up the lua files, but sadly I am not even a dabbling lua programmer. Well, there's that solution. All I need to do now is make me a thieves den. :D

Yay, my own personal group of thieving kobolds who I can release to steal from the city at my own leisure.

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #498 on: January 01, 2012, 03:54:37 am »

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).
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 #499 on: January 01, 2012, 04:32:09 am »

Meh, I'll just take my pick from the normal batch of migrants, the ones for the original fort civ.

Rumrusher

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

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.
though if you mix this with getting non same race members into military you could have spiders, birdsmen, and minotaurs guarding the place while your kobolds nibble on bone safely.
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 #501 on: January 01, 2012, 04:59:13 am »

I know. Although, seeing as I'd rather the pissed-off city guard be able to invade their pathetic den, I'll just leave naked kobolds armed with training daggers to stand guard while I leave the back door wide open.

Hugo_The_Dwarf

  • Bay Watcher
  • Modding Mentor
    • View Profile
    • Regeneration: Forced Evolution
Re: DFusion - a lua based plugin system v3.8
« Reply #502 on: January 01, 2012, 11:59:48 am »

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

Maybe I will wait until I have mastered another 2-3 languages then start learning lua. I think what gets me is I have no idea how to properly hex edit or use offsets, best thing I've ever hex'd is the number of lives in a game or ammo. I've seen some crazy things modders have done with Hex editing for games that didn't allow third partie plugins or easy to edit core files.

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 :-/
Logged

darius

  • Bay Watcher
  • ^^
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #503 on: January 02, 2012, 01:26:59 am »

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 :-/

1. put it in whatever place it seems best.
2. don't use notepad. Use notepad++ (with syntax higlight) or (should work) wordpad.
Logged

IamanElfCollaborator

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

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?!

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #505 on: January 04, 2012, 12:12:12 pm »

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

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #506 on: January 04, 2012, 05:49:50 pm »

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.
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 #507 on: January 04, 2012, 07:05:36 pm »

It came out of a fire imp/dwarf marriage. He's considered a dwarf...but that still doesnt explain how he was even BORN:
Desc:


And his family screen:


Please explain to me how THAT happened.  :o

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #508 on: January 04, 2012, 07:31:15 pm »

His name is Asmel Wheelscalded, Fireimpborn.
Well looks like all my years of work on crossbreeding issues was slightly WRONG. all I needed to do is just waited for two races mingle a little longer.
he takes his natural race from the mother side that part of my research is true.
but does he take any bits from his father?
and does the fort have any other cross race relationships? my usually don't get to the point where they befriend any other races.

If you want to know when a dwarf woman is married they end up allowing themselves to breed. Now what the question I like to ask is how she find the fire imp attractive enough to get married and is she friends with other fire imps?
« Last Edit: January 04, 2012, 07:35:00 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 #509 on: January 04, 2012, 07:38:44 pm »

Most of my fort dwellers are friends with each other. I'm looking for more lovers/married couples.

He and his father both find it hard to form social relationships, they both are illiterates, and they both have poor kinesthetic ability. So, while he got no physical characteristics, he got his mental attributes.
Pages: 1 ... 32 33 [34] 35 36 ... 38