[MOD] Call Of House Hardabar

Are you looking for fun Custom Dungeons that you could play or do you want to share your mod with others? Then this forum is for you!
User avatar
sapientCrow
Posts: 608
Joined: Sun Apr 22, 2012 10:57 am

Re: [MOD] Call Of House Hardabar

Post by sapientCrow »

olavimuff.ee wrote: Wed Jul 12, 2023 7:23 am
sapientCrow wrote: Wed Jul 12, 2023 12:33 am
olavimuff.ee wrote: Tue Jul 11, 2023 11:32 pm I reloaded previous save to find out jean bart letter 7 which was not digged up yet. That code didnt find it until I digged it up.

So digging will create item, not teleporting these from below or something. Such thing may happen with other items too in other conditions.
the Jean Bart items are numerical so they cant be found sadly. it sucks.

the chest is out on Guagamiel fields on the side with red barrier in corner.
according to the search code the last gem of the moon is in it
OO, I wonder how did you found it. I have searched all sides previously, but somehow I skipped that edge there.

Next mysterious key needed, maybe digging up whole area to find it. :D

I think you cant find buried things. Or you managed to find that gem before you digged up this chest?
Yes you can find it buried as long as it has the name ID not the number ID. No items that come from script can be found either.
managed to get a message back from Bongo who confirmed the Lightning Core is for the Testing area in Stargate. Now waiting on a response to the major questions ... how to use it correctly, purple giants, droid disk, forge, jewelled bell, golden flower and that key.

I have 307/319 secrets right now and am pretty much at the point of no return in Black Reach
olavimuff.ee
Posts: 194
Joined: Thu Aug 08, 2019 12:17 pm

Re: [MOD] Call Of House Hardabar

Post by olavimuff.ee »

I wonder how did you know that Aldon maric key is needed for that chest.

With a code you can find its location.

Code: Select all

do 
	local_item_id = "aldon_maric_treasure_key" 
	
	for index = 1, Dungeon:getMaxLevels() do 
		for item in Dungeon.getMap(index):allEntities() do 
			if item.name == local_item_id then 
				hudPrint("A matching item was found in "..item.map:getName().." ".."(level "..item.level..") @ tile X:"..tostring(item.x)..",Y:"..tostring(item.y))
				playSound("secret") party:spawn('blob') 
				return 	
			end 
		end 
	end 
	hudPrint("No matching item was found")
end
olavimuff.ee
Posts: 194
Joined: Thu Aug 08, 2019 12:17 pm

Re: [MOD] Call Of House Hardabar

Post by olavimuff.ee »

Ok, I modified a code, now you dont need to know its full name, only part of it. Idk what to do with items yet which have only its numeric id.
SpoilerShow
Following code should search all items which name includes "key":

Code: Select all

do 
	for index = 1, Dungeon:getMaxLevels() do 
		for item in Dungeon.getMap(index):allEntities() do 
			str = item.name 
			match = string.find( str, "key") 
			if match ~= nil then 
				hudPrint("A matching item (".. item.name ..") was found in "..item.map:getName().." ".."(level "..item.level..") @ tile X:"..tostring(item.x)..",Y:"..tostring(item.y)) 
				playSound("secret") party:spawn('blob') 
				return 	
			end 
		end 
	end 
	hudPrint("No matching item was found") 
end
User avatar
sapientCrow
Posts: 608
Joined: Sun Apr 22, 2012 10:57 am

Re: [MOD] Call Of House Hardabar

Post by sapientCrow »

olavimuff.ee wrote: Wed Jul 12, 2023 10:18 am Ok, I modified a code, now you dont need to know its full name, only part of it. Idk what to do with items yet which have only its numeric id.
SpoilerShow
Following code should search all items which name includes "key":

Code: Select all

do 
	for index = 1, Dungeon:getMaxLevels() do 
		for item in Dungeon.getMap(index):allEntities() do 
			str = item.name 
			match = string.find( str, "key") 
			if match ~= nil then 
				hudPrint("A matching item (".. item.name ..") was found in "..item.map:getName().." ".."(level "..item.level..") @ tile X:"..tostring(item.x)..",Y:"..tostring(item.y)) 
				playSound("secret") party:spawn('blob') 
				return 	
			end 
		end 
	end 
	hudPrint("No matching item was found") 
end
oh sweet does it find disk droid?
User avatar
sapientCrow
Posts: 608
Joined: Sun Apr 22, 2012 10:57 am

Re: [MOD] Call Of House Hardabar

Post by sapientCrow »

that one just grabs first entity which be wall or other clickable too

aldon_maric one does not return the value.
where did you find it?
olavimuff.ee
Posts: 194
Joined: Thu Aug 08, 2019 12:17 pm

Re: [MOD] Call Of House Hardabar

Post by olavimuff.ee »

sapientCrow wrote: Wed Jul 12, 2023 2:39 pm that one just grabs first entity which be wall or other clickable too

aldon_maric one does not return the value.
where did you find it?
You remember that secret issue in xaafi temple? It looks like that lantern have properties of xaafi temple key or something instead of key. Thats why this secret doesnt activate when you getting key. A tiny bug in the mod. :D

And yes, this code crabs first match and dont run after that. This code looks to be written in a lua format and I dont understand it very well.

With this code you can skip that lantern "key":

Code: Select all

do 
	for index = 1, Dungeon:getMaxLevels() do 
		for item in Dungeon.getMap(index):allEntities() do 
			str = item.name 
			match = string.find( str, "key") 
			if match ~= nil and item.name ~= "skycity_tomb_wall_lantern_key" then 
				hudPrint("A matching item (".. item.name ..") was found in "..item.map:getName().." ".."(level "..item.level..") @ tile X:"..tostring(item.x)..",Y:"..tostring(item.y)) 
				playSound("secret") party:spawn('blob') 
				return 	
			end 
		end 
	end 
	hudPrint("No matching item was found") 
end
As you notice there is extra strings - and item.name ~= "skycity_tomb_wall_lantern_key" - Replace or add new part of string to skip that one what you dont wanna find anymore.

NB! Every line must end with space symbol. This looks to be important because in the command line it will remove line change symbol and then code can be messed up.
User avatar
sapientCrow
Posts: 608
Joined: Sun Apr 22, 2012 10:57 am

Re: [MOD] Call Of House Hardabar

Post by sapientCrow »

olavimuff.ee wrote: Wed Jul 12, 2023 7:48 pm
sapientCrow wrote: Wed Jul 12, 2023 2:39 pm that one just grabs first entity which be wall or other clickable too

aldon_maric one does not return the value.
where did you find it?
You remember that secret issue in xaafi temple? It looks like that lantern have properties of xaafi temple key or something instead of key. Thats why this secret doesnt activate when you getting key. A tiny bug in the mod. :D

And yes, this code crabs first match and dont run after that. This code looks to be written in a lua format and I dont understand it very well.

With this code you can skip that lantern "key":

Code: Select all

do 
	for index = 1, Dungeon:getMaxLevels() do 
		for item in Dungeon.getMap(index):allEntities() do 
			str = item.name 
			match = string.find( str, "key") 
			if match ~= nil and item.name ~= "skycity_tomb_wall_lantern_key" then 
				hudPrint("A matching item (".. item.name ..") was found in "..item.map:getName().." ".."(level "..item.level..") @ tile X:"..tostring(item.x)..",Y:"..tostring(item.y)) 
				playSound("secret") party:spawn('blob') 
				return 	
			end 
		end 
	end 
	hudPrint("No matching item was found") 
end
As you notice there is extra strings - and item.name ~= "skycity_tomb_wall_lantern_key" - Replace or add new part of string to skip that one what you dont wanna find anymore.

NB! Every line must end with space symbol. This looks to be important because in the command line it will remove line change symbol and then code can be messed up.
guess would have to loop the output and then send it to a log file

still waiting for Bongo and in the meantime i started over ... haha
User avatar
Isaac
Posts: 3179
Joined: Fri Mar 02, 2012 10:02 pm

Re: [MOD] Call Of House Hardabar

Post by Isaac »

What —exactly— are you wanting to find? Are you just looking for keys?

*Also, Bongobeat browsed the forums here as recent as yesterday, so he is certainly still around. ;)
User avatar
sapientCrow
Posts: 608
Joined: Sun Apr 22, 2012 10:57 am

Re: [MOD] Call Of House Hardabar

Post by sapientCrow »

Isaac wrote: Thu Jul 13, 2023 12:46 am What —exactly— are you wanting to find? Are you just looking for keys?

*Also, Bongobeat browsed the forums here as recent as yesterday, so he is certainly still around. ;)
SpoilerShow
Droid disk 2 for the second droid for forge of ix access, aldon maric key for chest in Gaug fields, how to use lightning core for access to testing in stargate area (this core crashes always on a certain call with the log below), the purple giants guarding jean Bart testament 8, and what jewelled bell and golden flower are for.
those are my main mysteries
the code was to find where the droid disk was and sadly the testament is numerical.

log error for lightning core:

Code: Select all

=== Software Failure ===
mod_assets/scripts/dialogues.lua:1707: attempt to index global 'blue_mountain_sky_1' (a nil value)
stack traceback:
mod_assets/scripts/dialogues.lua:1707: in function 'InCor17'
mod_assets/scripts/items_misc.lua:5411: in function <mod_assets/scripts/items_misc.lua:5382>
[string "Component.lua"]: in function 'callHook'
[string "Champion.lua"]: in function 'attack'
[string "AttackPanel.lua"]: in function 'select'
[string "AttackPanel.lua"]: in function 'drawItemSlot'
[string "AttackPanel.lua"]: in function 'updateAttackButtons'
[string "AttackPanel.lua"]: in function 'update'
[string "AttackPanel.lua"]: in function 'update'
[string "Gui.lua"]: in function 'draw'
[string "GameMode.lua"]: in function 'update'
[string "Grimrock.lua"]: in function 'display'
[string "Grimrock.lua"]: in main chunk
User avatar
Isaac
Posts: 3179
Joined: Fri Mar 02, 2012 10:02 pm

Re: [MOD] Call Of House Hardabar

Post by Isaac »

sapientCrow wrote: Wed Jul 12, 2023 7:42 am ...the Jean Bart items are numerical so they cant be found sadly. it sucks.
...Yes you can find it buried as long as it has the name ID not the number ID. No items that come from script can be found either.
The only items that cannot be found (afaik) are the ones that have been destroyed, and those that not been spawned yet from a dynamic script. Anything already in the dungeon can be found; numerical id strings can't really be used to filter the search, but one can filter a search with other object attributes besides the id.

For instance, most keys have the trait "key", and customized items usually have a custom UI name in addition to an object id.

So here, this will detect the exposed Jean Bart items:

Code: Select all

do 
	search_term = "Bart" 
 
	keys = {} 
	keyList = party:spawn("scroll").id 
	scroll_text = "" 

	for lvl = 1, Dungeon.getMaxLevels() do 	
		for item in Dungeon.getMap(lvl):allEntities() do  
			if item and item.item and (item.item:getUiName():match(search_term,1) or item.name:match(search_term,1)) then 
				keys[#keys+1] = tostring(item.item:getUiName().." | id:"..tostring(item.id).." | found on level "..item.level.." @ tile x"..item.x..', y'..item.y) 
			 
			elseif item and item.containeritem then 
				for k = 1, item.containeritem:getCapacity() do 
					local itm = item.containeritem:getItem(k) 
			 		if itm and itm.go and (itm.go.item:getUiName():match(search_term,1) or itm.go.name:match(search_term,1)) then 
						keys[#keys+1] = tostring(itm.go.item:getUiName().." | id:"..tostring(itm.go.id).." | found inside "..item.name.." on level "..item.level.." @ tile x"..item.x..', y'..item.y) 
					end 
				end 
			end 
		end 
	end 

	for eachKey = 1, #keys do 
		scroll_text = scroll_text..keys[eachKey].."\n"
	end 
	scroll = findEntity(keyList) 
	if scroll then 
		scroll.item:setUiName("Item Cheat List") 
		scroll.scrollitem:setTextAlignment('left') 
		scroll.scrollitem:setScrollText(scroll_text) 
		if #scroll.scrollitem:getScrollText() == 0 then scroll:destroyDelayed() hudPrint("No Results") playSound("spell_fizzle") return 
		 else party:spawn('blob') 
	    end 
	end 
	if scroll and getMouseItem() == nil then
	 	setMouseItem(scroll.item) 
	end 
	hudPrint("Found "..tostring(#keys).." items")
	keys = nil 
end   
Image

You can change the search_term to whatever string you want. This script searches the floor and inside of container items for anything matching the search_term in either the object.name or the uiName.

* Quick tip: After pasting the script into the console, press the <Home> key to jump to the beginning of the line. This makes it very easy to edit the search_term; press <Enter> when done, to see the results. ;)
_________________________

This version will detect all of the keys (that have the 'key' trait):

Code: Select all

 do 
	keys = {} 
	keyList = party:spawn("scroll").id 
	scroll_text = "" 

	for lvl = 1, Dungeon.getMaxLevels() do 	
		for item in Dungeon.getMap(lvl):allEntities() do  
			if item and item.item and item.item:hasTrait("key") then 
				keys[#keys+1] = tostring(item.item:getUiName().." | id:"..tostring(item.id).." | found on level "..item.level.." @ tile x"..item.x..', y'..item.y) 
			 
			elseif item and item.containeritem then 
				for k = 1, item.containeritem:getCapacity() do 
					local itm = item.containeritem:getItem(k) 
			 		if itm and itm.go and itm.go.item:hasTrait("key") then 
						keys[#keys+1] = tostring(itm.go.item:getUiName().." | id:"..tostring(itm.go.id).." | found inside "..item.name.." on level "..item.level.." @ tile x"..item.x..', y'..item.y) 
					end 
				end 
			end 
		end 
	end 

	for eachKey = 1, #keys do 
		scroll_text = scroll_text..keys[eachKey].."\n"
	end 
	scroll = findEntity(keyList) 
	if scroll then 
		scroll.item:setUiName("Cheat List of Keys") 
		scroll.scrollitem:setTextAlignment('left') 
		scroll.scrollitem:setScrollText(scroll_text) 
		if #scroll.scrollitem:getScrollText() == 0 then scroll:destroyDelayed() hudPrint("No Results") playSound("spell_fizzle") return 
		 else party:spawn('blob') 
	    end 
	end 
	if scroll and getMouseItem() == nil then
	 	setMouseItem(scroll.item) 
	end 
	hudPrint("Found "..tostring(#keys).." keys")
	keys = nil 
end  
*Of course these are quite abusive cheats. ;)
Last edited by Isaac on Thu Jul 13, 2023 10:19 am, edited 7 times in total.
Post Reply