[DEVELOPER DISCUSSION] One Room Round Robin 2 (SPOILERS)

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
User avatar
Isaac
Posts: 3185
Joined: Fri Mar 02, 2012 10:02 pm

Re: [OPEN - SIGNUP / DISCUSS] One Room Round Robin 2!

Post by Isaac »

SpiderFighter wrote:It's not that important that it loops, just would have been nice. Overall, it doesn't really affect the gameplay though.
If you wanted it to loop ~but also stop, you might try scripting it to play a few times with consecutive calls.
User avatar
Skuggasveinn
Posts: 562
Joined: Wed Sep 26, 2012 5:28 pm

Re: [OPEN - SIGNUP / DISCUSS] One Room Round Robin 2!

Post by Skuggasveinn »

@spiderfighter
playSoundAt command is not good for looping sounds for several reasons, it plays on every level like you have found out, it stops when you load a saved game, It can stop if you are traveling between floors etc etc.
If you peek into my room you will see I use doors to play sounds at locations.

Code: Select all

cloneObject{
   name = "sx_sound_water",
   baseObject = "dungeon_wall_grating",
   --class = "Door",
	model = "mod_assets/models/sx_blocker.fbx",        --this is a invisible model
   openSound = "sx_silent",        -- the open sound is a silent wav file
   closeSound = "sx_silent",        -- close sound is also silent
   lockSound = "sx_waterfall",        -- this is the sound I want looped
   openVelocity = 100,        -- Velocity is high, meaning the door will open/close almost instant, playing the lockedSound almost instant also
   --closeVelocity = 100,
   --closeAcceleration = -10,
   --sparse = true,
   --placement = "wall",
   editorIcon = 88,        -- I use this icon so its easier for me to find in the editor 
}
some attributes have commented out with -- , can't rememer why but I remember it was an ingenious revelation to the betterment of the solution :)

The good thing using doors for looping sound is that is doesn't play on every level, it can be triggered with a simple toggle ( sx_sound_water:toggle )
The bad thing about using doors for sound location is that its a door, meaning it can't be placed in the walkway of the party, always line it up against walls or where the party can never walk into it since triggering it closed will stop the party from moving.
I use hidden plates when the party walks into my room to trigger the sounds, when the party changes floors I don't need to worry about sounds leaking through, If you want to make it save game proof you can create a script that detects the party level number, and toggle the sound doors at the level.

This was talked about in an old thread that I can't find atm, can't remember how originally came up with this way, but it works 90% of the time all the time :D

in your case spider you can have the open sound your looping sound and make the door really really slow in opening, if you want it stopped you have the closing sound silent sound and toggle the door from open to closing state, something like that.

Skuggasveinn.
Link to all my LoG 2 assets on Nexus.
Link to all my LoG 1 assets on Nexus.
User avatar
SpiderFighter
Posts: 789
Joined: Thu Apr 12, 2012 4:15 pm

Re: [OPEN - SIGNUP / DISCUSS] One Room Round Robin 2!

Post by SpiderFighter »

@Isaac and Skuggas: Wow, thanks guys! The using of doors is a pretty ingenious concept. At this point though, the looping sound is merely cosmetic and I still have one more puzzle to construct and another game-breaking glitch to repair. I may attempt looping them again if I have time (thanks for the code and help, Skuggas!), but my time right now is so limited that I need to get the other things done first.
User avatar
JKos
Posts: 464
Joined: Wed Sep 12, 2012 10:03 pm
Location: Finland
Contact:

Re: [OPEN - SIGNUP / DISCUSS] One Room Round Robin 2!

Post by JKos »

I made a simple script which can be used to list different types of entities in dungeon:

Code: Select all

enabled = false
result = {}

function entities(eClass)	
	result = {}
	grimq.fromAllEntitiesInWorld():where(
		function(e) 
			if e.class and e.class == eClass then
				table.insert(result,e.name..' X:'..e.x..', Y:'..e.y..', L:'..e.level..', ID:'..e.id)
			end 
		end
	)
	enabled = true
end

function sort()
	table.sort(result)
end

function items(type)	
	result = {}

	grimq.fromAllEntitiesInWorld():where(
		function(e) 
			if e.class and e.class == 'Item' then
			 	if not type or fw.lists['item'][type][e.name] then
					if type == 'weapon' and e.name == 'torch' then else
						table.insert(result,e.name..' X:'..e.x..', Y:'..e.y..', L:'..e.level..', ID:'..e.id)
					end
				end
			end 
		end
	)
	enabled = true
end

function disable()
	enabled = false
end

function draw(g)
    local currentCol = 0
	local count = #result
	local row = 1
	for i = 1, count do
	    local col = math.floor(i/40)
		if currentCol ~= col then
			row = 1
			currentCol = col
		end
		g.drawText(result[i], 20 + (col * 500), 20*row)
		row = row + 1
	end
end
name it for example to a report and add this to the party_onDrawGui-hook

Code: Select all

	if report.enabled then
		report.draw(g)
	end
Usage example (type in in console)

report.entities('Monster') lists all monsters, this is trivial of course but item function is more useful
report.items('potion') -- lists all potions (native only)
report.items('weapon') -- lists all melee weapons (native only)
report.items('armor') -- lists all armors (native only)
report.items('custom') -- lists all custom items
All supported item subtypes are: weapon,shield,accessory,bomb,food,missileweapon,tome,armor,cloth,herb,machinepart,potion,staff,treasure,container,key,miscitem,scroll,throwingweapon

report.sort() -- sorts the result in alphabetical order by entity name
report.disable() --closes the report

I thought that this could be useful for balancing the dungeon so I post it here. I wish that there was a way to print these in file, would be much more useful.
- LoG Framework 2http://sites.google.com/site/jkoslog2 Define hooks in runtime by entity.name or entity.id + multiple hooks support.
- cloneObject viewtopic.php?f=22&t=8450
User avatar
Isaac
Posts: 3185
Joined: Fri Mar 02, 2012 10:02 pm

Re: [OPEN - SIGNUP / DISCUSS] One Room Round Robin 2!

Post by Isaac »

JKos wrote:I thought that this could be useful for balancing the dungeon so I post it here. I wish that there was a way to print these in file, would be much more useful.
I thought there was a way to crash the game and print variables to the crash dump; perhaps I had it wrong... It's been a while since I thought I read that somewhere.
User avatar
Diarmuid
Posts: 807
Joined: Thu Nov 22, 2012 6:59 am
Location: Montreal, Canada
Contact:

Re: [OPEN - SIGNUP / DISCUSS] One Room Round Robin 2!

Post by Diarmuid »

Thank you for that, fantastic!

I already went ahead with some such balancing helpers. The room structure also allows for some more precise info, and here are some useful stuff you can use:

By room iterator:

Code: Select all

for e in orrrManager.entitiesInRoom(room) do
   [...]
end
Premade functions using that iterator:

Code: Select all

local t = orrrManager.getListOfItems(room)
local t = orrrManager.getListOfMonsters(room)
orrrManager.printItemsInRoom(room)
orrrManager.printMonstersInRoom(room)
Here's an example output:
SpoilerShow
Image
They all work from the console as well.

@Isaac, yes, Xanathar made that up.
User avatar
SpiderFighter
Posts: 789
Joined: Thu Apr 12, 2012 4:15 pm

Re: [OPEN - SIGNUP / DISCUSS] One Room Round Robin 2!

Post by SpiderFighter »

Still working on mine, having trouble implementing a puzzle...and I have a wall text that refuses to display properly in the main corridor for some odd reason.

Other than that, I wanted to say that it's possible I may lose internet today at some point (threatening to shut me off via robot phone call) but if it happens, I'll get it turned back on tomorrow.
User avatar
JKos
Posts: 464
Joined: Wed Sep 12, 2012 10:03 pm
Location: Finland
Contact:

Re: [OPEN - SIGNUP / DISCUSS] One Room Round Robin 2!

Post by JKos »

To Diarmuid: should have guessed that you already made something similar :) But I got an idea how I could save the report to the file in csv format so it could be opened in excel, and how to get all items (except dynamically spawned) in the report. I just need to kill all monsters and then run the report and store it as a scroll text. Then I have to save the game and use save converter viewtopic.php?f=14&t=3544&p=36181 to convert it to a dat file. Then I could just copy paste the report to another file. I could do this if you think it would be helpful? Shouldn't be too much work.
- LoG Framework 2http://sites.google.com/site/jkoslog2 Define hooks in runtime by entity.name or entity.id + multiple hooks support.
- cloneObject viewtopic.php?f=22&t=8450
User avatar
Diarmuid
Posts: 807
Joined: Thu Nov 22, 2012 6:59 am
Location: Montreal, Canada
Contact:

Re: [OPEN - SIGNUP / DISCUSS] One Room Round Robin 2!

Post by Diarmuid »

JKos wrote:To Diarmuid: should have guessed that you already made something similar :) But I got an idea how I could save the report to the file in csv format so it could be opened in excel, and how to get all items (except dynamically spawned) in the report. I just need to kill all monsters and then run the report and store it as a scroll text. Then I have to save the game and use save converter viewtopic.php?f=14&t=3544&p=36181 to convert it to a dat file. Then I could just copy paste the report to another file. I could do this if you think it would be helpful? Shouldn't be too much work.
Could be cool down the road if it really isn't that much work, but we haven't balanced things out yet, so maybe a bit later when we tried a playthrough or two.
User avatar
JKos
Posts: 464
Joined: Wed Sep 12, 2012 10:03 pm
Location: Finland
Contact:

Re: [OPEN - SIGNUP / DISCUSS] One Room Round Robin 2!

Post by JKos »

Well I had to test it anyway, seems to work like I imagined. And it really wasn't that much work, just few lines of script and converting the save game.
- LoG Framework 2http://sites.google.com/site/jkoslog2 Define hooks in runtime by entity.name or entity.id + multiple hooks support.
- cloneObject viewtopic.php?f=22&t=8450
Post Reply