Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2 3

Author Topic: DFusion - a dfhack plugin for who knows what...  (Read 21259 times)

Warmist

  • Bay Watcher
    • View Profile
DFusion - a dfhack plugin for who knows what...
« on: September 17, 2011, 10:16:17 am »

Those who know Dfusion - this is a DFHack plugin version.
All discussion, bug reports and questions regarding it can be posted here.

Get it from here: Pre built binary courtesy of peterix or build it yourself from my fork of dfhack (sometimes more buggy)
A WIP wiki page: here
A wrapper (that does all the heavy lifting) help : here by angavrilov

Todo list:
  • Write a short general hacking tutorial
  • Think of a way to make a lua script repository (for anyone to post code, suggestion very welcome)

WARNING: dfusion is going to be changed a lot. (e.g. moving everything to scripts) This is to better integrate into dfhack and thus DF.
« Last Edit: September 26, 2012, 12:20:02 am by Warmist »
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a dfhack plugin for writing lua plugins.
« Reply #1 on: September 17, 2011, 11:43:20 am »

well kinda found this one out right after asking you but I had to dump the entire function in the on function to get it to work.
so far the the command will convert others fine just that it can only work if someone is dead.
Code: [Select]
function selecthuman2()
  local retvec={} --return vector (or a list)
  myoff=offsets.getEx("AdvCreatureVec")
  RaceTable=RaceTable or BuildNameTable()
  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 id=engine.peek(off,ptr_Creature.race)
     local v2=engine.peek(off,ptr_Creature.hurt1)
     ra=RaceTable["HUMAN"]
     ra2=RaceTable["KEEPER"]
     ra3=RaceTable["NORD"]
     if id==ra3 and v2:getval(32)>=1 or id==ra2 and v2:getval(32)>=1 or id==ra and v2:getval(32)>=1 then
        table.insert(retvec,off)--... add it to return vector
     end
  end
  return retvec --return the "return vector" :)
end
function lycanressurecttest()
RaceTable=RaceTable or BuildNameTable() --slow.If loaded don't load again
--repeat
local trgs=selecthuman2()
for k,v in pairs(trgs) do
--indx=GetCreatureAtPos(v)
--indx=engine.peek(v,ptr_creature.ID)
--local trgs=selectwolf()
--for t,z in pairs(trgs) do
id2=RaceTable["KEEP"] -- find race id
engine.poke(v,ptr_Creature.race,id2)
print("Infected:"..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,false) -- alive!
flags:set(12,false) --zombie
flags:set(17,true)
flags:set(19,true)]]--
--end
end
--until k==2
end
onfunction.SetCallback("Die",lycanressurecttest)
the race I tested this on are called the Keep which pretty much an a mix of Keeper and Xen infector who has a bile that burst all over the victim and if the victim an Keeper they will turn into a low level Keep for genesis

Code: [Select]
[CREATURE:KEEP]
[DESCRIPTION:Keep are an old race dedicated to knowledge protection of their hive. They craft fine weapons and armor and they have developed a specific chivalry to others except their prey. Their towns often have big marketplaces and various shops. Many of keeps are well-known adventurers, sages and bards.]
[NAME:keep:keeps:keep]
[CASTE_NAME:keepe:keepes:keepe]
[CREATURE_TILE:'U'][COLOR:7:0:1]
[CREATURE_SOLDIER_TILE:154]

[INTELLIGENT]
[VIEWRANGE:28]
[CANOPENDOORS]
[BENIGN]
[PREFSTRING:adventurousness]
[PREFSTRING:chivalry]
[PREFSTRING:lore]
[PREFSTRING:wisdom]
[PREFSTRING:dedication to history]
--sounds.. loudness/distance (squares), commonnness (1000 for alarm, 10k peaceful).
[SOUND:ALERT:50:1200:VOCALIZATION:shout:shouts:a warcry]
[SOUND:PEACEFUL_INTERMITTENT:45:80000:VOCALIZATION:shout:shouts:a shout] --very rare but long-distance
[SOUND:PEACEFUL_INTERMITTENT:25:180000:VOCALIZATION:ponder the futility of it all:looks very sad:insane gibbering in the distance] --very rare
[SOUND:PEACEFUL_INTERMITTENT:20:27000:VOCALIZATION:sneeze:sneezes:a sneeze]
[SOUND:PEACEFUL_INTERMITTENT:7:25000:VOCALIZATION:burp:burps:a manly burp]
[SOUND:PEACEFUL_INTERMITTENT:7:18000:VOCALIZATION:spit:spits:somebody spitting]
[SOUND:PEACEFUL_INTERMITTENT:15:9500:VOCALIZATION:talk:talks:conversation]
[SOUND:PEACEFUL_INTERMITTENT:13:24000:VOCALIZATION:pray:prays:a prayer]
[SOUND:PEACEFUL_INTERMITTENT:4:16000:VOCALIZATION:sigh:sighs:a sigh] --shortest distance/loudness
[SOUND:PEACEFUL_INTERMITTENT:16:17000:VOCALIZATION:swear:swears:somebody swearing]
[SOUND:PEACEFUL_INTERMITTENT:11:19000:VOCALIZATION:mutter:mutters:somebody muttering]
[SOUND:PEACEFUL_INTERMITTENT:8:18000:VOCALIZATION:grunt:grunts:a grunt]
[SOUND:PEACEFUL_INTERMITTENT:6:15000:VOCALIZATION:cough:coughs:a quiet cough]

[CASTE:MALE]
[MALE]
[BODY:HUMANOID:2EYES:2EARS:NOSE:2LUNGS:HEART:GUTS:ORGANS:HUMANOID_JOINTS:THROAT:NECK:SPINE:BRAIN:SKULL:5FINGERS:5TOES:MOUTH:FACIAL_FEATURES:TEETH:RIBCAGE:MALEGEN_PROTECTED]
[CASTE:SCROPIO]
[BODY:SPIDER:2EYES:HEART:GUTS:BRAIN:TAIL:TAIL_STINGER:UPPERBODY_PINCERS]
[CASTE:FEMALE]
[FEMALE]
[LAYS_EGGS]
[EGG_MATERIAL:LOCAL_CREATURE_MAT:EGGSHELL:SOLID]
[EGG_MATERIAL:LOCAL_CREATURE_MAT:EGG_WHITE:LIQUID]
[EGG_MATERIAL:LOCAL_CREATURE_MAT:EGG_YOLK:LIQUID]
[EGG_SIZE:25]
[CLUTCH_SIZE:15:25]
[BODY:HUMANOID:2EYES:2EARS:NOSE:2LUNGS:HEART:GUTS:ORGANS:HUMANOID_JOINTS:THROAT:NECK:SPINE:BRAIN:SKULL:5FINGERS:5TOES:MOUTH:FACIAL_FEATURES:TEETH:RIBCAGE:FEMALEGEN_PROTECTED:2BREASTS_PROTECTED]

[CASTE:INFECTOR]
[MALE]
[CASTE_NAME:keep infector:keep infectors:keep infector]
[DESCRIPTION:(Size 50-200, insectoid) This Keep specie looks like an oversized maggot with human features. Its thick carapace covers a bloated body which is too heavy to walk, so infectors have to curl into a ball and roll around. Four tentacles protrude from the sides, always in motion.    Infectors are terrifying species consisting of mutilated and deformed beings. They implant larvae in their prey which devour their soul and transform the body, turning the victim in another Keep individual. They possess a hive instinct and any individual is ready to die to serve a whole Keep group.]
[MULTIPLE_LITTER_RARE]
[BODY:INSECT:FOUR_CLAWLESS_TENTACLES:2EYES_FACET:E_2ANTENNAE:BRAIN:2LUNGS:HEART:GUTS:ORGANS:MOUTH:LARGE_MANDIBLES]
[USE_MATERIAL_TEMPLATE:BILE:CREATURE_EXTRACT_TEMPLATE]
[STATE_NAME:ALL_SOLID:frozen bile]
[STATE_NAME_ADJ:ALL_SOLID:frozen bile]
[STATE_NAME:LIQUID:bile]
[STATE_NAME_ADJ:LIQUID:bile]
[STATE_NAME:GAS:boiling bile]
[STATE_NAME_ADJ:GAS:boiling bile]
[STATE_COLOR:ALL:YELLOW]
[PREFIX:NONE]
[SYNDROME]
[SYN_NAME:xen infection]
[SYN_AFFECTED_CLASS:GENERAL_POISON]
[SYN_INHALED][SYN_CONTACT]
[CE_COUGH_BLOOD:SEV:1000:PROB:100:RESISTABLE:SIZE_DILUTES:START:5:PEAK:100:END:1000]
[TISSUE:BILE]
[TISSUE_NAME:bile:bile]
[TISSUE_MATERIAL:LOCAL_CREATURE_MAT:BILE]
[TISSUE_MAT_STATE:LIQUID]
[RELATIVE_THICKNESS:5]
[TISSUE_LEAKS]
[TISSUE_SHAPE:LAYER]
[BODY_DETAIL_PLAN:CHITIN_MATERIALS]
[BODY_DETAIL_PLAN:CHITIN_TISSUES]
[BODY_DETAIL_PLAN:STANDARD_HEAD_POSITIONS]
[BODY_DETAIL_PLAN:EXOSKELETON_TISSUE_LAYERS:CHITIN:MUSCLE:BILE]
[USE_MATERIAL_TEMPLATE:SINEW:SINEW_TEMPLATE]
[TENDONS:LOCAL_CREATURE_MAT:SINEW:200]
[LIGAMENTS:LOCAL_CREATURE_MAT:SINEW:200]
[HAS_NERVES]
[SELECT_TISSUE_LAYER:HEART:BY_CATEGORY:HEART]
[TL_MAJOR_ARTERIES]
[USE_MATERIAL_TEMPLATE:ICHOR:ICHOR_TEMPLATE]
[BLOOD:LOCAL_CREATURE_MAT:ICHOR:LIQUID]
[USE_MATERIAL_TEMPLATE:PUS:PUS_TEMPLATE]
[PUS:LOCAL_CREATURE_MAT:PUS:LIQUID]

[CREATURE_CLASS:GENERAL_POISON]
[GETS_WOUND_INFECTIONS]
[GETS_INFECTIONS_FROM_ROT]

[BODY_SIZE:0:0:500]
[BODY_SIZE:1:0:50000]
[BODY_SIZE:5:0:200000]
[BODY_APPEARANCE_MODIFIER:BROADNESS:75:95:98:100:102:105:125]
[APP_MOD_IMPORTANCE:500]

[NOPAIN][NOSTUN][NOEMOTION][NOFEAR]
[LIKES_FIGHTING]

[MAXAGE:80:100]

[MATERIAL_BREATH_ATTACK:LOCAL_CREATURE_MAT:BILE:TRAILING_GAS_FLOW]

[ATTACK:BITE:BODYPART:BY_CATEGORY:MANDIBLE]
[ATTACK_SKILL:BITE]
[ATTACK_VELOCITY_MODIFIER:500]
[ATTACK_VERB:bite:bites]
[ATTACK_CONTACT_PERC:100]
[ATTACK_PENETRATION_PERC:100]
[ATTACK_FLAG_EDGE]
[ATTACK_PRIORITY:MAIN]
[ATTACK_FLAG_CANLATCH]

[NATURAL_SKILL:WRESTLING:4]
[NATURAL_SKILL:DODGING:3]
[NATURAL_SKILL:BITE:4]

[HOMEOTHERM:10050]
[SWIMS_INNATE][SWIM_SPEED:2500]

[SELECT_CASTE:ALL]
[BODY_DETAIL_PLAN:THINSKIN_MATERIALS]
[BODY_DETAIL_PLAN:STANDARD_TISSUES]
[BODY_DETAIL_PLAN:VERTEBRATE_TISSUE_LAYERS:SKIN:FAT:MUSCLE:BONE:CARTILAGE]
[BODY_DETAIL_PLAN:HEAD_HAIR_TISSUE_LAYERS]
[USE_TISSUE_TEMPLATE:EYEBROW:EYEBROW_TEMPLATE]
[TISSUE_LAYER:BY_CATEGORY:HEAD:EYEBROW:ABOVE:BY_CATEGORY:EYE]
[USE_TISSUE_TEMPLATE:EYELASH:EYELASH_TEMPLATE]
[TISSUE_LAYER:BY_CATEGORY:EYELID:EYELASH:FRONT]
[USE_MATERIAL_TEMPLATE:NAIL:NAIL_TEMPLATE]
[USE_TISSUE_TEMPLATE:NAIL:NAIL_TEMPLATE]
[TISSUE_LAYER:BY_CATEGORY:FINGER:NAIL:FRONT]
[TISSUE_LAYER:BY_CATEGORY:TOE:NAIL:FRONT]
[SELECT_TISSUE_LAYER:HEART:BY_CATEGORY:HEART]
[PLUS_TISSUE_LAYER:SKIN:BY_CATEGORY:THROAT]
[TL_MAJOR_ARTERIES]
[BODY_DETAIL_PLAN:FACIAL_HAIR_TISSUES]
[BODY_DETAIL_PLAN:STANDARD_HEAD_POSITIONS]
[BODY_DETAIL_PLAN:HUMANOID_HEAD_POSITIONS]
[BODY_DETAIL_PLAN:HUMANOID_RIBCAGE_POSITIONS]
[BODY_DETAIL_PLAN:HUMANOID_RELSIZES]
[USE_MATERIAL_TEMPLATE:SINEW:SINEW_TEMPLATE]
[TENDONS:LOCAL_CREATURE_MAT:SINEW:200]
[LIGAMENTS:LOCAL_CREATURE_MAT:SINEW:200]
[HAS_NERVES]
[USE_MATERIAL_TEMPLATE:BLOOD:BLOOD_TEMPLATE]
[BLOOD:LOCAL_CREATURE_MAT:BLOOD:LIQUID]
[CREATURE_CLASS:GENERAL_POISON]
[GETS_WOUND_INFECTIONS]
[GETS_INFECTIONS_FROM_ROT]
[USE_MATERIAL_TEMPLATE:PUS:PUS_TEMPLATE]
[PUS:LOCAL_CREATURE_MAT:PUS:LIQUID]
[BODY_SIZE:0:0:4000]
[BODY_SIZE:1:168:17500]
[BODY_SIZE:12:0:70000]
[BODY_APPEARANCE_MODIFIER:HEIGHT:75:95:98:100:102:105:125]
[APP_MOD_IMPORTANCE:500]
[BODY_APPEARANCE_MODIFIER:BROADNESS:75:95:98:100:102:105:125]
[APP_MOD_IMPORTANCE:500]
[SET_BP_GROUP:BY_CATEGORY:EYE]
[BP_APPEARANCE_MODIFIER:CLOSE_SET:0:70:90:100:110:130:200]
[APP_MOD_NOUN:eyes:PLURAL]
[BP_APPEARANCE_MODIFIER:DEEP_SET:0:70:90:100:110:130:200]
[APP_MOD_NOUN:eyes:PLURAL]
[BP_APPEARANCE_MODIFIER:ROUND_VS_NARROW:0:50:70:85:95:100:110]
[APP_MOD_NOUN:eyes:PLURAL]
[BP_APPEARANCE_MODIFIER:LARGE_IRIS:25:70:90:100:110:130:200]
[APP_MOD_NOUN:eyes:PLURAL]
[SET_BP_GROUP:BY_CATEGORY:LIP]
[BP_APPEARANCE_MODIFIER:THICKNESS:50:70:90:100:110:130:200]
[APP_MOD_NOUN:lips:PLURAL]
[SET_BP_GROUP:BY_CATEGORY:NOSE]
[BP_APPEARANCE_MODIFIER:BROADNESS:25:70:90:100:110:130:200]
[BP_APPEARANCE_MODIFIER:LENGTH:25:70:90:100:110:130:200]
[BP_APPEARANCE_MODIFIER:UPTURNED:0:70:90:100:110:130:200]
[BP_APPEARANCE_MODIFIER:CONVEX:0:70:90:100:110:130:200]
[APP_MOD_NOUN:nose bridge:SINGULAR]
[SET_BP_GROUP:BY_CATEGORY:EAR]
[BP_APPEARANCE_MODIFIER:SPLAYED_OUT:0:70:90:100:110:130:200]
[APP_MOD_NOUN:ears:PLURAL]
[BP_APPEARANCE_MODIFIER:HANGING_LOBES:0:70:90:100:110:130:200]
[APP_MOD_NOUN:ears:PLURAL]
[BP_APPEARANCE_MODIFIER:BROADNESS:90:95:98:100:102:105:110]
[APP_MOD_IMPORTANCE:700]
[APP_MOD_NOUN:ears:PLURAL]
[BP_APPEARANCE_MODIFIER:HEIGHT:90:95:98:100:102:105:110]
[APP_MOD_IMPORTANCE:700]
[APP_MOD_NOUN:ears:PLURAL]
[SET_BP_GROUP:BY_CATEGORY:TOOTH]
[BP_APPEARANCE_MODIFIER:GAPS:0:40:50:60:70:100:110]
[APP_MOD_NOUN:teeth:PLURAL]
[SET_BP_GROUP:BY_CATEGORY:SKULL]
[BP_APPEARANCE_MODIFIER:HIGH_CHEEKBONES:0:70:90:100:110:130:200]
[BP_APPEARANCE_MODIFIER:BROAD_CHIN:0:70:90:100:110:130:200]
[BP_APPEARANCE_MODIFIER:JUTTING_CHIN:0:70:90:100:110:130:200]
[BP_APPEARANCE_MODIFIER:SQUARE_CHIN:0:70:90:100:110:130:200]
[SET_BP_GROUP:BY_CATEGORY:THROAT]
[BP_APPEARANCE_MODIFIER:DEEP_VOICE:0:70:90:100:110:130:200]
[BP_APPEARANCE_MODIFIER:RASPY_VOICE:0:70:90:100:110:130:200]
[SET_BP_GROUP:BY_CATEGORY:HEAD]
[BP_APPEARANCE_MODIFIER:BROADNESS:90:95:98:100:102:105:110]
[APP_MOD_IMPORTANCE:700]
[BP_APPEARANCE_MODIFIER:HEIGHT:90:95:98:100:102:105:110]
[APP_MOD_IMPORTANCE:700]
[MAXAGE:40:85]
[ATTACK:PUNCH:BODYPART:BY_TYPE:GRASP]
[ATTACK_SKILL:GRASP_STRIKE]
[ATTACK_VERB:punch:punches]
[ATTACK_CONTACT_PERC:100]
[ATTACK_FLAG_WITH]
[ATTACK_PRIORITY:MAIN]
[ATTACK:KICK:BODYPART:BY_TYPE:STANCE]
[ATTACK_SKILL:STANCE_STRIKE]
[ATTACK_VERB:kick:kicks]
[ATTACK_CONTACT_PERC:100]
[ATTACK_FLAG_WITH]
[ATTACK_PRIORITY:SECOND]
[ATTACK:SCRATCH:CHILD_TISSUE_LAYER_GROUP:BY_TYPE:GRASP:BY_CATEGORY:FINGER:NAIL]
[ATTACK_SKILL:GRASP_STRIKE]
[ATTACK_VERB:scratch:scratches]
[ATTACK_CONTACT_PERC:100]
[ATTACK_PENETRATION_PERC:30]
[ATTACK_FLAG_EDGE]
[ATTACK_PRIORITY:SECOND]
[ATTACK:BITE:CHILD_BODYPART_GROUP:BY_CATEGORY:HEAD:BY_CATEGORY:TOOTH]
[ATTACK_SKILL:BITE]
[ATTACK_VERB:bite:bites]
[ATTACK_CONTACT_PERC:100]
[ATTACK_PENETRATION_PERC:100]
[ATTACK_FLAG_EDGE]
[ATTACK_PRIORITY:SECOND]
[SPECIALATTACK_INJECT_EXTRACT:LOCAL_CREATURE_MAT:POISON:LIQUID:100:100]
--ATTACK_FLAG_CANLATCH] --do not rip limbs off with teeth!
[EQUIPS]
[DIURNAL]
--PROFESSION_NAME:HAMMERMAN:paladin:paladins]
--PROFESSION_NAME:MASTER_HAMMERMAN:holy warrior:holy warriors]
--PROFESSION_NAME:MACEMAN:templar:templars]
--PROFESSION_NAME:MASTER_MACEMAN:high templar:high templars]
--PROFESSION_NAME:SWORDSMAN:knight:knights]
--PROFESSION_NAME:MASTER_SWORDSMAN:champion:champions]
--PROFESSION_NAME:CROSSBOWMAN:witchhunter:witchhunters]
--PROFESSION_NAME:MASTER_CROSSBOWMAN:inquisitor:inquisitors]
--PROFESSION_NAME:BOWMAN:yeoman:yeomen]
--PROFESSION_NAME:MASTER_BOWMAN:marksman:marksmen]
[PROFESSION_NAME:LASHER:halberdier:halberdiers]
[PROFESSION_NAME:MASTER_LASHER:elite halberdier:elite halberdiers]
[HOMEOTHERM:10067]
[SWIMS_LEARNED][SWIM_SPEED:2500]
[MANNERISM_FINGERS:finger:fingers]
[MANNERISM_NOSE:nose]
[MANNERISM_EAR:ear]
[MANNERISM_HEAD:head]
[MANNERISM_EYES:eyes]
[MANNERISM_MOUTH:mouth]
[MANNERISM_HAIR:hair]
[MANNERISM_KNUCKLES:knuckles]
[MANNERISM_LIPS:lips]
[MANNERISM_CHEEK:cheek]
[MANNERISM_NAILS:nails]
[MANNERISM_FEET:feet]
[MANNERISM_ARMS:arms]
[MANNERISM_HANDS:hands]
[MANNERISM_TONGUE:tongue]
[MANNERISM_LEG:leg]
[MANNERISM_LAUGH]
[MANNERISM_SMILE]
[MANNERISM_WALK]
[MANNERISM_SIT]
[MANNERISM_BREATH]
[MANNERISM_POSTURE]
[MANNERISM_STRETCH]
[MANNERISM_EYELIDS]

[SPOUSE_CONVERSION_TARGET]

[MUNDANE]
[SELECT_CASTE:INFECTOR]
[SET_TL_GROUP:BY_CATEGORY:ALL:CHITIN]
[TL_COLOR_MODIFIER:GRAY:1]
[TLCM_NOUN:carapace:SINGULAR]
[TL_COLOR_MODIFIER:BLACK:1]
[TLCM_NOUN:carapace:SINGULAR]
[TLCM_TIMING:ROOT:3:0:5:1]
[SET_TL_GROUP:BY_CATEGORY:EYE:EYE]
[TL_COLOR_MODIFIER:RED:1]
[TLCM_NOUN:eyes:PLURAL]
[SELECT_CASTE:FEMALE]
[PHYS_ATT_RANGE:AGILITY:450:950:1150:1250:1350:1550:2250]
[SELECT_CASTE:MALE]
[BODY_DETAIL_PLAN:FACIAL_HAIR_TISSUE_LAYERS]
[CASTE_SPEECH:human_male.txt]
[PHYS_ATT_RANGE:STRENGTH:450:950:1150:1250:1350:1550:2250]
[SELECT_CASTE:ALL]
[SET_TL_GROUP:BY_CATEGORY:HEAD:HAIR]
[PLUS_TL_GROUP:BY_CATEGORY:HEAD:CHEEK_WHISKERS]
[PLUS_TL_GROUP:BY_CATEGORY:HEAD:CHIN_WHISKERS]
[PLUS_TL_GROUP:BY_CATEGORY:HEAD:MOUSTACHE]
[PLUS_TL_GROUP:BY_CATEGORY:HEAD:SIDEBURNS]
[PLUS_TL_GROUP:BY_CATEGORY:HEAD:EYEBROW]
[PLUS_TL_GROUP:BY_CATEGORY:HEAD:EYELASH]
[TL_COLOR_MODIFIER:DARK_BROWN:1:BLACK:1:BROWN:1:SEPIA:1:CHARCOAL:1:CHOCOLATE:1]
[TLCM_NOUN:hair:SINGULAR]
[TL_COLOR_MODIFIER:GRAY:1]
[TLCM_NOUN:hair:SINGULAR]
[TLCM_TIMING:ROOT:40:0:70:0]
[TL_COLOR_MODIFIER:WHITE:1]
[TLCM_NOUN:hair:SINGULAR]
[TLCM_TIMING:ROOT:70:0:90:0]
[SET_TL_GROUP:BY_CATEGORY:HEAD:EYEBROW]
[TISSUE_LAYER_APPEARANCE_MODIFIER:LENGTH:50:80:90:100:110:120:150]
[APP_MOD_NOUN:eyebrows:PLURAL]
[TISSUE_LAYER_APPEARANCE_MODIFIER:DENSE:50:80:90:100:110:120:150]
[APP_MOD_NOUN:eyebrows:PLURAL]
[TISSUE_LAYER_APPEARANCE_MODIFIER:HIGH_POSITION:0:70:90:100:110:130:200]
[APP_MOD_NOUN:eyebrows:PLURAL]
[SET_TL_GROUP:BY_CATEGORY:HEAD:EYELASH]
[TISSUE_LAYER_APPEARANCE_MODIFIER:LENGTH:50:80:90:100:110:120:150]
[APP_MOD_NOUN:eyelashes:PLURAL]
[SET_TL_GROUP:BY_CATEGORY:HEAD:HAIR]
[PLUS_TL_GROUP:BY_CATEGORY:HEAD:CHEEK_WHISKERS]
[PLUS_TL_GROUP:BY_CATEGORY:HEAD:CHIN_WHISKERS]
[PLUS_TL_GROUP:BY_CATEGORY:HEAD:MOUSTACHE]
[PLUS_TL_GROUP:BY_CATEGORY:HEAD:SIDEBURNS]
[TISSUE_LAYER_APPEARANCE_MODIFIER:LENGTH:0:0:0:0:0:0:0]
[APP_MOD_NOUN:hair:SINGULAR]
[APP_MOD_RATE:1:DAILY:0:1000:0:0:NO_END]
[TISSUE_LAYER_APPEARANCE_MODIFIER:CURLY:0:70:90:100:110:130:200]
[APP_MOD_NOUN:hair:SINGULAR]
[TISSUE_LAYER_APPEARANCE_MODIFIER:GREASY:0:70:90:100:110:130:200]
[APP_MOD_NOUN:hair:SINGULAR]
[TISSUE_LAYER_APPEARANCE_MODIFIER:DENSE:50:80:90:100:110:120:150]
[APP_MOD_NOUN:hair:SINGULAR]
[SET_TL_GROUP:BY_CATEGORY:HEAD:HAIR]
[TISSUE_STYLE_UNIT:HAIR:STANDARD_HAIR_SHAPINGS]
[TSU_NOUN:hair:SINGULAR]
[SET_TL_GROUP:BY_CATEGORY:HEAD:CHEEK_WHISKERS]
[PLUS_TL_GROUP:BY_CATEGORY:HEAD:CHIN_WHISKERS]
[TISSUE_STYLE_UNIT:BEARD:STANDARD_BEARD_SHAPINGS]
[TSU_NOUN:beard:SINGULAR]
[SET_TL_GROUP:BY_CATEGORY:HEAD:MOUSTACHE]
[TISSUE_STYLE_UNIT:MOUSTACHE:STANDARD_MOUSTACHE_SHAPINGS]
[TSU_NOUN:moustache:SINGULAR]
[SET_TL_GROUP:BY_CATEGORY:HEAD:SIDEBURNS]
[TISSUE_STYLE_UNIT:SIDEBURNS:STANDARD_SIDEBURNS_SHAPINGS]
[TSU_NOUN:sideburns:PLURAL]
[SET_TL_GROUP:BY_CATEGORY:ALL:SKIN]
[TL_COLOR_MODIFIER:PEACH:1:DARK_PEACH:1:BEIGE:1:PALE_PINK:1:TAN:1]
[TLCM_NOUN:skin:SINGULAR]
[TISSUE_LAYER_APPEARANCE_MODIFIER:WRINKLY:0:0:0:0:0:0:0]
[APP_MOD_RATE:1:YEARLY:0:100:30:0:NO_END]
[APP_MOD_NOUN:skin:SINGULAR]
[SET_TL_GROUP:BY_CATEGORY:EYE:EYE]
[TL_COLOR_MODIFIER:IRIS_EYE_AQUAMARINE:1:IRIS_EYE_AZURE:1:IRIS_EYE_GREEN:1:IRIS_EYE_BLUE:1:IRIS_EYE_DARK_BLUE:1:IRIS_EYE_BROWN:1:IRIS_EYE_DARK_GREEN:1:IRIS_EYE_EMERALD:1:IRIS_EYE_FERN_GREEN:1:IRIS_EYE_GRAY:1:IRIS_EYE_LIGHT_BLUE:1:IRIS_EYE_LIGHT_BROWN:1:IRIS_EYE_MIDNIGHT_BLUE:1]
[TLCM_NOUN:eyes:PLURAL]
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
    • View Profile
Re: DFusion - a dfhack plugin for writing lua plugins.
« Reply #2 on: September 17, 2011, 05:33:12 pm »

After some tinkering I made a this to res anything that dies:
Code: [Select]

function resall(values)
for k,v in pairs(restbl) do
adv_tools.res(v) --this here is from new version, but esentially this is all resurrect code in one function
end
restbl={}
onfunction.SetCallback("Move",nil)
end
function respls(values)
restbl=restbl or {}
table.insert(restbl,values[onfunction.hints["Die"].creature])
onfunction.SetCallback("Move",resall)
end
onfunction.SetCallback("Die",respls)

Some how the "death" is a very complex thing, so first we add a creature to the list (there we could check it's race) and only after some time (move is a bad function but don't have any other yet) ressurect all. Works very nicely :)

Edit: if you just set it to be alive it crashes. Also flags fixed in repository.
« Last Edit: September 17, 2011, 05:41:53 pm by Warmist »
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a dfhack plugin for writing lua plugins.
« Reply #3 on: September 17, 2011, 10:01:56 pm »

 so is it if you set it alive with out reviving the needed body parts it crashes?

oh well I think my code works nice if I want to make a infecting bomb race where the infected if killed coats the nearby victims and the process starts again.
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
    • View Profile
Re: DFusion - a dfhack plugin for writing lua plugins.
« Reply #4 on: March 15, 2012, 08:35:30 pm »

*thread necromancy*

I just wanted to say DFusion is not dead (although so much changed that i would want to change the name ;) ). New version is currently veryly borked but already has epic features.
Remember how it used to be "easy" to access and change stuff?
stuff like:
Code: [Select]
local name=engine.peek(vector:getval(i),ptt_dfstring):getval()
well now it's more:
Code: [Select]
local name=df.world.units.all[0]:deref().name.first_name
--or
local mycreature=df.world.units.all[0]:deref()
mycreature.name.first_name="Warmist"

This not only simplifies all hacking, but also makes it automatically update most* of dfusion with new version at the same time as DFHack. This is only possible thanks to DFHack team.

Edit: i'll be trying to quick update core of dfusion release it, then start working on code hacking plugins.
Logged

Warmist

  • Bay Watcher
    • View Profile
Re: DFusion - a dfhack plugin for writing lua plugins.
« Reply #5 on: March 17, 2012, 07:35:40 pm »

A bump and some new info:
I updated friendship (my most sucessfull thing to date: it works, and needs least maintenance :D ) embark and simple embark. Also added new tool: editor.
It lets you edit almost anything there is to DF. Currently it's a bit clumsy, and will crash your DF (sometimes) but you can navigate inside DF and tweak much of the stuff (from simple stuff like windows_x coordinate to complex like world->units->all->3->name->nickname )

So have fun.
Logged

Tabithda

  • Bay Watcher
  • Syete'eka
    • View Profile
Re: DFusion - a dfhack plugin for writing lua plugins.
« Reply #6 on: March 17, 2012, 07:41:13 pm »

If I may ask, would this new editor tool let me make a creature pregnant?  More specifically, would I able to make an unmarried dwarf become pregnant?
Logged

IamanElfCollaborator

  • Bay Watcher
  • S-stupid Forum-kun...m-making me look s-stupid....
    • View Profile
    • The Final Fantasy Mod. Welcome to the world of Bahamut!
Re: DFusion - a dfhack plugin for writing lua plugins.
« Reply #7 on: March 17, 2012, 07:46:27 pm »

I will do experiments to see if I can replicate Asmel Wheelscalded.
Logged
Mods:
Final Fantasy Mod
Persona Mod
Have a go at them, they're awesome.

Warmist

  • Bay Watcher
    • View Profile
Re: DFusion - a dfhack plugin for writing lua plugins.
« Reply #8 on: March 18, 2012, 03:27:55 am »

If I may ask, would this new editor tool let me make a creature pregnant?  More specifically, would I able to make an unmarried dwarf become pregnant?
Just tested. Not yet, although there is
Code: [Select]
df.world.units.all[0]:deref().relations.pregnancy_timer=10
df.world.units.all[0]:deref().relations.pregnancy_mystery=1
df.world.units.all[0]:deref().relations.lover_id=1
--this part is not yet possible
df.world.units.all[0]:deref().relations.pregnancy_ptr=?
The last part afaik is needed. It points to two arrays, and ussually (if not pregnant) it does not exist. I think those are baby's traits or something. And it is possible that friendship forts crashed because of this (interspecies babies have incorrect traits?). I will make some way to create new stuff too, because now it lets you only to edit.
Logged

IamanElfCollaborator

  • Bay Watcher
  • S-stupid Forum-kun...m-making me look s-stupid....
    • View Profile
    • The Final Fantasy Mod. Welcome to the world of Bahamut!
Re: DFusion - a dfhack plugin for writing lua plugins.
« Reply #9 on: March 18, 2012, 04:00:22 am »

I will take this, and conquer the world with demon/elf hybrids made of dog skin.
Logged
Mods:
Final Fantasy Mod
Persona Mod
Have a go at them, they're awesome.

Warmist

  • Bay Watcher
    • View Profile
Re: DFusion - a dfhack plugin for writing lua plugins.
« Reply #10 on: March 18, 2012, 05:22:49 am »

If I may ask, would this new editor tool let me make a creature pregnant?  More specifically, would I able to make an unmarried dwarf become pregnant?

Just made a tool, will upload soon. Select creature and use tools->empregnate. It should give birth soon. Tested it in arena (mother killed it's children) and in adventure mode (can't pickup baby, and you need to use lua to find out which unit you are and then:
Code: [Select]
local unit=df.world.units.all[0]:deref() -- lets say we are the first unit
tools.empregnate(unit) --done!
Logged

Tabithda

  • Bay Watcher
  • Syete'eka
    • View Profile
Re: DFusion - a dfhack plugin for writing lua plugins.
« Reply #11 on: March 18, 2012, 07:44:12 pm »

Yay, now my custom race can have children without having to lay eggs.  Thank you so very much for making this! :)
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a dfhack plugin for writing lua plugins.
« Reply #12 on: March 19, 2012, 08:02:05 am »

If I may ask, would this new editor tool let me make a creature pregnant?  More specifically, would I able to make an unmarried dwarf become pregnant?

Just made a tool, will upload soon. Select creature and use tools->empregnate. It should give birth soon. Tested it in arena (mother killed it's children) and in adventure mode (can't pickup baby, and you need to use lua to find out which unit you are and then:
Code: [Select]
local unit=df.world.units.all[0]:deref() -- lets say we are the first unit
tools.empregnate(unit) --done!

Combined this with force companion and boom instant armies. shoot you could remove the child tag and get instant adults


oh wait there is an error with dwarf colors or something that prevents dfhack from accepting Dfusion plugin
« Last Edit: April 03, 2012, 04:38:26 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

Warmist

  • Bay Watcher
    • View Profile
Re: DFusion - a dfhack plugin for writing lua plugins.
« Reply #13 on: April 03, 2012, 06:28:03 pm »

Added wrapper help that is the core of new version. Also whats to come in next release: lots of bugfixes (e.g. all the tools now work (prob in linux too!)), new adv_tools.reincarnate -> takes over the body of your killer :) and some stuff i forget.

Also now will be able to bind any command to key (type in dfhack: keybinding add Shift-R "dfuse adv_tools.reincarnate()")
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a dfhack plugin for writing lua plugins.
« Reply #14 on: April 03, 2012, 08:43:29 pm »

Added wrapper help that is the core of new version. Also whats to come in next release: lots of bugfixes (e.g. all the tools now work (prob in linux too!)), new adv_tools.reincarnate -> takes over the body of your killer :) and some stuff i forget.

Also now will be able to bind any command to key (type in dfhack: keybinding add Shift-R "dfuse adv_tools.reincarnate()")
If companion works then I guess I can break that apart and combine it with reincarnate and my secondwind to make a function where when you die you haunt your killer.
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] 2 3