Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 21 22 [23] 24 25 ... 38

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

darius

  • Bay Watcher
  • ^^
    • View Profile
Re: DFusion - a lua based plugin system v3.3
« Reply #330 on: June 16, 2011, 05:15:31 am »

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 box that 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?!
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v3.3
« Reply #331 on: June 16, 2011, 05:21:40 am »

by the time I said that I already found out what a few flags do,

17 poofs the item I guess this is how bogeymen go out.
18 don't know testing in arena
19 forbids items so rig this to a repeater and you can forbid eggs when they lay.
and good one
14 deals with if the item was made in the fort or not, so you can bump up fort value with goods far from the site.
oh and bees and vermin do count as Items so this command I had working on will run through those creatures as well.
Code: [Select]
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
end

I thought I cross out that sentence as means of "Oops spoke too soon on that"
I found that most of the items only take effect in Fort mode so my Adventure loving behind can't have real use for this unless I switch over to the mode.
I just had a cat turn roc lay 'Roccats' and you can't even see these things detail with out breaking the game(nothing new someone did this the hard way on this months ago)


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


by weird I mean when I use the zombie army on group of bandits with a -1 civ adventurer cause the bandits to drop hostilities and talk to me.
what I think caused this is when I hurt a creature more so a sentient with a wild(-1) adventurer in the spot that triggers the function (the upper right arm any damage to that spot causes the change or if the creature doesn't have that part will also change) which turns the creature into a zombie fully healed too. now I guess due to this the civ pulls 'a enemy of my enemy is my friend effect' due to the zombie is also aggro to every one thus the bandits will just attack their zombie buddy and lay off attacking you due to thinking " 'ey this bloke trin' to kill us hey adventure' we try kill' earlier let's team up and stop the Zomb' copolyse from befallin this area" might not work on wild life as those creatures treat zombies like elves.


edit: I didn't test if I could place eggs in any building(I should through) I just build 2 nest box one normal and the other not installed and had a dwarf place dwarf eggs made from a adventure reaction into them, so far didn't work , and didn't work once installed some how the box didn't count the items in the building but in the box made in the building so I need to stick the eggs in the nest.
which means I need to find a way to get the nest to take in a reaction that makes a dwarf put eggs into the nest or that having the item fall into the building on it's own if that doesn't work.

Other than that backward coding through the item menu and hoping for adding a pointer to this doesn't break it... through I wonder if there a possibility for a stack pointer so it gets all creatures/items in the spot and allows the developer to mess with, so one doesn't have to separate the creature, item from a stack to get at it.


E: fish this one out of Df-hack the second dash is the input for dfusion, I don't know if this works well but if creature flags work the same then so will this.
Code: [Select]
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


« Last Edit: June 16, 2011, 05:58:02 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.4
« Reply #332 on: June 16, 2011, 08:58:35 am »

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

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

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v3.4
« Reply #333 on: June 16, 2011, 09:10:57 am »

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

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)
hmm between this and giving weapons names is what people on the Adventure forum been asking.
well time to see if I can roughly add a selectobject and make every ones pants ignite. Also from fiddling around with flag 0 you can have the item in a person hand and on the floor, 22 can ignite Vermin... though they won't stay on fire once you throw them. and I haven't tested out the ability to stick items in buildings in adventure mode can be done. oh well here to Dwarven clone factories.


edit: I just found out that taking spider thread by removing all flags but the on ground one and turning it into a statue net you about 1,000 or more statues all in your hand. also I'm postponing sticking items in buildings.
testing if a player can set up traps using webbing and thread seeing how removing the flags of thread turn it to it's normal state.
« Last Edit: June 16, 2011, 10:13:50 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.4
« Reply #334 on: June 16, 2011, 11:19:14 am »

Hmm strange but armors use legends id as race index (for size) and submat2 as legends id.
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v3.4
« Reply #335 on: June 16, 2011, 06:46:59 pm »

found how to turn spider webs into threads by removing the flag 9 from the webbing.
through I don't know how to turn anything else into webbing.

edit: oh okay I'm noticing a slight issue here, I can't test to see which item has the in building flag using the editor due to the editor can't pick up the item in the building or on a person.

edit: remember how cage trapping a creature and moving the cage and attempting to use a pointer on it won't work.
well the same goes with pick up items and items used in buildings,  they all leave a hidden spot they where last used or originally on the ground.
which answer why I can't see the eggs.
  at least now I have a sweet burn weapons/anything the person wearing command.
Code: [Select]

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



edit: okay here the deal you can't hatch eggs in other buildings so no Cloning vat with cloning processing.
So the only way one can hatch eggs is to find ways to place the eggs into the NEST_BOX building.
« Last Edit: June 20, 2011, 06:01:49 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

Hugo_The_Dwarf

  • Bay Watcher
  • Modding Mentor
    • View Profile
    • Regeneration: Forced Evolution
Re: DFusion - a lua based plugin system v3.4
« Reply #336 on: July 02, 2011, 09:45:33 pm »

Following again. glad this is still going.
Logged

micha

  • Bay Watcher
    • View Profile
Re: DFusion - a lua based plugin system v3.4
« Reply #337 on: July 06, 2011, 08:13:14 am »

patterns2.lua seems to be missing from the zip at dffd making all the cool stuff unworkable. dang.
Logged

Iituem

  • Bay Watcher
    • View Profile
Re: DFusion - a lua based plugin system v3.4
« Reply #338 on: July 06, 2011, 04:19:52 pm »

Working on an old 40d fort.  Is there a version of DFusion that will work with 40d?
Logged
Let's Play Arcanum: Of Steamworks & Magic Obscura! - The adventures of Jack Hunt, gentleman rogue.

No slaughtering every man, woman and child we see just to teleport to the moon.

darius

  • Bay Watcher
  • ^^
    • View Profile
Re: DFusion - a lua based plugin system v3.4
« Reply #339 on: July 06, 2011, 06:52:07 pm »

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?

Sorry but i could only redirect you to Spellcraft mod (not as stable but more impresive and only for 40d) because a LOT has changed since 40d and it's hard to support one version.here Been a looong time since I tried it but it should work AFAIR
Edit2: looking back i found that it's only for 40d16 so not sure if you are using d16 or d18 or some other.

Edit: ok updated it to 3.5 with patterns2.lua included
« Last Edit: July 06, 2011, 07:15:40 pm by darius »
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v3.5
« Reply #340 on: July 06, 2011, 07:35:55 pm »

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?
« Last Edit: July 06, 2011, 07:58:58 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

darius

  • Bay Watcher
  • ^^
    • View Profile
Re: DFusion - a lua based plugin system v3.5
« Reply #341 on: July 06, 2011, 07:53:32 pm »

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?

First is a tricky one. For item to be placed in building it must be marked with a flag, build must have it in it's ref list, and item must have building in it's ref list AFAIK. Those ref lists are the tricky part. Also it's not enough (i think) for egg to be in building, it also must be actively hatched (someone sitting on top with a job or sth)

Second is less tricky and i'll look into it. I think it's a vector somewhere in creature that has all the item pointers, so some hacking there should be possible.

As for third one it's relatively easy. I'll look into it tomorrow. It's 4am here already :/
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v3.5
« Reply #342 on: July 06, 2011, 08:03:25 pm »

Sweet here comes setting up statues that spits corrosive acid and or breathes fire.
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

thatkid

  • Bay Watcher
  • <Servibot> thatkid, swag percentiles: 94
    • View Profile
Re: DFusion - a lua based plugin system v3.5
« Reply #343 on: July 06, 2011, 08:17:59 pm »

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?
Logged
Fame is a vapor. The only earthly certainty is oblivion.

darius

  • Bay Watcher
  • ^^
    • View Profile
Re: DFusion - a lua based plugin system v3.5
« Reply #344 on: July 07, 2011, 05:32:32 am »

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?

Could you run it from commandline with console wine and post the output here.

Edit: Updated DFusion to 3.6. Added material list and offset for it, pattern(token name only for now), decorations patterns, and item access that creature is wearing.
Spoiler: code (click to show/hide)
« Last Edit: July 07, 2011, 10:19:32 am by darius »
Logged
Pages: 1 ... 21 22 [23] 24 25 ... 38