1.4 Beta6 testing! GOGOGO!

Everything about ToME 4.x.x. No spoilers, please

Moderator: Moderator

Message
Author
Zireael
Archmage
Posts: 449
Joined: Tue Jun 18, 2013 7:24 pm

Re: 1.4 Beta6 testing! GOGOGO!

#166 Post by Zireael »

The force_ego filter looks hopelessly broken - Lua errors complaining that 'egos' is nil - so I've managed to fix it by doing the following in Zone.lua:

Code: Select all

--line 308
local pick_force_ego = function(self, level, e, eegos, egos_list, type, picked_etype, etype, name)
	local egos = e.egos and level:getEntitiesList(type.."/"..e.egos..":"..etype)

    if not egos then
		if add_levels == nil then
		egos = self:generateEgoEntities(level, type, etype, eegos, e.__CLASSNAME)
		else
			egos = self:generateEgoEntities(level, type, etype, eegos, e.__CLASSNAME, add_levels)
		end
	end

	--Pick the one whose name matches
	egos_list[#egos_list+1] = self:pickNamedEntity(egos, name)

	if egos_list[#egos_list] then print("Picked ego", type.."/"..eegos..":"..etype, ":=>", egos_list[#egos_list].name) else print("Picked ego", type.."/"..eegos..":"..etype, ":=>", #egos_list) end

end

function _M:pickNamedEntity(list, name)
	if #list == 0 then return nil end
	local r = rng.range(1, list.total)
	for i = 1, #list do
--		print("test", r, ":=:", list[i].genprob)
		if list[i].e.name == name then
	--	if r <= list[i].genprob then
--			print(" * select", list[i].e.name)
			return list[i].e
		end
	end
	return nil
end

--line 605
pick_force_ego(self, level, e, e.egos, egos_list, type, {}, "", name)

--    local egos = level:getEntitiesList(type.."/base/"..e.egos..":")
--    egos_list = {egos[name]}

Zizzo
Sher'Tul Godslayer
Posts: 2525
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: 1.4 Beta6 testing! GOGOGO!

#167 Post by Zizzo »

Zireael wrote:The force_ego filter looks hopelessly broken - Lua errors complaining that 'egos' is nil - [...]
Yeah, I had to fight the force_ego filter in Nur Kit to get it to create the water-breathing items I wanted. You can look at its Zone.lua to see how I worked around it. (Didn't have this problem in the T2 module, fortunately, since I was already rewriting object generation pretty much from scratch.)
"Blessed are the yeeks, for they shall inherit Arda..."

Zireael
Archmage
Posts: 449
Joined: Tue Jun 18, 2013 7:24 pm

Re: 1.4 Beta6 testing! GOGOGO!

#168 Post by Zireael »

I guess it's too late for 1.4.0, but one of those fixes should make it into the engine.

The only reason force_ego brokenness wasn't noticed earlier was probably the fact only one artifact in ToME uses it.

Post Reply