Bay 12 Games Forum

Please login or register.

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

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

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v2.5
« Reply #180 on: February 07, 2011, 04:58:19 pm »

lol I was changing adventures and i set the cursor in the wrong spot now I'm in HFS and a Clown  :o
 Edit: every time i sleep and travel i end up as a diffrent creature now i'm a plump helmet man...
yeah best way out of that jam is to find some one that is historic like a lady or a townsmen and perma adv change into them or kill thing to make what ever body your in added to the legends and you won't jump around when you Travel.

okay time to dump.
rez companions, lycan rez, a repeating zombie function so players don't need to select it over again, and Companion race changer so one can mass convert a bunch of humans into Cave spiders.
Code: [Select]
function selectcomp()
  local retvec={} --return vector (or a list)
  myoff=offsets.getEx("AdvCreatureVec")
  vector=engine.peek(myoff+16,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 adv_tools.comprace()
--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+16,ptr_vector)
--indx=GetCreatureAtPos(getxyz())
local trgs=selectcomp()
for k,v in pairs(trgs) do
--RaceTable=RaceTable or BuildNameTable() --slow.If loaded don't load again
--print("Enter race name ALL CAPS!:")
--repeat
entry=io.stdin:read() --get entry
--id=RaceTable[entry] -- find race id
--until id~=nil -- if not found repeat
engine.poke(v,ptr_Creature.race,entry)
end

end

function adv_tools.lycanressurect()
repeat
local trgs=selectall()
for k,v in pairs(trgs) do
--indx=GetCreatureAtPos(v)
--indx=engine.peek(v,ptr_creature.ID)
print("Werewolf:"..k)
v2=engine.peek(v,ptr_Creature.hurt1)
for i=0,v2:size()-1 do
v2:setval(i,0)
end
v2=engine.peek(v,ptr_Creature.hurt2)
v2.type=DWORD
for i=0,v2:size()-1 do
v2:setval(i,0)
end

engine.peek(v,ptr_Creature.civ)
engine.poke(v,ptr_Creature.civ,-1)
engine.poke(v,ptr_Creature.bloodlvl,60000) --give blood
engine.poke(v,ptr_Creature.bleedlvl,24) --stop some bleeding...
local flags=engine.peek(v,ptr_Creature.flags)
flags:set(1,0) -- alive!
flags:set(12,0) --zombie
flags:set(17,1)
flags:set(19,1)
engine.poke(v,ptr_Creature.flags,flags)
engine.poke(v,ptr_Creature.race,151)
end
until r==7
end

function adv_tools.ressurectcomp()
local trgs=selectcomp()
for k,v in pairs(trgs) do
--indx=GetCreatureAtPos(v)
--indx=engine.peek(v,ptr_creature.ID)
print("Companion:"..k)
v2=engine.peek(v,ptr_Creature.hurt1)
for i=0,v2:size()-1 do
v2:setval(i,0)
end
v2=engine.peek(v,ptr_Creature.hurt2)
v2.type=DWORD
for i=0,v2:size()-1 do
v2:setval(i,0)
end
engine.poke(v,ptr_Creature.bloodlvl,60000) --give blood
engine.poke(v,ptr_Creature.bleedlvl,0) --stop some bleeding...
local flags=engine.peek(v,ptr_Creature.flags)
flags:set(1,0) -- alive!
flags:set(39,0) -- leave body yet again
flags:set(37,0) -- something todo with wounds- lets you walk again.
engine.poke(v,ptr_Creature.flags,flags)
end
end

so far killing a creature twice will cause the killer's legend data to be buggy and will cause a crash if unless you don't have them as a companion and or didn't rekill something. so I wonder if one could remove the creature from legend mode?

« Last Edit: February 12, 2011, 02:46:24 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 v2.5
« Reply #181 on: February 12, 2011, 05:42:18 pm »

You could try editing its legend id (e.g. setting it to 0 or -1 or something like that) then killing then restoring.
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v2.5
« Reply #182 on: February 12, 2011, 09:59:18 pm »

You could try editing its legend id (e.g. setting it to 0 or -1 or something like that) then killing then restoring.
hmm so I have to code in the revival to have this legend remove first before killing, I might go test that oh one thing about the hurt pattern in creature is there a way one could select different parts of the body to be affected? I ask so that I could see to making a death requirement function where if someone dies/wounded a certain way (which will be able to be trigger by syndromes) they will be turn.
I figure if Deon gave his vampiress, werewolves, lost adventurers, face huggers syndromes that will effect a creature body part(or parts) this will trigger the coded "if requirement" to add the victim to the list of that infected and convert the poor fellow into one of the beast(or burst from their chest). The only set back to this is that whole Race changed creatures end up crashing the game if they are wounded.
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

Deviled

  • Bay Watcher
  • Yup
    • View Profile
Re: DFusion - a lua based plugin system v2.5
« Reply #183 on: February 12, 2011, 10:21:27 pm »

I can't get this to run.
Logged

darius

  • Bay Watcher
  • ^^
    • View Profile
Re: DFusion - a lua based plugin system v2.5
« Reply #184 on: February 13, 2011, 06:56:35 am »

I can't get this to run.
what did you try?
Logged

Deviled

  • Bay Watcher
  • Yup
    • View Profile
Re: DFusion - a lua based plugin system v2.5
« Reply #185 on: February 13, 2011, 10:25:34 am »

I can't get this to run.
what did you try?
I mean when I open it it basecly closes imedetly.
Logged

darius

  • Bay Watcher
  • ^^
    • View Profile
Re: DFusion - a lua based plugin system v2.5
« Reply #186 on: February 13, 2011, 10:32:29 am »

Create a new file called whatever.bat and paste this:
Code: [Select]
DFfusion.exe
pause
then save, run and type what is reported.
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v2.5
« Reply #187 on: February 13, 2011, 11:15:05 am »

do you have do you have Dwarf fortress running? it automatically closes when that happens.
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

Deviled

  • Bay Watcher
  • Yup
    • View Profile
Re: DFusion - a lua based plugin system v2.5
« Reply #188 on: February 13, 2011, 12:56:31 pm »

do you have do you have Dwarf fortress running? it automatically closes when that happens.
Yes
Create a new file called whatever.bat and paste this:
Code: [Select]
DFfusion.exe
pause
then save, run and type what is reported.
I just tryed this and the same thing happens, it opens the immediately closes.
« Last Edit: February 13, 2011, 01:03:56 pm by Deviled »
Logged

darius

  • Bay Watcher
  • ^^
    • View Profile
Re: DFusion - a lua based plugin system v2.5
« Reply #189 on: February 13, 2011, 02:02:56 pm »

hmm... try this then:
Code: [Select]
DFfusion.exe>log.txt
inside test.bat. Run test.bat and then paste log.txt
Logged

Deviled

  • Bay Watcher
  • Yup
    • View Profile
Re: DFusion - a lua based plugin system v2.5
« Reply #190 on: February 13, 2011, 03:09:19 pm »

hmm... try this then:
Code: [Select]
DFfusion.exe>log.txt
inside test.bat. Run test.bat and then paste log.txt
Wheres test.bat
Logged

darius

  • Bay Watcher
  • ^^
    • View Profile
Re: DFusion - a lua based plugin system v2.5
« Reply #191 on: February 13, 2011, 04:13:05 pm »

eh...
here. put it in the same folder as DFfusion.exe. Run, paste what log.txt contains.
Logged

Deviled

  • Bay Watcher
  • Yup
    • View Profile
Re: DFusion - a lua based plugin system v2.5
« Reply #192 on: February 13, 2011, 05:48:00 pm »

Same thing, Should I have DfFusion.exe and dwarf fortress in the same folder?
Logged

darius

  • Bay Watcher
  • ^^
    • View Profile
Re: DFusion - a lua based plugin system v2.5
« Reply #193 on: February 14, 2011, 11:35:08 am »

Hmm... this is puzzling. No you don't need to put in the same directory. Try running with admin rights if on windows 7 or vista.
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v2.5
« Reply #194 on: February 16, 2011, 08:51:44 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.
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 ... 11 12 [13] 14 15 ... 38