Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 12 13 [14] 15 16 ... 38

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

darius

  • Bay Watcher
  • ^^
    • View Profile
Re: DFusion - a lua based plugin system v2.5
« Reply #195 on: February 16, 2011, 09:00:15 am »

oh Darius about the removing legend information I really don't know how to do that... or target different body parts so that creatures with syndrome can cause a conversion.

For legends:
Code: [Select]
engine.poke(creatureptr,ptr_Creature.legends,-1)
should work. As for second part, I don't quite understand what you mean...

It does not remove legends information per se, but it does remove the pointer to it. So for game it should look that creature has no legends info.
« Last Edit: February 16, 2011, 09:02:52 am by darius »
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v2.5
« Reply #196 on: February 16, 2011, 03:24:21 pm »

darn it I tried to update the latest version of Dfusion for 31.19 and none of the commands 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

Viken

  • Bay Watcher
  • "Fight, or Die. Easy."
    • View Profile
Re: DFusion - a lua based plugin system v2.5
« Reply #197 on: February 16, 2011, 04:55:52 pm »

The .19 update of DF is so big that all of the memory addresses and whatnot have probably been shunted to different memory areas.  Toady has added hundreds of new items, animals, jobs, workshops and changed how the game is even played in some cases.  Everyone will need time to work on making their mods and the like work properly.

That said, I have greatly enjoyed DFusion myself, and I hope that I'll be able to use it again with the new releases.
Logged
"It takes being a nerd to be a dorf, and I'm more than happy to compensate."

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v2.5
« Reply #198 on: February 17, 2011, 02:19:49 am »

oops I was too quick to say that all commands don't work.
I mean All Adv_tool commands don't work due to the code not finding the offset for AdvCreatureVec
every thing else from Embark any where to even Nano fort works. So I guess My theory on Toady does not change all his code and just adds on and alter the stuff that contradicts is true.
also I have good news the Hostility code in tools folder still works so if I could jerry wig the code for adventure mode I could make a temp replacement until the AdvCreatureVec code gets a update.
« Last Edit: February 17, 2011, 08:14:18 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 v2.5
« Reply #199 on: February 17, 2011, 01:52:18 pm »

Awesome not everything is broken :D now just to try to fix everything else...
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v2.5
« Reply #200 on: February 17, 2011, 02:32:15 pm »

Awesome not everything is broken :D now just to try to fix everything else...
oh man let me say
  • adv_tools and most of tools don't work mostly due to Legends, LegendsId and AdvCreatureVec keeps skipping
  • only Hostilities work rarely if you repeatly do the -f search with out having it abruptly end with out asking for the char race. I saved the offset it gave out so far.
  • embark everywhere, simple embark been tested to work
  • the site changer and site flag tweaker(which I really wish I knew what flag I was poking did what) don't work maybe due too the code not connected to a updating offset finder
  • Toady Update gave no signs of removing my Wagon code except for the fact I can't run it now
  • non Dfusion news Nano fort still works for 31.19
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.5
« Reply #201 on: February 17, 2011, 02:45:06 pm »

Need to make a test script that does all the testing in case of new version. That way at least i would know whats broken... Or invent an AI that does all the work instead of me. :D
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v2.5
« Reply #202 on: February 17, 2011, 03:43:03 pm »

so far I had an idea of using Hostility coding as a temp fix until AdvCreatureVec offset is working.
but tampering with the code for adventure swapping caused a crash in Dwarf fortress.
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.6
« Reply #203 on: February 17, 2011, 06:21:51 pm »

Ok. Tried to fix few(most) of errors. Good thing that they looked like easy fixes (except for legend id... it seems that the same vector is now used for lots of things and lots of creatures have stuff in it.)
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v2.6
« Reply #204 on: February 18, 2011, 06:28:08 pm »

hmm looks like 2.6 doesn't have the updated zombie revival code where the creatures limbs come back and won't crash the game. oh and Darius thanks for updating this for 31.19 I can at least continue testing properties, like making a hurt function where one could target a part of a creature body(hopefully I can rig this to the lycan revival from .18 so night creatures can have their own personal conversion) but I don't know how to target certain limbs the code for revival seem to be selecting all limbs and you kinda left no indication on how to select a creature limb?
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.6
« Reply #205 on: February 18, 2011, 07:35:28 pm »

To target specific limb you need to change only one value in vectors (hurt1,hurt2 and/or wounds). Which corresponds to which limb i don't know. E.g:
Code: [Select]
v2=engine.peek(vector:getval(indx),ptr_Creature.hurt1)
v2:setval(0,7) --remove zero-th limb or something... same with hurt2
Now i'm not really sure, i dont know what wounds vector does...
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v2.6
« Reply #206 on: February 18, 2011, 11:43:35 pm »

To target specific limb you need to change only one value in vectors (hurt1,hurt2 and/or wounds). Which corresponds to which limb i don't know. E.g:
Code: [Select]
v2=engine.peek(vector:getval(indx),ptr_Creature.hurt1)
v2:setval(0,7) --remove zero-th limb or something... same with hurt2
Now i'm not really sure, i dont know what wounds vector does...
sweet atleast now I can throw in an if to the Select functions
--some time before writing all that above
work in a hurt separate part into the code that uses user input from what I got the creatures body parts are counted +4 to the next body type... or that what I guess from testing on a horse.
though losing a head and a leg the thing still alive... must be the lack of blood and bleed codes.
Code: [Select]
function rum_tools.Hurtselected()
    --repeat
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
indx=GetCreatureAtPos(getxyz())
if indx<0 then return end
--print(string.format("%x",vector:getval(indx)))
v2=engine.peek(vector:getval(indx),ptr_Creature.hurt1)
v3=engine.peek(vector:getval(indx),ptr_Creature.hurt2)
v3.type=DWORD
print("select body part 0=upperbody,4=lowerbody,8=head,12=right front leg,16=left front leg,20=")
r=io.stdin:read()
print("select infliction")
d=io.stdin:read()
v2:setval(r,d)
v3:setval(r,d) --remove zero-th limb or something... same with hurt2
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

Brandon816

  • Bay Watcher
    • View Profile
Re: DFusion - a lua based plugin system v2.6
« Reply #207 on: February 26, 2011, 04:48:20 am »

This isn't a really important bug, but there is a redundancy in your code. In the file "common.lua", the method "GetCreatureAtPos(x,y,z)" isn't really using the "x,y,z" parameters. The first line of the method is "x,y,z=getxyz()". You should either remove that line, or have the method not take any parameters, so that "getxyz()" isn't being called twice for one use.
Logged

darius

  • Bay Watcher
  • ^^
    • View Profile
Re: DFusion - a lua based plugin system v2.7
« Reply #208 on: February 26, 2011, 06:12:25 am »

This isn't a really important bug, but there is a redundancy in your code. In the file "common.lua", the method "GetCreatureAtPos(x,y,z)" isn't really using the "x,y,z" parameters. The first line of the method is "x,y,z=getxyz()". You should either remove that line, or have the method not take any parameters, so that "getxyz()" isn't being called twice for one use.
Good catch. Fixed it and updated.
Also added teleportation to adv_tools as requested by rumrusher.
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v2.7
« Reply #209 on: February 26, 2011, 01:48:23 pm »

This isn't a really important bug, but there is a redundancy in your code. In the file "common.lua", the method "GetCreatureAtPos(x,y,z)" isn't really using the "x,y,z" parameters. The first line of the method is "x,y,z=getxyz()". You should either remove that line, or have the method not take any parameters, so that "getxyz()" isn't being called twice for one use.
Good catch. Fixed it and updated.
Also added teleportation to adv_tools as requested by rumrusher.
hmm so since the XYZ code is patch I might be able to get working on a Summon Teammates over to location.

[insert code for gotohell() and spawncomp() code here]
Code: [Select]
function rum_tools.butcher()
--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:flip(49) -- 49 is slaughter flag.
--flg:set(1,0) -- alive
--flg:set(13,1) -- skeleton

engine.poke(vector:getval(indx),ptr_Creature.flags,flg) --save flags
end
a butcher any creature code for those who want to snuff human caravans or nobles under the knife.
best make a slab for them so they won't go ghosting for revenge, but then removing the said ghost flag would work also.
« Last Edit: February 26, 2011, 03:46:42 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
Pages: 1 ... 12 13 [14] 15 16 ... 38