I noticed in HRM a discussion about 'hermits' that could be included in fc3.1 due to an enhancement to the hut enter callback. I also gather that the feature is intended for civ2civ3 hence the choice of thread, but if I'm wrong I apologise for being 'off topic'.
To demonstrate the features of the
new version of default hut enter, I have coded the following Lua to implement a 'demonstration' version of hermit huts that can be used right now in fc2.6. I have no clear idea of what is actually intended but I believe the key feature is that the huts are created during gameplay and not at the beginning. So a brief description:
'Hermit' huts will appear on mountains. All others are normal fc type huts except that they will not give techs.
If you are lucky a hermit hut will provide a tech.
As the game progresses they will be created but will become increasingly harder to find.
There is a year curfew (currently 1000AD) after which no new huts will be created.
There are a few extra features which I will not describe. I will leave that as a journey of discovery. You could read the code
but that would be cheating.To illustrate the use of inline coding for the _deflua_hut_ruleset_context function this version is as follows:
Code: Select all
function _deflua_hut_ruleset_context (self, unit)
local context = self:reset (unit)
local MPF, tail = context._MPF, context._tail
if unit.tile.terrain == mtn_terrain
then
context.city_radius_sq = 5 -- actual city radius
context.use_number = thief
if context:_near_city ()
or works_nearby (unit.tile)
then context:_set_point (nobody_home, 1)
else
context:_set_point (hermit, 3)
context:_set_point
( math.floor (random (0, math.min (5,unit.owner:gold()))), 1)
end
else
context:_set_point ( 25, 1)
context:_set_point ( 50, 3)
context:_set_point (100, 1)
-- context:_set_point (MPF.technology, 3)
context:_set_point (MPF.mercenary, 2)
context:_set_point (MPF.barbarians, 1)
context:_set_point (MPF.city, 1)
end
return context
end
Here is the INSERT into civ2civ3 script.lua :
No other changes to the ruleset are necessary.
If someone can tell me the details of what is actually intended for hermit huts I can have a go at it.