(WIP) Curious Conundrum / CFD 2012 submission

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
User avatar
Redweaver
Posts: 68
Joined: Tue Dec 04, 2012 1:13 am
Location: Illinois, USA

(WIP) Curious Conundrum / CFD 2012 submission

Post by Redweaver »

WARNING! SPOILERS! WARNING! SPOILERS!

Everything in this thread is to be considered a spoiler for my CFD submission.

SKIP TO PAGE 7 OR BEYOND to avoid spoilers and leave feedback!




I'm making a thread to ask for help getting my submission together and playtested. I'm a total noob at scripting, but I've used RPGMaker software to make games before and way back when I used to hand type BASIC code from magazines to "make" games for my C64. So I got a bit of background with what I'm doing. I hope I can learn a lot without causing too many grey hairs, but I think it's appropriate to set some expectations so anyone who knows themselves well enough to know they don't have the temperment to deal with teaching a noob can save themselves some headaches.

If you got through that and you think you'd like to help, then let's get going!

Major spoilers start now and I won't make any further mention of this. Past this point, I'm laying it all out there.





The main puzzle basically revolves around putting the correct three items into the correct three of six alcoves. This then opens the exit door. The tricky bit is there is a second "correct" solution that will open the way to a fourth object that will be placed into a mouth socket, which will then open a door to a nice prize to take with you. And the final twist is that all incorrect solutions will damage the party with one of the elemental spells or spawn a monster or something like that.

So, that's what I need help with.

I've already got this script:

Code: Select all

function checkAlcoveForItems()
   local itemFound = false


   if puzzle_pit_alcove:getItemCount() == 0 then
      itemFound = false
   else
      for i in puzzle_pit_alcove:containedItems() do
         if i.name == "golden_chalice" then
            itemFound = true
            break
         else
            spawn("poison_cloud", party.level, party.x, party.y, 0)
            itemFound = false
            break
         end
      end
   end
      if itemFound then
         playSound("level_up")
         puzzle_pit:deactivate()
      else
         puzzle_pit:activate()
      end
end
functioning and lovely in another dungeon I'm working on. And I saw another thread with a generic script to make the same thing happen with multiple alcoves/items. Hopefully I can figure out how to finagle the two together. Making the second solution work is something else altogether.

That's it for now. I have a pretty short deadline so hopefully the next couple of days can be productive. Thanks!
Last edited by Redweaver on Fri Dec 07, 2012 3:35 am, edited 2 times in total.
My finished mods:
A Curious Conundrum http://grimrock.nexusmods.com/mods/135 also on Steam Workshop

Current WIP:
Lair of Unarak http://grimrock.nexusmods.com/mods/137
User avatar
Brodie301
Posts: 286
Joined: Sun Apr 08, 2012 6:00 pm
Location: Mississippi, USA

Re: (WIP) Curious Conundrum / CFD 2012 submission

Post by Brodie301 »

Oh I thought you said "newb" that script doesn't look like a newbs.
The FORCE is with me!!!
User avatar
Redweaver
Posts: 68
Joined: Tue Dec 04, 2012 1:13 am
Location: Illinois, USA

Re: (WIP) Curious Conundrum / CFD 2012 submission

Post by Redweaver »

It only looks that good because I copy/paste and edit well. That script basically belongs to petri.

*edit*

Or was it Komag? I dunno, thank the superthread :lol:
My finished mods:
A Curious Conundrum http://grimrock.nexusmods.com/mods/135 also on Steam Workshop

Current WIP:
Lair of Unarak http://grimrock.nexusmods.com/mods/137
User avatar
Brodie301
Posts: 286
Joined: Sun Apr 08, 2012 6:00 pm
Location: Mississippi, USA

Re: (WIP) Curious Conundrum / CFD 2012 submission

Post by Brodie301 »

I'm away from comp for the night, lurking on iPad, I have a couple alcove scripts in a couple dungeons I can get to tomorrow evening. Also, @spiderfighter may be of some assistance, his sub has a similar puzzle but yours takes it a little further.
The FORCE is with me!!!
User avatar
Redweaver
Posts: 68
Joined: Tue Dec 04, 2012 1:13 am
Location: Illinois, USA

Re: (WIP) Curious Conundrum / CFD 2012 submission

Post by Redweaver »

Code: Select all

Area layout
                |  |
                |  |
      Wall text |  |
         Alcove |  | Alcove  Set 3
                |  |
      Wall text |  |
         Alcove |  | Alcove  Set 2
                |  |
      Wall text |  |
         Alcove |  | Alcove  Set 1
                |  |
There are a red, a blue and a green gem that need to be placed into the correct alcoves. So solution one which opens the exit could be set 1, west alcove, blue; set 2, east alcove, red; set 3, west alcove, green, for instance. Then say, set 1, west, green, set 2, west, red and set 3, east, blue could be the second solution that opens the prize.

To give an idea of what the end result needs to be.

Seems like I'll have to copy/paste the entire script into the entity a second time and edit the later one to reflect the second solution, maybe? That seems really ham-handed and inelegant, though. Is there a way to make that for loop check for this item OR that item? Hmmmm. :?


How do I make the temple_ceiling_light glow a different color? I need to make it both more blue and less blue/more like a regular warm white lightbulb?
Last edited by Redweaver on Tue Dec 04, 2012 6:33 am, edited 1 time in total.
My finished mods:
A Curious Conundrum http://grimrock.nexusmods.com/mods/135 also on Steam Workshop

Current WIP:
Lair of Unarak http://grimrock.nexusmods.com/mods/137
User avatar
msyblade
Posts: 792
Joined: Fri Oct 12, 2012 4:40 am
Location: New Mexico, USA
Contact:

Re: (WIP) Curious Conundrum / CFD 2012 submission

Post by msyblade »

You can simply make a "counter" and set it's value to six. in your script above, you can do it simpler, like so. Set one for each alcove, make sure they are set to "decrement" on action. Then set up each alcove to increment on deactivation (If the item is picked up). After 6 decrements are triggered and the counter hits 0, it activates. (btw counters activate when they hit 0), and connect the COUNTER to the door/trap/whatever.

function checkAlcoveForItems()
local itemFound = false


if puzzle_pit_alcove:getItemCount() == 0 then
for i in puzzle_pit_alcove:containedItems() do
if i.name == "golden_chalice" then
your_counter_1: decrement

end
end


ps, i haven't tested this!! pretty sure it's good tho
Last edited by msyblade on Tue Dec 04, 2012 6:47 am, edited 1 time in total.
Currently conspiring with many modders on the "Legends of the Northern Realms"project.

"You have been captured by a psychopathic diety who needs a new plaything to torture."
Hotel Hades
User avatar
Redweaver
Posts: 68
Joined: Tue Dec 04, 2012 1:13 am
Location: Illinois, USA

Re: (WIP) Curious Conundrum / CFD 2012 submission

Post by Redweaver »

msyblade wrote:You can simply make a "counter" and set it's value to six. in your script above, you can do it simpler, like so. Set one for each alcove, make sure they are set to "decrement" on action. Then set up each alcove to increment on deactivation (If the item is picked up). After 6 decrements are triggered and the counter hits 0, it activates. (btw counters activate when they hit 0), and connect the COUNTER to the door/trap/whatever.

function checkAlcoveForItems()
local itemFound = false


if puzzle_pit_alcove:getItemCount() == 0 then
for i in puzzle_pit_alcove:containedItems() do
if i.name == "golden_chalice" then
your_counter_1: decrement


ps, i haven't tested this!! pretty sure it's good tho


Hmmmm...that doesn't feel like a fit. There's 6 alcoves, but only 3 items to place...and there needs to be 2 different exactly correct solutions. I think what you suggest would work for a puzzle with a more generic solution...but how would I decrement that counter to open the exit but another to open the prize?

I'm going to start making the script entity and see if I can mash it about some.

Can I make a single entity and point all the alcoves at it to wait for the right solutions to be plugged in, or will I need to make a script for each alcove?
My finished mods:
A Curious Conundrum http://grimrock.nexusmods.com/mods/135 also on Steam Workshop

Current WIP:
Lair of Unarak http://grimrock.nexusmods.com/mods/137
User avatar
msyblade
Posts: 792
Joined: Fri Oct 12, 2012 4:40 am
Location: New Mexico, USA
Contact:

Re: (WIP) Curious Conundrum / CFD 2012 submission

Post by msyblade »

Each alcove, definitely. You can likely (it will hurt your head), make 2 or 3 counters, that increment and decrement seperately, both set to 3, but one connects to prize, other counter connects to other.So, six scripts, 3 pointing to one counter, 3 pointing to the other. But you can do multiple things with one script, Like, I have this simple one with 4 connectors

Code: Select all

function a()
	
	for i in danivaltar:containedItems() do
		if i.name == "remains_of_daniv" then
			danivdoor1: open()
			danivdoor2: open()
			se27: danivshake()
			teleporter_6: activate()
		break
		end
	end
end
Currently conspiring with many modders on the "Legends of the Northern Realms"project.

"You have been captured by a psychopathic diety who needs a new plaything to torture."
Hotel Hades
User avatar
Redweaver
Posts: 68
Joined: Tue Dec 04, 2012 1:13 am
Location: Illinois, USA

Re: (WIP) Curious Conundrum / CFD 2012 submission

Post by Redweaver »

Maybe here's a way to cut the number of script entities needed. Let the player place the gems in whichever alcoves s/he thinks is right, then pull a lever which calls the script to then check if the solution is right and if not, damage. Can I make that happen with one script that has 2 for loops, one checking for the exit solution, the other loop checking for the prize solution, both dumping to damage if false?
My finished mods:
A Curious Conundrum http://grimrock.nexusmods.com/mods/135 also on Steam Workshop

Current WIP:
Lair of Unarak http://grimrock.nexusmods.com/mods/137
User avatar
msyblade
Posts: 792
Joined: Fri Oct 12, 2012 4:40 am
Location: New Mexico, USA
Contact:

Re: (WIP) Curious Conundrum / CFD 2012 submission

Post by msyblade »

You can!! You are definitely a modder. You've got your head around this. Lemme go look through the threads and I'll find you one like that. I'm gonna pm you with a base script. Cant test it right now, either. but I think you're gonna be fine, you just need the syntax. Check out this page from JKos too!

https://sites.google.com/site/jkosgrimr ... heat-sheet
Currently conspiring with many modders on the "Legends of the Northern Realms"project.

"You have been captured by a psychopathic diety who needs a new plaything to torture."
Hotel Hades
Post Reply