Petr Mrázek 2012-03-25 03:27:26 +02:00
commit def7e51564
6 changed files with 12 additions and 13 deletions

@ -11,5 +11,4 @@ SET_SOURCE_FILES_PROPERTIES( ${DFUSION_HS} PROPERTIES HEADER_FILE_ONLY TRUE )
DFHACK_PLUGIN(dfusion ${DFUSION_CPPS_ALL} ${DFUSION_HS} LINK_LIBRARIES lua dfhack-tinythread)
# installs into DF root
install(DIRECTORY luafiles/ DESTINATION dfusion)
install(FILES ../../library/include/df/codegen.out.xml DESTINATION dfusion/patterns/)
install(DIRECTORY luafiles/ DESTINATION dfusion)

@ -366,8 +366,8 @@ function findVectors()
end
function GetRaceToken(p) --actually gets token...
local vec=df.world.raws.creatures.all
return vec[p]:deref().creature_id
local vec=df.global.world.raws.creatures.all
return vec[p].creature_id
end
function BuildNameTable()
local rtbl={}

@ -2,8 +2,8 @@ if not(FILE) then
--sanity test
--print("race num:"..engine.peekw(offsets.getEx("CurrentRace")))
--print(string.format("%x vs %x",offsets.getEx("CurrentRace"),VersionInfo.getGroup("Creatures"):getAddress("current_race")))
print("Race num:"..df.ui.race_id)
print("Your current race is:"..GetRaceToken(df.ui.race_id))
print("Race num:"..df.global.ui.race_id)
print("Your current race is:"..GetRaceToken(df.global.ui.race_id))
print("If this is wrong please type 'q'")
if(getline()=='q') then
return

@ -47,7 +47,7 @@ function mainmenu(t1)
end
function RunSaved()
print("Locating saves...")
local str=df.world.cur_savegame.save_dir
local str=df.global.world.cur_savegame.save_dir
print("Current region:"..str)
str="data/save/"..str.."/dfusion/init.lua"
print("Trying to run:"..str)
@ -61,7 +61,7 @@ dofile("dfusion/editor.lua")
unlockDF()
plugins={}
table.insert(plugins,{"simple_embark","A simple embark dwarf count editor"})
table.insert(plugins,{"tools","some misc tools"})
--table.insert(plugins,{"tools","some misc tools"})
table.insert(plugins,{"embark","Multi race embark"})
table.insert(plugins,{"friendship","Multi race fort enabler"})
--[=[table.insert(plugins,{"items","A collection of item hacking tools"})
@ -73,8 +73,8 @@ table.insert(plugins,{"adv_tools","some tools for (mainly) advneturer hacking"})
table.insert(plugins,{"triggers","a function calling plug (discontinued...)"})
table.insert(plugins,{"migrants","multi race imigrations"})
--]=]
table.insert(plugins,{"onfunction","run lua on some df function"})
table.insert(plugins,{"editor","edit internals of df",EditDF})
--table.insert(plugins,{"onfunction","run lua on some df function"})
--table.insert(plugins,{"editor","edit internals of df",EditDF})
table.insert(plugins,{"saves","run current worlds's init.lua",RunSaved})
loadall(plugins)
dofile_silent("dfusion/initcustom.lua")

@ -13,4 +13,4 @@ WorldData : 0x1306148
Xpointer : 0x7347f0
vtableLegends : 0x6e7594
Buildings : 0x12C4DA8
StartDwarfs : 0x5A5170
StartDwarfs : 0x5DA790

@ -275,9 +275,9 @@ function tools.empregnate(unit)
local arr1=unit.appearance.unk_51c
local arr2=unit.appearance.unk_51c
local created=false
if unit.relations.pregnancy_ptr:tonumber()==0 then
if unit.relations.pregnancy_ptr == nil then
print("creating preg ptr.")
unit.relations.pregnancy_ptr:newref()
unit.relations.pregnancy_ptr=unit.relations:_field("pregnancy_ptr"):new()--=df.new(unit.relations.pregnancy_ptr._kind)
created=true
end
local tarr1=unit.relations.pregnancy_ptr:deref().anon_1