Bay 12 Games Forum

Please login or register.

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

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

Kaelem Gaen

  • Bay Watcher
  • And then it appeared the most terrifying creature
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #405 on: August 11, 2011, 02:01:03 am »

So has he not released the official Plugin-version for DF Hack,  I'm honestly stumped as to how I use DFusion as a plugin for DFhack.

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #406 on: August 11, 2011, 05:47:08 am »

Beats me looks like they originally was talking about doing so and progress on it was only mention during a pm I got from asking a question.
I guess Warmist will make an official announcement later.
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 #407 on: August 11, 2011, 11:02:56 am »

Oh warmist I got a question I'm having trouble with getting a site to be change due to the dfusion doesn't recognize SCALE as a word and Dfusion can't search for sites by one word.
The issue here is from attempting to change a elven resort over to a hamlet so I can steal their princess for my fort.

Strange- maybe DF has no word SCALE? As not searching by one word: there is no reason why it should not work with one word (i.e. i used it a few times with only one word)

So has he not released the official Plugin-version for DF Hack,  I'm honestly stumped as to how I use DFusion as a plugin for DFhack.

You need to build DFHack from github. That needs Microsoft Visual C (i use 2010 maybe older would work too) and CMAKE. For more exact instructions see build instructions in www.github.com/peterix/dfhack or www.github.com/warmist/dfhack . Also you need minimal experience with version control. OR you could wait till peterix (or me) makes a some sort of release (i heard him talking about it, dfhack will include a lot of usefull tool, including stonesense)

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #408 on: August 11, 2011, 11:22:35 am »

or fish I guess from looking back at the ".18 version" of Dfusion I notice that the line where the offset was was moved to a function that might not pull all the words or maybe doesn't search for any part of the word and just looks if the person matches the name fully. this causes an issue with words like FISH in Chapelfish or SCALE in Dellscaly. Getting the one word searches to work might save me issues on the second word not registering as a word in Dfusion.
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 #409 on: August 15, 2011, 02:16:51 am »

Just a heads up: peterix released new (age) DFHack here with integrated dfusion.

I think i will start a new thread for that. Note that that version will be preferred to this in future development. Main reasons: cross-platform, faster (lookups in same program are way faster), multiple versions supported (depends on Memory.xml included with dfhack, e.g. friendship already uses memory.xml so theoretically it should work both with older versions and linux (although linux build failed for some reason) ). Access to memory.xml means that we can edit anything (and everything ;) ) that dfhack people could.

Changes that need to be noted:
  • No more automatic plugin detection- you will need to update init.lua adding a line f
  • As noted before friendship (and some other places) use memory.xml. Currently API is a bit clumsy but i'll write a nice wrapper or something
  • Also there is some wrappers around dfhack
  • There is even less documentation (for now)
  • Everything* dfusion does is now compatible with everything* dfhack does (including friendship+stonesense )
  • Reads and writes (peeks and pokes) are now not safe- original dfusion failed a read and returned 0 now it crashes DF :(
Everything*- means that some things (very very rare) could make do something bad.
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #410 on: August 15, 2011, 03:54:20 am »

Dfusion Freezing the game going to have some issues with my Carry command where it needs the game running to work.
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 #411 on: August 15, 2011, 03:56:30 am »

Yeah that is one thing i forgot to note... You could try writing it in OnTick e.g.:
Code: [Select]
function OnTick()
  DoCarry()
end

Although ticks are rare (as not to lag too much) but it should work. I'm also thinking about making some sort of unsafe mode that it would not freeze DF (although that probably would result in crash)
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #412 on: August 15, 2011, 04:55:24 am »

wait a minute why is it that the list shows only "g"s?
that the first time seeing OnTick before. Does this replace the "repeat until commands" or do I have to insert the function as a call to like so?
Code: [Select]
Docarry(rum_tools.carry)
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 #413 on: August 15, 2011, 05:27:59 am »

wait a minute why is it that the list shows only "g"s?
that the first time seeing OnTick before. Does this replace the "repeat until commands" or do I have to insert the function as a call to like so?
Code: [Select]
Docarry(rum_tools.carry)
"g" is a bug (currently have no idea why... could be something with lua lib)
And OnTick does replace in some sense the repeat until commands, that is OnTick is called every N milllisecs. So you would write:
Code: [Select]
function rum_tools.carry()
-- some questions maybe?
--some settup
OnTick=function ()
-- do stuff what is written here every "tick"
end
end
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #414 on: August 15, 2011, 06:28:31 am »

Okay two things one kinda got it to work, but it's giving me the error of a pattern.lua issue of attempt to index global 'bit' (giving a nil value).
so here's the Git version of a simple carry command
Code: [Select]
function rum_tools.Gitcarry()
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
indx=GetCreatureAtPos(getxyz())
print("grabbing person")
OnTick=function () 
flg=engine.peek(vector:getval(0),ptr_Creature.flags)
flg2=engine.peek(vector:getval(indx),ptr_Creature.flags)
enty=engine.peek(vector:getval(0),ptr_Creature.y)+1
entx=engine.peek(vector:getval(0),ptr_Creature.x)
move=engine.peek(vector:getval(0),ptr_Creature.z)
engine.poke(vector:getval(indx),ptr_Creature.z,move)
engine.poke(vector:getval(indx),ptr_Creature.x,entx)
engine.poke(vector:getval(indx),ptr_Creature.y,enty)
if flg:get(15) ==true or flg2:get(1) ==true then
end
end
end
the issue of using this is you can't let go of the target and the game is slow.
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

martinuzz

  • Bay Watcher
  • High dwarf
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #415 on: August 19, 2011, 04:30:41 am »

When and how exactly should I use simple embark? I got to the prepare for the journey carefully screen, but when I use simple embark, nothing happens, there's no prompt asking me for the required number of dwarves or something like that.
Logged
Friendly and polite reminder for optimists: Hope is a finite resource

We can ­disagree and still love each other, ­unless your disagreement is rooted in my oppression and denial of my humanity and right to exist - James Baldwin

http://www.bay12forums.com/smf/index.php?topic=73719.msg1830479#msg1830479

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #416 on: August 19, 2011, 04:47:11 am »

When and how exactly should I use simple embark? I got to the prepare for the journey carefully screen, but when I use simple embark, nothing happens, there's no prompt asking me for the required number of dwarves or something like that.
before you embark, there no prompt but you can still enter the number oh and the number has to be above 7 or else the game will crash.
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 #417 on: August 19, 2011, 12:32:39 pm »

Good news: fixed both 'g' letters (somehow concat- ".." operator is not working correctly) and dfusion stopping DF (had to remove ontick, but if somebody uses it i can put it back)

To get it: either use my fork of dfhack or wait for peterix to make a release.
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #418 on: August 19, 2011, 02:52:15 pm »

I don't know if any one had found a work around with Ontick really, kinda like the idea of making game modes for dwarf fortress.
Kinda need to dive into Items and learn up creature cover in syndrome calls so I can make a venom that changes the race of a dwarf to a Queen to set up nice scenarios where players have to look out for Queens hiding among their fortress and make sure they don't go and build a nest box or the "what ever the race name is" soon over breed and crush a person's FPS.
To do this I have to write up the raws of the race make sure the race match the dwarf race enough so that players don't end up crashing the game and
program a function where the game constantly or periodically checks if any dwarf was covered in the syndrome and check if any of the creature's eggs has been layed for fast hatching and more Chaos.
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

mstram

  • Bay Watcher
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #419 on: September 28, 2011, 01:51:57 pm »

Hi Guys,

I just found this thread and haven't read through it yet, but am wondering if it's possible to use dfusion (or if there is some other tool(s) available) to :

1) Display the linked item(s) to a selected lever / pressure plate ... anything "linkable" ... mechanical

and

2) Would be great to be able to trace triggered actions :

"Door '#27' (or whatever the internal id is) has responded (opened / closed) after <dwarf name> stepped on / pulled the lever ... etc  at  <time>"

2a) Even terse debug output would be great

Item Id#    Type      Action          target(s)
---------      -----       -------         ----------
001            presPad  triggered           door #001,  hatch#003 .... etc


This would be great for exploring the machine area of DF, as the game itself seems to have little or no tools like the above.

Mike
Logged
Pages: 1 ... 26 27 [28] 29 30 ... 38