Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - utunnels

Pages: 1 ... 17 18 [19] 20 21 ... 172
271
DF Dwarf Mode Discussion / Re: What's going on in your fort?
« on: April 17, 2015, 09:32:18 pm »
Finally got those dorfs married.

  Cog Kadoleshtan, "Cog Hatchetsmith", Miner   
"There's so much to be done!"
Within the last season, he felt lustful talking with the spouse.

272
DF Dwarf Mode Discussion / Re: Vampire Mayor: Alone among the dead
« on: April 17, 2015, 09:27:23 pm »
Maybe there're some changes since 40.xx.
I hope I can bury those corpses.

273
DF Dwarf Mode Discussion / Re: opposite of burrows?
« on: April 17, 2015, 07:55:56 pm »
You can also use windows or statues, they are easier to remove.

274
DF Dwarf Mode Discussion / Re: best weapons you could think of
« on: April 17, 2015, 08:28:01 am »
Yeah, 75lbs is still something for a hammer.

275
DF Dwarf Mode Discussion / Re: What's going on in your fort?
« on: April 17, 2015, 08:25:22 am »
Some zombie albatross came to the map. Fortunately they don't know how to open doors.

276
DF Dwarf Mode Discussion / Re: best weapons you could think of
« on: April 16, 2015, 10:48:21 pm »
On the other hand, if they do add to total weight, won't your planespacked be too heavy to wield?
(Imagine a beard carrying a 50-ton hammer).

277
Sorry maybe I didn't describe my goal clearly.

I figured out the result should be min(n_male, n_female), where n_male and n_female is corresponding total number of each gender among all valid pairs.
For example, there are 5 dorfs A,B,C,D & E, A & E are female, B,C & E are male, and there are 3 possible pairs, like this:

A--B
A--C
D--E

There are 2 possible couples, either (A--B and D--E), or (A--C and D--E).


1--4
A--B
A--C
A--E
A--F

result: 1


2--3
A--B
A--C
D--B
D--E

reulst:2

A--B, D--E
or
A--C, D--E
or
A--C, D--B


.....




278
DF Dwarf Mode Discussion / Re: What's going on in your fort?
« on: April 16, 2015, 08:02:33 pm »
Started on a terrifying land. A zombie giant mantis came and slaughtered the dorfs...
I reloaded the backup save and now the first wild animal wave didn't have any undead, lucky.

279
DF Dwarf Mode Discussion / Re: Kea men have crippled my fort
« on: April 16, 2015, 07:24:38 pm »
Recruit a melee squad and station them near the entrance, do not give them uniforms if they get interrupted.
If you are luck they should be able to fight them when they try to enter your fort...

280
DF Dwarf Mode Discussion / Re: Vampire Mayor: Alone among the dead
« on: April 16, 2015, 07:15:41 pm »
Melbil the animal caretaker distraught at being forced to slaughter the reanimated remains of those he once loved even when he himself was at no risk of being attacked as he was a vampire went into a berserk rage and was torn to shreds by the zombie horde.
Do zombie dwarves even recognizable? I mean, a ghost is still that person with a ghost status, but a zombie is just a copy of the dead person, if you kill a zombie, it will appaer in the dead unit list, along with it's dwarf version.


Urist McMason                 deceased
Urist McMason's corpse        deceased

281
DF Dwarf Mode Discussion / Re: Breeding a civilization...
« on: April 16, 2015, 10:36:46 am »
I did some !!science!!.
I embarked 30 times and checked the starting sevens.

Number of possible couples:

0 = 2 times (6.667%)
1 = 21 times (70%)
2 = 4 times (13.333%)
3 = 3 times (10%)

So if my method was correct, there were 23% chance there are at least 2 valid couples among the starting seven. The chance was actually higher than I expected.



282
DF Dwarf Mode Discussion / Re: Breeding a civilization...
« on: April 16, 2015, 04:26:33 am »

Oh, by the way, here's the script I'm working on...

http://www.bay12forums.com/smf/index.php?topic=150144.0

283
I want to run a fortress that only breeds using the starting seven. So I'm trying to write a script that prints all possible hetero couples(those who can marry and have children). It is still a WIP, but it can already print all necessary informations(age, orientation and valid mating candidates).

I'm still working on how to calculate the number of valid couples(I haven't do any math for ages so I'm a bit rusty).
For example there are two possible combinations: AB and AC, since A can only marry one from B and C, so there'll be only 1 possible couple.

Code: [Select]
local utils = require('utils')
 
local args = utils.processArgs({...})

if args.help then
 print('Dwarven marriage test script.')
 return
end

local function round(n, d)
  local m= 10^(d or 0)
  return math.floor(n*m+ 0.5) / m
end

local function getAgeString(unit)
  return ''..round(dfhack.units.getAge(unit,true),2)
end

local function getInfoString(unit)
 local infStr
 if unit.sex==0 then
  infStr='female, '
 elseif unit.sex==1 then
  infStr='male, '
 else
  infStr=""
 end
 infStr=infStr..getAgeString(unit)
 return '('..infStr..')'
end

--this is from gaydar.lua
local function determineorientation(unit)
 if unit.sex~=-1 then
  local return_string=''
  local orientation=unit.status.current_soul.orientation_flags
  local male_interested,asexual=false,true
  if orientation.romance_male then
   return_string=return_string..' likes males'
   male_interested=true
   asexual=false
  elseif orientation.marry_male then
   return_string=return_string..' will marry males'
   male_interested=true
   asexual=false
  end
  if orientation.romance_female then
   if male_interested then
 return_string=return_string..' and likes females'
   else
    return_string=return_string..' likes females'
   end
   asexual=false
  elseif orientation.marry_female then
   if male_interested then
 return_string=return_string..' and will marry females'
   else
    return_string=return_string..' will marry females'
   end
   asexual=false
  end
  if asexual then
   return_string=' is asexual'
  end

  return return_string
 else
  return "is not biologically capable of sex"
 end
end

local function nameOrSpeciesAndNumber(unit)
 if unit.name.has_name then
  return dfhack.TranslateName(dfhack.units.getVisibleName(unit))..' '..getInfoString(unit),true
 else
  return 'Unit #'..unit.id..' ('..df.creature_raw.find(unit.race).caste[unit.caste].caste_name[0]..getInfoString(unit)..')',false
 end
end

local validcitizens={}

for k,v in ipairs(df.global.world.units.active) do
  if dfhack.units.isCitizen(v)
    and ((v.sex==0 and v.status.current_soul.orientation_flags.marry_male)
          or (v.sex==1 and v.status.current_soul.orientation_flags.marry_female)) then
   table.insert(validcitizens,{v,nameOrSpeciesAndNumber(v) .. determineorientation(v)})
  end
end

local validpairs = {}
local validcount = {[0]=0,[1]=0}

local function checkAndAddValidPair(p)
  --sort first
  if p[1].sex==1 then
    local t = p[1]
    p[1] = p[2]
    p[2] = t
  end
  for j,v in ipairs(validpairs) do
    if p[1]==v[1] and p[2]==v[2] then
      return false
    end
  end
  table.insert(validpairs,p)
  return true
end


-- only find valid couples
for k,v in ipairs(validcitizens) do
  print(v[2])
  if v[1].relations.spouse_id~=-1 then
    print('  Already has a spouse')
  end
  if v[1].relations.lover_id~=-1 then
    print('  Already has a lover')
  end
  local valid = false
  for i,x in ipairs(validcitizens) do
    if x[1]~=v[1] and x[1].sex~=v[1].sex then
      if v[1].relations.spouse_id==x[1].id or v[1].relations.lover_id==x[1].id then
        print('  '..dfhack.TranslateName(dfhack.units.getVisibleName(x[1]))..' (arranged)')
checkAndAddValidPair({v[1],x[1]})
        valid = true
      elseif v[1].relations.lover_id==-1 and v[1].relations.spouse_id==-1
          and x[1].relations.lover_id==-1 and x[1].relations.spouse_id==-1
          and math.abs(dfhack.units.getAge(x[1],true)-dfhack.units.getAge(v[1],true))<10 then
        print('  '..dfhack.TranslateName(dfhack.units.getVisibleName(x[1])))
checkAndAddValidPair({v[1],x[1]})
        valid = true
      end
    end
  end
  if valid then
validcount[v[1].sex] = validcount[v[1].sex]+1
  end
end
print('')
print('There are ' ..math.min(validcount[1],validcount[0]).. ' possible valid couples')

for k,v in ipairs(validpairs) do
print(' '..dfhack.TranslateName(dfhack.units.getVisibleName(v[1]))..' x '..dfhack.TranslateName(dfhack.units.getVisibleName(v[2])))
end

284
DF Dwarf Mode Discussion / Re: Breeding a civilization...
« on: April 15, 2015, 11:00:29 pm »
I wrote a lua script to find valid pairs(correct orientation, age difference<10 years).
Sadly, there can be only 1 valid couple among the seven dorfs...

Atir Kilrudvucar (male, 55.51) will marry females
Litast Mosusoddom (male, 67.43) will marry females
Reg Cattenam (male, 73.49) will marry males and will marry females
  Ushat Shelretthikut (female, 77.63)
  Solon Dodokzuglar (female, 82.21)
Ushat Shelretthikut (female, 77.63) will marry males
  Reg Cattenam (male, 73.49)
Solon Dodokzuglar (female, 82.21) will marry males
  Reg Cattenam (male, 73.49)

285
DF Dwarf Mode Discussion / Re: Breeding a civilization...
« on: April 15, 2015, 08:35:10 pm »
Thanks. So 'will marry...'  status is mandatory.

Now at least I can do some !!science!!. I can try embarking 100 times and see how often the game generates 2 valid couples.

Pages: 1 ... 17 18 [19] 20 21 ... 172