Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 168 169 [170] 171 172 ... 360

Author Topic: DFHack 0.43.03-r1  (Read 1078810 times)

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #2535 on: April 26, 2015, 06:19:39 pm »

Will interaction-trigger fire when a regional interaction affects a creature, maybe using the HIST string as if were the verb?

I'm trying to run this script on each instance of a specific species of vermin that appears.

I have a work-around, but it doesn't do quite what I want.

Edit: typing on a phone sucks.
« Last Edit: April 26, 2015, 06:21:59 pm by Dirst »
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #2536 on: April 27, 2015, 01:19:55 am »

Will interaction-trigger fire when a regional interaction affects a creature, maybe using the HIST string as if were the verb?

I'm trying to run this script on each instance of a specific species of vermin that appears.

I have a work-around, but it doesn't do quite what I want.

Edit: typing on a phone sucks.

If you are just tryting to run a script on each vermin then I would suggest making the regional interaction only effect a certain syndrome class and then simply using syndrome-trigger instead. Unless I am not understanding what you mean.
Logged

expwnent

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #2537 on: April 27, 2015, 02:49:28 am »

For interaction-trigger it would have to show up in the event log. It doesn't look at historical events.
Logged

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #2538 on: April 27, 2015, 05:00:08 am »

Thanks Roses and expwnent, I'll have the regional interaction target all castes of that creature with a syndrome and trigger off of that instead.  It's better than the whole species mysteriously getting CLEANed by the environment every week.
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

Boltgun

  • Bay Watcher
  • [UTTERANCES]
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #2539 on: April 28, 2015, 02:56:02 pm »

I finally figured what was wrong with spawnunit. Comparing side to side a natural pet with a spawned one I made o differences and fixed them:
Code: [Select]
    unit.flags2.resident = false;
    unit.flags3.body_temp_in_range = true;
    unit.population_id = -1
    unit.status.current_soul.unit_id = unit.id -- Was not set when creating the soul

    unit.animal.population.region_x = -1
    unit.animal.population.region_y = -1
    unit.animal.population.unk_28 = -1
    unit.animal.population.population_idx = -1
    unit.animal.population.depth = -1

    unit.counters.soldier_mood_countdown = -1
    unit.counters.death_cause = -1

    unit.enemy.anon_4 = -1
    unit.enemy.anon_5 = -1
    unit.enemy.anon_6 = -1

The last three anon values are the most important. Those caused the creature to initiate a fight when the save was reloaded (I suppose that's when the enemy cache was to be rebuilt). This did not cause a loyalty cascade and the animal was listed as a perfectly tame pet, only it acted like an enemy. By default it was set to 0.

The other values might have their own importance. I'll clean the script out of its debugging stuff and send it. Note that I am focusing in creating animals, so there is still issues in creating citizens.
Logged

Max™

  • Bay Watcher
  • [CULL:SQUARE]
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #2540 on: April 28, 2015, 04:19:27 pm »

So I was trying to figure out how to poke around in various things easier and I realized that I didn't need to go through and type out gui/gm-editor df.global since you can just replace the
Code: [Select]
qerror("No valid target found") line with
Code: [Select]
my_trg=df.global
So it will load up as normal when targeting a dorf or item, but it defaults to loading the df.global page, is there a good reason to not do this?
Logged

Bo-Rufus CMVII

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #2541 on: April 28, 2015, 07:48:24 pm »

Is this a bug?  I never noticed it under 0.34.

If you reveal the map, dig a bit, and then unreveal, the new dig is blacked out.  Even a dwarf in the new area when you unreveal will not make its own tile visible.

Apparently they cannot path through the area either.  Plus if you re-designate some at the edge to dig (to make them go there), they will decide that it's not a valid dig spot, the designation is removed, and the square is blacked out again.
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #2542 on: April 28, 2015, 07:49:26 pm »

That also happened in 0.34, and AFAIK has happened ever since reveal was released. Use revflood to fix it.

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #2543 on: April 28, 2015, 07:56:14 pm »

That's expected, since "reveal" stores information about which tiles were revealed when it was run, allowing "unreveal" to revert its changes.
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

Max™

  • Bay Watcher
  • [CULL:SQUARE]
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #2544 on: April 28, 2015, 08:33:53 pm »

You can also use tiletypes h 0 on those squares to unhide them.
Logged

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #2545 on: April 28, 2015, 11:11:34 pm »

I'm back with my troublesome vermin :)

First, I can report that Boltgun's fixes don't generate any errors when applied to normal or vermin animals.  The affected creatures also didn't rampage on a re-load, so far so good.

Second, syndrome-trigger doesn't seem to be able to find named syndromes defined in regional interactions.  I don't know how to use a regional interaction to apply a syndrome defined in a material.  Is there an event I could hook into instead that would fire when a creature (preferably a certain type) appears on the map?

Third (which isn't a DFHack thing), the vermin behavior I wanted them to have doesn't seem to work anyway: the wiki claims that vermin pets are carried by their owners, but I've yet to see that happen.
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #2546 on: April 28, 2015, 11:18:42 pm »

For anyone keeping score at home, this is warmist's spawn-unit script with all of the hotfixes I know about:

Code: (spawn-unit.lua) [Select]
--create unit at pointer or given location and with given civ (usefull to pass -1 for enemy). Usage e.g. "spawn-unit -race DWARF -caste 0 -name Dwarfy"
--[=[
    arguments
        -help
            print this help message
        -race <RACE_ID>
            The raw id of the creature's race, mandatory
        -caste <number>
            The caste's number, optional
-age <number>
    The unit's age in years, defaults to 15 if omitted
        -name <doggy>
            The unit's name, optional
        -position [ x y z ]
            The unit's position, will try to use the cursor if omitted
        -civ_id
            The unit's civilisation, will be the player's if omitted

    Example : spawn-unit -race HUMAN -caste 0 -name Bob

    Made by warmist, but edited by Putnam for the dragon ball mod to be used in reactions
Modified by Dirst for use in The Earth Strikes Back mod, incorporating fixes discovered
by Boltgun

    TODO:
        throw a proper error if the user attempt to run it from the console, without good args
        orientation
        chosing a caste based on ratios
        birth time
        death time
        real body size
        blood max
        check if soulless and skip make soul
        set weapon body part
        nemesis/histfig : add an 'arrived on site' event
        generate name
--]=]
local utils=require 'utils'

-- Picking a caste or gender at random
local function getRandomCasteId(race_id)
    local cr = df.creature_raw.find(race_id)
    local caste_id, casteMax

    casteMax = #cr.caste - 1

    if casteMax > 0 then
        return math.random(0, casteMax)
    end

    return 0
end

local function getCaste(race_id,caste_id)
    local cr=df.creature_raw.find(race_id)

    return cr.caste[tonumber(caste_id)]
end

local function genBodyModifier(body_app_mod)
    local a=math.random(0,#body_app_mod.ranges-2)
    return math.random(body_app_mod.ranges[a],body_app_mod.ranges[a+1])
end

local function getBodySize(caste,time)
    --TODO: real body size...
    return caste.body_size_1[#caste.body_size_1-1] --returns last body size
end

local function genAttribute(array)
    local a=math.random(0,#array-2)
    return math.random(array[a],array[a+1])
end

local function norm()
    return math.sqrt((-2)*math.log(math.random()))*math.cos(2*math.pi*math.random())
end

local function normalDistributed(mean,sigma)
    return mean+sigma*norm()
end

local function clampedNormal(min,median,max)
    local val=normalDistributed(median,math.sqrt(max-min))
    if val<min then return min end
    if val>max then return max end
    return val
end

local function makeSoul(unit,caste)
    local tmp_soul=df.unit_soul:new()
    tmp_soul.unit_id=unit.id
    tmp_soul.name:assign(unit.name)
    tmp_soul.race=unit.race
    tmp_soul.sex=unit.sex
    tmp_soul.caste=unit.caste
    --todo: preferences,traits.
    local attrs=caste.attributes
    for k,v in pairs(attrs.ment_att_range) do
       local max_percent=attrs.ment_att_cap_perc[k]/100
       local cvalue=genAttribute(v)
       tmp_soul.mental_attrs[k]={value=cvalue,max_value=cvalue*max_percent}
    end
    for k,v in pairs(tmp_soul.personality.traits) do
        local min,mean,max
        min=caste.personality.a[k]
        mean=caste.personality.b[k]
        max=caste.personality.c[k]
        tmp_soul.personality.traits[k]=clampedNormal(min,mean,max)
    end
    --[[natural skill fix]]
    for k, skill in ipairs(caste.natural_skill_id) do
        local rating = caste.natural_skill_lvl[k]
        utils.insert_or_update(tmp_soul.skills,
            {new=true,id=skill,experience=caste.natural_skill_exp[k],rating=rating}, 'id')
    end
   
    unit.status.souls:insert("#",tmp_soul)
    unit.status.current_soul=tmp_soul
end

local function CreateUnit(race_id,caste_id,unit_age)
    local race=df.creature_raw.find(race_id)
    if race==nil then error("Invalid race_id") end

unit_age = unit_age or 15
   
local caste
    local unit=df.unit:new()

    -- Pick a random caste is none are set
    if nil == caste_id then
        caste_id = getRandomCasteId(race_id)
    end

    caste = getCaste(race_id,caste_id)

    unit:assign{
        race=race_id,
        caste=caste_id,
        sex=caste.gender,
    }

    unit.relations.birth_year=df.global.cur_year-unit_age --AGE is set here
    if caste.misc.maxage_max==-1 then
        unit.relations.old_year=-1
    else
        unit.relations.old_year=df.global.cur_year+math.random(caste.misc.maxage_min,caste.misc.maxage_max)
    end
   
    unit.relations.birth_time=df.global.cur_year_tick
    --unit.relations.old_time=?? --TODO add normal age
    --[[ interataction stuff, probably timers ]]--
    local num_inter=#caste.body_info.interactions  -- new for interactions
    unit.curse.own_interaction:resize(num_inter) -- new for interactions
    unit.curse.own_interaction_delay:resize(num_inter) -- new for interactions
    --[[ body stuff ]]
   
    local body=unit.body
    body.body_plan=caste.body_info
    local body_part_count=#body.body_plan.body_parts
    local layer_count=#body.body_plan.layer_part
    --[[ body components ]]
    local cp=body.components
    cp.body_part_status:resize(body_part_count)
    cp.numbered_masks:resize(#body.body_plan.numbered_masks)
    for num,v in ipairs(body.body_plan.numbered_masks) do
        cp.numbered_masks[num]=v
    end
    cp.layer_status:resize(layer_count)
    cp.layer_wound_area:resize(layer_count)
    cp.layer_cut_fraction:resize(layer_count)
    cp.layer_dent_fraction:resize(layer_count)
    cp.layer_effect_fraction:resize(layer_count)
   
    local attrs=caste.attributes
    for k,v in pairs(attrs.phys_att_range) do
        local max_percent=attrs.phys_att_cap_perc[k]/100
        local cvalue=genAttribute(v)
        unit.body.physical_attrs[k]={value=cvalue,max_value=cvalue*max_percent}
    end
 
   
    body.blood_max=getBodySize(caste,0) --TODO normal values
    body.blood_count=body.blood_max
    body.infection_level=0
    unit.status2.body_part_temperature:resize(body_part_count)
    for k,v in pairs(unit.status2.body_part_temperature) do
        unit.status2.body_part_temperature[k]={new=true,whole=10067,fraction=0}
       
    end
    --[[ largely unknown stuff ]]
    local stuff=unit.enemy
    stuff.body_part_878:resize(body_part_count) -- all = 3
    stuff.body_part_888:resize(body_part_count) -- all = 3
    stuff.body_part_relsize:resize(body_part_count) -- all =0
   
    stuff.were_race=race_id
    stuff.were_caste=caste_id
    stuff.normal_race=race_id
    stuff.normal_caste=caste_id
    stuff.body_part_8a8:resize(body_part_count) -- all = 1
    stuff.body_part_base_ins:resize(body_part_count)
    stuff.body_part_clothing_ins:resize(body_part_count)
    stuff.body_part_8d8:resize(body_part_count)
   
    --TODO add correct sizes. (calculate from age)
    local size=caste.body_size_2[#caste.body_size_2-1]
    body.size_info.size_cur=size
    body.size_info.size_base=size
    body.size_info.area_cur=math.pow(size,0.666)
    body.size_info.area_base=math.pow(size,0.666)
    body.size_info.area_cur=math.pow(size*10000,0.333)
    body.size_info.area_base=math.pow(size*10000,0.333)
   
    unit.recuperation.healing_rate:resize(layer_count)
   
    --appearance
    local app=unit.appearance
    app.body_modifiers:resize(#caste.body_appearance_modifiers) --3
    for k,v in pairs(app.body_modifiers) do
        app.body_modifiers[k]=genBodyModifier(caste.body_appearance_modifiers[k])
    end
    app.bp_modifiers:resize(#caste.bp_appearance.modifier_idx) --0
    for k,v in pairs(app.bp_modifiers) do
        app.bp_modifiers[k]=genBodyModifier(caste.bp_appearance.modifiers[caste.bp_appearance.modifier_idx[k]])
    end
    --app.unk_4c8:resize(33)--33
    app.tissue_style:resize(#caste.bp_appearance.style_part_idx)
    app.tissue_style_civ_id:resize(#caste.bp_appearance.style_part_idx)
    app.tissue_style_id:resize(#caste.bp_appearance.style_part_idx)
    app.tissue_style_type:resize(#caste.bp_appearance.style_part_idx)
    app.tissue_length:resize(#caste.bp_appearance.style_part_idx)
    app.genes.appearance:resize(#caste.body_appearance_modifiers+#caste.bp_appearance.modifiers) --3
    app.genes.colors:resize(#caste.color_modifiers*2) --???
    app.colors:resize(#caste.color_modifiers)--3
   
    makeSoul(unit,caste)
   
    --finally set the id
    unit.id=df.global.unit_next_id
    df.global.unit_next_id=df.global.unit_next_id+1
    df.global.world.units.all:insert("#",unit)
    df.global.world.units.active:insert("#",unit)

    return unit
end

local function findRace(name)
    for k,v in pairs(df.global.world.raws.creatures.all) do
        if v.creature_id==name then
            return k
        end
    end
    qerror("Race:"..name.." not found!")
end
 
local function createFigure(trgunit,he,he_group)
    local hf=df.historical_figure:new()
    hf.id=df.global.hist_figure_next_id
    hf.race=trgunit.race
    hf.caste=trgunit.caste
    hf.profession = trgunit.profession
    hf.sex = trgunit.sex
    df.global.hist_figure_next_id=df.global.hist_figure_next_id+1
    hf.appeared_year = df.global.cur_year
   
    hf.born_year = trgunit.relations.birth_year
    hf.born_seconds = trgunit.relations.birth_time
    hf.curse_year = trgunit.relations.curse_year
    hf.curse_seconds = trgunit.relations.curse_time
    hf.birth_year_bias = trgunit.relations.birth_year_bias
    hf.birth_time_bias = trgunit.relations.birth_time_bias
    hf.old_year = trgunit.relations.old_year
    hf.old_seconds = trgunit.relations.old_time
    hf.died_year = -1
    hf.died_seconds = -1
    hf.name:assign(trgunit.name)
    hf.civ_id = trgunit.civ_id
    hf.population_id = trgunit.population_id
    hf.breed_id = -1
    hf.unit_id = trgunit.id
   
    df.global.world.history.figures:insert("#",hf)
 
    hf.info = df.historical_figure_info:new()
    hf.info.unk_14 = df.historical_figure_info.T_unk_14:new() -- hf state?
    --unk_14.region_id = -1; unk_14.beast_id = -1; unk_14.unk_14 = 0
    hf.info.unk_14.unk_18 = -1; hf.info.unk_14.unk_1c = -1
    -- set values that seem related to state and do event
    --change_state(hf, dfg.ui.site_id, region_pos)
 
 
    --lets skip skills for now
    --local skills = df.historical_figure_info.T_skills:new() -- skills snap shot
    -- ...
    hf.info.skills = {new=true}
 
 
    he.histfig_ids:insert('#', hf.id)
    he.hist_figures:insert('#', hf)
    if he_group then
        he_group.histfig_ids:insert('#', hf.id)
        he_group.hist_figures:insert('#', hf)
        hf.entity_links:insert("#",{new=df.histfig_entity_link_memberst,entity_id=he_group.id,link_strength=100})
    end
    trgunit.flags1.important_historical_figure = true
    trgunit.flags2.important_historical_figure = true
    trgunit.hist_figure_id = hf.id
    trgunit.hist_figure_id2 = hf.id
   
    hf.entity_links:insert("#",{new=df.histfig_entity_link_memberst,entity_id=trgunit.civ_id,link_strength=100})
   
    --add entity event
    local hf_event_id=df.global.hist_event_next_id
    df.global.hist_event_next_id=df.global.hist_event_next_id+1
    df.global.world.history.events:insert("#",{new=df.history_event_add_hf_entity_linkst,year=trgunit.relations.birth_year,
    seconds=trgunit.relations.birth_time,id=hf_event_id,civ=hf.civ_id,histfig=hf.id,link_type=0})
    return hf
end

local function  allocateNewChunk(hist_entity)
    hist_entity.save_file_id=df.global.unit_chunk_next_id
    df.global.unit_chunk_next_id=df.global.unit_chunk_next_id+1
    hist_entity.next_member_idx=0
    print("allocating chunk:",hist_entity.save_file_id)
end

local function allocateIds(nemesis_record,hist_entity)
    if hist_entity.next_member_idx==100 then
        allocateNewChunk(hist_entity)
    end
    nemesis_record.save_file_id=hist_entity.save_file_id
    nemesis_record.member_idx=hist_entity.next_member_idx
    hist_entity.next_member_idx=hist_entity.next_member_idx+1
end
 
local function createNemesis(trgunit,civ_id,group_id)
    local id=df.global.nemesis_next_id
    local nem=df.nemesis_record:new()
   
    nem.id=id
    nem.unit_id=trgunit.id
    nem.unit=trgunit
    nem.flags:resize(4)
    --not sure about these flags...
    -- [[
    nem.flags[4]=true
    nem.flags[5]=true
    nem.flags[6]=true
    nem.flags[7]=true
    nem.flags[8]=true
    nem.flags[9]=true
    --]]
    --[[for k=4,8 do
        nem.flags[k]=true
    end]]
    nem.unk10=-1
    nem.unk11=-1
    nem.unk12=-1
    df.global.world.nemesis.all:insert("#",nem)
    df.global.nemesis_next_id=id+1
    trgunit.general_refs:insert("#",{new=df.general_ref_is_nemesisst,nemesis_id=id})
    trgunit.flags1.important_historical_figure=true
   
    nem.save_file_id=-1
 
    local he=df.historical_entity.find(civ_id)
    he.nemesis_ids:insert("#",id)
    he.nemesis:insert("#",nem)
    local he_group
    if group_id~=-1 then
        he_group=df.historical_entity.find(group_id)
    end
    if he_group then
        he_group.nemesis_ids:insert("#",id)
        he_group.nemesis:insert("#",nem)
    end
    allocateIds(nem,he)
    nem.figure=createFigure(trgunit,he,he_group)
end

-- Do the placement, returns the freshly spawned unit
function place(args)
    if not args.race then
        qerror("Please provide a race")
    end

local pos = {}
if args.position then
    pos.x=args.position[1]
pos.y=args.position[2]
pos.z=args.position[3]
else
    pos = copyall(df.global.cursor)
end

    if pos.x == -30000 then
        qerror("Point your pointy thing somewhere")
    end

    local i
    local race_id = findRace(args.race)
    local u = CreateUnit(race_id,args.caste,args.age)

    u.pos:assign(pos)
       
    if args.name then
        u.name.first_name = args.name
        u.name.has_name = true
    end

if args.cid_id then args.civ_id = tonumber(args.civ_id) end

    local group_id
    if df.global.gamemode == df.game_mode.ADVENTURE then
        u.civ_id = args.civ_id or df.global.world.units.active[0].civ_id
        group_id = -1
    else   
        u.civ_id = args.civ_id or df.global.ui.civ_id
   end

    if args.civ_id == -1 then
        group_id = group_id or -1
    else
        group_id = group_id or df.global.ui.group_id
-- If a friendly animal, make it domesticated.  From Boltgun & Dirst
local caste=df.creature_raw.find(u.race).caste[u.caste]
if not(caste.flags.CAN_SPEAK and caste.flags.CAN_LEARN) then
-- Fix friendly animals (from Boltgun)
u.flags2.resident = false;
u.flags3.body_temp_in_range = true;
u.population_id = -1
u.status.current_soul.unit_id = u.id

u.animal.population.region_x = -1
u.animal.population.region_y = -1
u.animal.population.unk_28 = -1
u.animal.population.population_idx = -1
u.animal.population.depth = -1

u.counters.soldier_mood_countdown = -1
u.counters.death_cause = -1

u.enemy.anon_4 = -1
u.enemy.anon_5 = -1
u.enemy.anon_6 = -1

-- And make them tame (from Dirst)
u.flags1.tame = true
u.training_level = 7
end

end

    local desig,ocupan = dfhack.maps.getTileFlags(pos)
    if ocupan.unit then
        ocupan.unit_grounded = true
        u.flags1.on_ground = true
    else
        ocupan.unit = true
    end

    if df.historical_entity.find(u.civ_id) ~= nil  then
        createNemesis(u, u.civ_id,group_id)
    end

    return u
end

validArgs = validArgs or utils.invert({
    'help',
    'race',
    'caste',
'age',
    'name',
    'position',
    'civ_id',
})

local args = utils.processArgs({...}, validArgs)

if args.help then
 print([[scripts/spawn-unit.lua
arguments
    -help
        print this help message
    -race <RACE_ID>
        The raw id of the creature's race, mandatory
    -caste <number>
        The caste's number, optional
-age <number>
    The unit's age in years, defaults to 15 if omitted
-name <doggy>
        The unit's name, optional
    -position [ x y z ]
        The unit's position, will try to use the cursor if ommited
    -civ_id
        The unit's civilisation, will be the player's if ommited

]])
 return
end

if args.race then
    place(args) --Creature (ID), caste (number), age, name, x,y,z , civ_id(-1 for enemy, optional) for spawn.
end
« Last Edit: April 29, 2015, 06:34:54 am by Dirst »
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #2547 on: April 28, 2015, 11:22:08 pm »

Sorry, I have only been able to loosely follow what has been going on with the spawn unit script, so these questions may have already been answered.

1. Does it allow for spawning of both friendly and hostile animals?
2. Does it allow for spawning of hostile entity creatures (they don't have to be entity members, but just CAN_SPEAK or CAN_LEARN invaders?)
3. Does it allow for spawning of friendly civ members? (from what I have read this is still a no)
4. Does the friendly and hostile animals extend to semi and megabeasts?
Logged

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #2548 on: April 28, 2015, 11:41:17 pm »

Sorry, I have only been able to loosely follow what has been going on with the spawn unit script, so these questions may have already been answered.

1. Does it allow for spawning of both friendly and hostile animals?
2. Does it allow for spawning of hostile entity creatures (they don't have to be entity members, but just CAN_SPEAK or CAN_LEARN invaders?)
3. Does it allow for spawning of friendly civ members? (from what I have read this is still a no)
4. Does the friendly and hostile animals extend to semi and megabeasts?
1. Yes.  Give the animal a civ_id of -1 to make it hostile.  You'll need to escape it as \-1 on the command line.
2. I think right now it assumes any animal that's not -1 is friendly to the fort.  Would need some additional checks of the provided civ_id to iron out the kinks.  Intelligent creatures skip all of the fixes, so I'm not sure exactly how they'll behave.
3. Badly.  You end up with a nameless peasant with no relationships or personality.  Might be what you want if you're going for a golem.
4. It uses the text creature ID and the numeric caste (picking one at random if none is provided), so there's no reason it shouldn't work with semi and megabeasts at a basic level.  Obviously, they won't have lairs or anything, and I highly doubt it would trigger announcements.
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

Boltgun

  • Bay Watcher
  • [UTTERANCES]
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #2549 on: April 29, 2015, 02:16:13 am »

Nice cleanup Dirst, I'll use that one.

I also added orientation in my local. Creatures spawn asexual so animals will have the 'marry' flag for the opposite sex as true and intelligent creatures will be based on raws. I think we are getting to the stability of the 0.34 version of this script.
« Last Edit: April 29, 2015, 02:17:44 am by Boltgun »
Logged
Pages: 1 ... 168 169 [170] 171 172 ... 360