Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 17 18 [19] 20 21 ... 38

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

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v2.9
« Reply #270 on: April 14, 2011, 09:39:44 pm »

I feel like I am missing some obvious step. How exactly do you run DFusion?

I have a fresh un-modded 31.25 version of DF
I click DfFusion and a box pops up

DfFusion.exe - Application Error
The application failed to initialize properly (0x0150002), Click on OK to terminate the application.
do you have a xp x64? because that the same issue I have on my "new" PC.
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

Brisk

  • Bay Watcher
    • View Profile
Re: DFusion - a lua based plugin system v2.9
« Reply #271 on: April 14, 2011, 10:22:54 pm »

I feel like I am missing some obvious step. How exactly do you run DFusion?

I have a fresh un-modded 31.25 version of DF
I click DfFusion and a box pops up

DfFusion.exe - Application Error
The application failed to initialize properly (0x0150002), Click on OK to terminate the application.
do you have a xp x64? because that the same issue I have on my "new" PC.

No. I do have Windows XP Professional but the 32 bit version.
Logged

darius

  • Bay Watcher
  • ^^
    • View Profile
Re: DFusion - a lua based plugin system v2.9
« Reply #272 on: April 15, 2011, 12:10:10 am »

 ??? quick googling showed me that its most probably some dll i'm not including. I'll try to find it when i get home. Till then you could try using http://www.dependencywalker.com/ and searching in the internet to find missing dlls.
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v2.9
« Reply #273 on: April 15, 2011, 01:27:06 am »

with the rise of Dfmode having a adventure transfer code would help those who don't want to fiddle around in Runesmith or the off chance runesmith is out dated again.
Code: [Select]
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
function rum_tools.fortcomps()
local trgs=selectcomp()
for k,v in pairs(trgs) do
--indx=GetCreatureAtPos(v)
--indx=engine.peek(v,ptr_creature.ID)
print("Companion:"..k)
local flags=engine.peek(v,ptr_Creature.flags)
flags:set(1,false) -- alive!
flags:set(51,false) -- remove the is resident flag on companions
flags:set(47,false) -- something todo with wounds- lets you walk again.
engine.poke(v,ptr_Creature.flags,flags)
end
end

function rum_tools.fortdy()
--first three lines same as before (because we will need an offset of creature at location x,y,z)
myoff=offsets.getEx("AdvCreatureVec")

vector=engine.peek(myoff,ptr_vector)
indx=GetCreatureAtPos(getxyz())
--indx=0
--print(string.format("%x",vector:getval(indx)))
flg=engine.peek(vector:getval(indx),ptr_Creature.flags) --get flags
flg:set(51,false) -- 76 is ghostliness flag.
--flg:set(1,0) -- alive
--flg:set(13,1) -- skeleton

engine.poke(vector:getval(indx),ptr_Creature.flags,flg) --save flags
end

I have a modified hostile function to make different Civ Adventurers match up with the current site civ number
Code: [Select]
function rum_tools.Fortilate()
vector=engine.peek(offsets.getEx("CreatureVec"),ptr_vector)
id=engine.peekd(offsets.getEx("CreaturePtr"))
print(string.format("Vec:%d cr:%d",vector:size(),id))
off=vector:getval(id)
crciv=engine.peek(off,ptr_Creature.civ)
curciv=engine.peekd(offsets.getEx("CurrentRace")-12)

if curciv==crciv then
print("Friendly")
--engine.poke(off,ptr_Creature.civ,curciv)
flg=engine.peek(off,ptr_Creature.flags)
flg:set(17,false)
engine.poke(off,ptr_Creature.flags,flg)
else
print("Enemy or Adventurer- making friendly")
engine.poke(off,ptr_Creature.civ,curciv)
flg=engine.peek(off,ptr_Creature.flags)
flg:set(17,false)
flg:set(19,false)
engine.poke(off,ptr_Creature.flags,flg)
end
end
.
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 v2.9
« Reply #274 on: April 15, 2011, 04:54:14 pm »

Ok probably it's MSVCR80.DLL that is neede by lua.dll (i hate this windows dependancy mess) i might try recompiling lua.dll or just integrating it. Till then either install microsoft visual c redistribute (not sure witch version) or just google for this file.
Logged

Brisk

  • Bay Watcher
    • View Profile
Re: DFusion - a lua based plugin system v2.9
« Reply #275 on: April 15, 2011, 05:31:37 pm »

Ok probably it's MSVCR80.DLL that is neede by lua.dll (i hate this windows dependancy mess) i might try recompiling lua.dll or just integrating it. Till then either install microsoft visual c redistribute (not sure witch version) or just google for this file.

I used the dependency program to find and install the following .dll
msvcr80
ieshims
wer
mpr
ncrypt
bcrypt

then I tried installing microsoft visual c redistribute 2010

still no dice. just to check I downloaded DFusion onto an older machine. It is Windows XP home edition. worked like a charm no problem.

*sigh*
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v2.9
« Reply #276 on: April 16, 2011, 12:36:29 am »

man working on a make civ members follow function and boy it making my head thump. if I perfect this code users could be able to mass recruit their entire fort in adventure mode then raid other forts.
though doing so now would be for either striking human settlements or taking down megabeasts.
which I can't see right now.... well mostly due to the horrible fact that I still haven't got a single adventurer to tie the knot and push out babies.

edit: here is a untested Rough Draft of the Selecting Fort members and the turning Fort members into simple Companions that and the ability to remove Is resident to all members with the same civ number you have. reclaiming a fort may lead to some issues with the game changing the Civ number but at least we figured out how to make past members work now.
Code: [Select]

function selectciv()
  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(1)==false then]]--  --if dead ...
        table.insert(retvec,off)--... add it to return vector
     end
  end
  return retvec --return the "return vector" :)
end

function rum_tools.returnfort()
--this should select and remove is resident from fort
myoff=offsets.getEx("AdvCreatureVec")
local trgs=selectciv()
for k,v in pairs(trgs) do
--vector=engine.peek(myoff,ptr_vector)
--indx=GetCreatureAtPos(getxyz())
--indx=0
--print(string.format("%x",vector:getval(indx)))
flg=engine.peek(v,ptr_Creature.flags) --get flags
flg:set(51,false) -- 76 is ghostliness flag.
--flg:set(1,0) -- alive
--flg:set(13,1) -- skeleton

engine.poke(v,ptr_Creature.flags,flg) --save flags
end

function rum_tools.civFollow()
--first three lines same as before (because we will need an offset of creature at location x,y,z)
myoff=offsets.getEx("AdvCreatureVec")
local trgs=selectciv()
for k,v in pairs(trgs) do

print(string.format("current creature:%x",k))
trgid=engine.peek(vector:getval(0),ptr_Creature.ID)
engine.peek(v,ptr_Creature.followID) --get players ID
--[[lfollow=engine.peek(v,ptr_Creature.followID) -- get target creatures "now following ID"
if lfollow ~=0xFFFFFFFF then --if its set]]--
engine.poke(v,ptr_Creature.followID,trgid) -- if not just write the players ID.
end
end
« Last Edit: April 16, 2011, 04:22:53 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

Cardinal

  • Bay Watcher
    • View Profile
Re: DFusion - a lua based plugin system v2.9
« Reply #277 on: April 17, 2011, 09:29:48 pm »

Tried to use this to change a site type but no matter what I type into the search parameter, I never get a site to change.  Am I supposed to do this while in Dwarf Mode, Adventure Mode, Embark??  I just want to make a player-controlled mountain hall into a not-player controlled (abandoned, though, I'm not trying to retire a fort, yet).  Can somebody walk me through this?  A very slow, very detailed, suitable for children kind of walkthrough would be the best kind.
Logged
Engraved is an image of a Human and a video game. The Human is making a plaintive gesture.

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v2.9
« Reply #278 on: April 18, 2011, 12:48:28 am »

Tried to use this to change a site type but no matter what I type into the search parameter, I never get a site to change.  Am I supposed to do this while in Dwarf Mode, Adventure Mode, Embark??  I just want to make a player-controlled mountain hall into a not-player controlled (abandoned, though, I'm not trying to retire a fort, yet).  Can somebody walk me through this?  A very slow, very detailed, suitable for children kind of walkthrough would be the best kind.
one we need to know your pc specs and which DF version you have this could be a case of outdated site offset(oh and you can use Site changer in any mode even legends). I'm really confused in your suggestion as langdon retiring turns a players fort(what it's called in Site changer) into non playable Mountain halls. though I guess your in a fort now and want another player site converted. well I'll tell you this doing so will wipe all work on the fort and leave nothing but a empty flat plane.
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 v2.9
« Reply #279 on: April 18, 2011, 10:39:10 am »

I'm using DF .25 on Win7 with the latest DFusion.  I didn't realize changing the site type would wipe out the fortress.  I thought it would just change the way it was treated when you were looking at it from the map (that it couldn't be reclaimed).  I wanted to change a player fort into a mountain halls (so it couldn't be reclaimed) but I didn't want to wipe out the fort.

If there's another way to set up an abandoned player fort so that it is no longer available to be reclaimed, I'd be happy to do it that way.
Logged
Engraved is an image of a Human and a video game. The Human is making a plaintive gesture.

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v2.9
« Reply #280 on: April 18, 2011, 12:17:45 pm »

I'm using DF .25 on Win7 with the latest DFusion.  I didn't realize changing the site type would wipe out the fortress.  I thought it would just change the way it was treated when you were looking at it from the map (that it couldn't be reclaimed).  I wanted to change a player fort into a mountain halls (so it couldn't be reclaimed) but I didn't want to wipe out the fort.

If there's another way to set up an abandoned player fort so that it is no longer available to be reclaimed, I'd be happy to do it that way.
simple you have to retire an adventurer/fort pull up a dummy one walk over to the site switch to fort mode then murder the adventurer using a utility then switch back into adventure mode. then end the game. you will then have to just remember not to REclaim the site next time but will be known as a mountain home.
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 v2.9
« Reply #281 on: April 18, 2011, 02:13:55 pm »

simple you have to retire an adventurer/fort pull up a dummy one walk over to the site switch to fort mode then murder the adventurer using a utility then switch back into adventure mode. then end the game. you will then have to just remember not to REclaim the site next time but will be known as a mountain home.

Could you be a little more detailed about this?  Specifically:

When you say I need to retire an adventurer/fort, what do you mean?  and "pull up a dummy one" does that mean a new fort or new adventurer?

When you say I walk over to the site, does that mean that I should run DFusion when I have an adventurer standing at the site which I want to change-type for?

How do I switch to fort mode from adventure mode?  DFHack?

Is the site still going to show up on the reclaim list?  That's one of the things I wanted to avoid.  If someone tries to reclaim it, does that mean it'll crash DF?

I appreciate all the effort you guys have put into this, but some decent tutorials would help immensely on using DFusion.

Logged
Engraved is an image of a Human and a video game. The Human is making a plaintive gesture.

darius

  • Bay Watcher
  • ^^
    • View Profile
Re: DFusion - a lua based plugin system v2.9
« Reply #282 on: April 18, 2011, 02:55:55 pm »

Quote
I appreciate all the effort you guys have put into this, but some decent tutorials would help immensely on using DFusion.

Hehe... this was originally intended as a programmers tool to make something more user-friendly later. This however never moved on to the user-friendliness. I guess a gui would help a lot?..

Rumrusher: your signature link is broken.

Also what helps debuggin:
Code: [Select]
-- import debug -- not sure if needed
print(debug.traceback())

this shows a stack trace (in theory... would be more useful if called on error...)
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v2.9
« Reply #283 on: April 18, 2011, 06:46:38 pm »

Quote
I appreciate all the effort you guys have put into this, but some decent tutorials would help immensely on using DFusion.

Hehe... this was originally intended as a programmers tool to make something more user-friendly later. This however never moved on to the user-friendliness. I guess a gui would help a lot?..

Rumrusher: your signature link is broken.

Also what helps debuggin:
Code: [Select]
-- import debug -- not sure if needed
print(debug.traceback())

this shows a stack trace (in theory... would be more useful if called on error...)
programmer's tool it is. I made just about 30 different commands and functions for this thing from temp controlling zombies, companions, to making a makeshift grab command for dragging companions, friendlies, enemies across areas that they can't path through. I have to say thanks Darius for getting me into Df hacking.
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 v2.9
« Reply #284 on: April 18, 2011, 08:23:26 pm »

programmer's tool it is. I made just about 30 different commands and functions for this thing from temp controlling zombies, companions, to making a makeshift grab command for dragging companions, friendlies, enemies across areas that they can't path through. I have to say thanks Darius for getting me into Df hacking.

And it looks like a great tool!  Alright, let's start simply:

1.  Where should I be in the game when I open up DFusion and select option 7 (tools), sub-option 6 (site type).  Should I be in adventure mode?  Fortress mode?  Should I be in adventure mode at the site in question?  Assume I have just abandoned my fortress and I'd like to change its site type (or fix items or whatever else is available in option 7).

2.  When the tool prompts me with "Type words that are in the site name, FULLCAPS..." should I be typing in the a substring of the site name, the full name, its translated name or what?

I know if may seem tedious to explain this to a schlomo, but I promise I'll use it for good.
Logged
Engraved is an image of a Human and a video game. The Human is making a plaintive gesture.
Pages: 1 ... 17 18 [19] 20 21 ... 38