diff --git a/s/preview b/s/preview index bafbae3ac..c89f4c3ca 100755 --- a/s/preview +++ b/s/preview @@ -31,6 +31,7 @@ assert_dir $SOURCE cd $SOURCE git fetch || abort "failed to update source. do you have local changes?" [ -z $1 ] || git checkout $1 +git pull git submodule update s/build || abort "build failed." } diff --git a/scripts/newplayer.lua b/scripts/newplayer.lua index 239eb487b..9d64f585b 100644 --- a/scripts/newplayer.lua +++ b/scripts/newplayer.lua @@ -30,38 +30,8 @@ local function seed(r, email, race, lang) for it, num in pairs(items) do u:add_item(it, num) end - u = nil - skills ={ - "crossbow", - "bow", - "building", - "trade", - "forestry", - "catapult", - "herbalism", - "training", - "riding", - "armorer", - "shipcraft", - "melee", - "sailing", - "polearm", - "espionage", - "roadwork", - "tactics", - "stealth", - "weaponsmithing", - "cartmaking", - "taxation", - "stamina" - } - unit.create(f, r, 50):set_skill("entertainment", 15) unit.create(f, r, 5):set_skill("mining", 30) unit.create(f, r, 5):set_skill("quarrying", 30) - for _, sk in ipairs(skills) do - u = u or unit.create(f, r, 5) - if u:set_skill(sk, 15)>0 then u=nil end - end return f end @@ -94,11 +64,16 @@ end math.randomseed(os.time()) local newbs = {} +local per_region = 2 +local num_seeded = 2 +local start = nil for _, p in ipairs(players) do - local index = math.random(#sel) - local start = nil - while not start or start.units() do - start = sel[index] + if num_seeded == per_region then + while not start or start.units() do + local index = math.random(#sel) + start = sel[index] + end + num_seeded = 0 end local dupe = false for f in factions() do @@ -109,6 +84,7 @@ for _, p in ipairs(players) do end end if not dupe then + num_seeded = num_seeded + 1 f = seed(start, p.email, p.race or "human", p.lang or "de") print("new faction ".. tostring(f) .. " starts in ".. tostring(start)) table.insert(newbs, f)