Bay 12 Games Forum

Please login or register.

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

Author Topic: Dwarven Emigration: An alternative to insanity. Let's try this again.  (Read 24213 times)

fricy

  • Bay Watcher
  • [DFHACK:ZEALOT]
    • View Profile
Re: Dwarven Emigration: An alternative to insanity (Released)
« Reply #15 on: February 16, 2014, 09:51:25 am »

The script is throwing this error at me. Osx, dfhack-r3. I didn't observe anyone leave with the caravan, despite the number of tantrums I have in this fort.

Code: [Select]
Emigration loaded.
...Macnewbie_8.3/Dwarf Fortress/hack/scripts/emigration.lua:183: attempt to call local 'canLeave' (a boolean value)
stack traceback:
...Macnewbie_8.3/Dwarf Fortress/hack/scripts/emigration.lua:183: in function 'checkForDeserters'
...Macnewbie_8.3/Dwarf Fortress/hack/scripts/emigration.lua:248: in function <...Macnewbie_8.3/Dwarf Fortress/hack/scripts/emigration.lua:214>


Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Dwarven Emigration: An alternative to insanity (Released)
« Reply #16 on: February 16, 2014, 10:25:40 am »

I think its for dfhack r4 only.
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

fricy

  • Bay Watcher
  • [DFHACK:ZEALOT]
    • View Profile
Re: Dwarven Emigration: An alternative to insanity (Released)
« Reply #17 on: February 20, 2014, 07:26:48 am »

I think its for dfhack r4 only.

Sadly no: I've found lesothor's Dfhack-r4 for osx, but it doesn't help, the error message is still the same.

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: Dwarven Emigration: An alternative to insanity (Released)
« Reply #18 on: February 20, 2014, 07:30:16 am »

@178 you overwrite canLeave (a method) with local value canLeave=true

Chaos17

  • Bay Watcher
    • View Profile
Re: Dwarven Emigration: An alternative to insanity (Released)
« Reply #19 on: February 21, 2014, 04:40:48 am »

Hi,

I'm new, where I shall install it ?
I've the LNP pack.

Edit : nevermind, I've found it. silly me.
« Last Edit: February 21, 2014, 04:52:33 am by Chaos17 »
Logged

Askot Bokbondeler

  • Bay Watcher
  • please line up orderly
    • View Profile
Re: Dwarven Emigration: An alternative to insanity (Released)
« Reply #20 on: March 03, 2014, 10:52:00 pm »

Ptw

Frango Nicolbidok

  • Bay Watcher
  • Legendary Peasant
    • View Profile
Re: Dwarven Emigration: An alternative to insanity (Released)
« Reply #21 on: April 03, 2014, 08:59:57 pm »

.34.11, r3
a bug, similar to fricy's

Code: [Select]
Emigration loaded.
df\hack\scripts/emigration.lua:183: attempt to call local 'canLeave' (a boolean value)
stack traceback:
df\hack\scripts/emigration.lua:183: in function 'checkForDeserters'
df\hack\scripts/emigration.lua:263: in function 'event_loop'
df\hack\scripts/emigration.lua:271: in function <df\hack\scripts/emigration.lua:268>
Logged
However, now I wanted some more challenge and embarked to evil biome.
"Terrifying screams come from above!"

pisskop

  • Bay Watcher
  • Too old and stubborn to get a new avatar
    • View Profile
Re: Dwarven Emigration: An alternative to insanity (Released)
« Reply #22 on: April 03, 2014, 09:11:01 pm »

awesome
Logged
Pisskop's Reblancing Mod - A C:DDA Mod to make life a little (lot) more brutal!
drealmerz7 - pk was supreme pick for traitor too I think, and because of how it all is and pk is he is just feeding into the trollfucking so well.
PKs DF Mod!

aljady

  • Escaped Lunatic
    • View Profile
Re: Dwarven Emigration: An alternative to insanity (Released)
« Reply #23 on: April 21, 2014, 11:14:56 am »

.34.11, r3
a bug, similar to fricy's

Code: [Select]
Emigration loaded.
df\hack\scripts/emigration.lua:183: attempt to call local 'canLeave' (a boolean value)
stack traceback:
df\hack\scripts/emigration.lua:183: in function 'checkForDeserters'
df\hack\scripts/emigration.lua:263: in function 'event_loop'
df\hack\scripts/emigration.lua:271: in function <df\hack\scripts/emigration.lua:268>

Anyone found a fix for that?
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: Dwarven Emigration: An alternative to insanity (Released)
« Reply #24 on: May 03, 2014, 10:39:02 am »

You should be able to fix it by changing "canLeave" to "can_leave" at lines 178, 194, and 200 (just those three). I haven't tested it in-depth, but from a glance it should work.
« Last Edit: May 03, 2014, 10:42:36 am by lethosor »
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.

pisskop

  • Bay Watcher
  • Too old and stubborn to get a new avatar
    • View Profile
Re: Dwarven Emigration: An alternative to insanity (Released)
« Reply #25 on: May 03, 2014, 10:55:13 am »

. for subscribing
Quote
[pisskop
Logged
Pisskop's Reblancing Mod - A C:DDA Mod to make life a little (lot) more brutal!
drealmerz7 - pk was supreme pick for traitor too I think, and because of how it all is and pk is he is just feeding into the trollfucking so well.
PKs DF Mod!

expwnent

  • Bay Watcher
    • View Profile
Re: Dwarven Emigration: An alternative to insanity (Released)
« Reply #26 on: May 07, 2014, 12:51:20 pm »

Posting to watch.  Looks handy.
Logged

IndigoFenix

  • Bay Watcher
  • All things die, but nothing dies forever.
    • View Profile
    • Boundworlds: A Browser-Based Multiverse Creation and Exploration Game

Updated: Bug fixed.

You can also enter a parameter to change the probability of emigration, for those who want it to happen more frequently than practically never.  The number is a straight multiplier for the checking frequency.

fricy

  • Bay Watcher
  • [DFHACK:ZEALOT]
    • View Profile

Macnewbie, tested with dfhack r3 official and unofficial r4, latest emigration plugin:
Code: [Select]
...8.5/Macnewbie/Dwarf Fortress/hack/scripts/emigration.lua:190: attempt to call local 'desireToStay' (a number value)
stack traceback:
...8.5/Macnewbie/Dwarf Fortress/hack/scripts/emigration.lua:190: in function 'checkForDeserters'
...8.5/Macnewbie/Dwarf Fortress/hack/scripts/emigration.lua:254: in function <...8.5/Macnewbie/Dwarf Fortress/hack/scripts/emigration.lua:220>

lethosor

  • Bay Watcher
    • View Profile

Another conflicting variable. Replace "desireToStay(" with something else (with the opening parenthesis, e.g. "desire_to_stay(") - lines 163, 185, and 190.
Lines 163-213:
Code: [Select]
function desire_to_stay(unit,method,civ_id)
value = unit.status.happiness
if (method == 'merchant' or method == 'diplomat') and civ_id ~= unit.civ_id then value = value*2 end
if method == 'diplomat' then value = value*2 end
if method == 'wild' then value = value*5 end
if method == 'invader' then value = value*10 end
if method == 'beast' then value = value*10 end
return value
end

function checkForDeserters(method,civ_id)
allUnits = df.global.world.units.active
local u
for i=#allUnits-1,0,-1 do -- search list in reverse
if math.random (prob) == 1 then -- about once every 3000 season ticks.  That should be one check per caravan, on average.
u = allUnits[i]
if dfhack.units.isCitizen(u)
and dfhack.units.isSane(u)
and u.profession ~= 103
and not dfhack.units.isDead(u) then
if canLeave(u,method) == true then
local can_Leave = true
local desireToStay = desire_to_stay(u,method,civ_id)
if u.relations.spouse_id ~= -1 then
spouse = df.unit.find(u.relations.spouse_id)
if not dfhack.units.isDead(spouse) then
if canLeave(spouse,method) then
spouse_desireToStay = desire_to_stay(spouse,method,civ_id)

assert1 = 100 --should be assertiveness of this unit
assert2 = 100 --should be assertiveness of spouse
twm = 1/(assert1+assert2)
weight1 = assert1*twm
weight2 = assert2*twm

desireToStay = (desireToStay*weight1) + (spouse_desireToStay*weight2)
else
can_Leave = false
end
end
end
if desireToStay < 1 then desireToStay = 1 end -- no divide by zero
local desertChance = 100/desireToStay
if math.random(100) < desertChance and can_Leave == true then
desert(u,method)
end
end
end
end
end
end
« Last Edit: May 16, 2014, 04:33:52 pm by lethosor »
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.
Pages: 1 [2] 3