More pit woes
Posted: Mon Jan 13, 2014 8:00 pm
Hi everyone - you'll be pleased to know I'm a total newbie to modding and Lua, so expect a few daft questions....although I have done my best to scour the forums for the answers beforehand. Have to say, I've really enjoyed reading the forum posts and have found this resource really useful. I'm still lifting chunks of code, but the undrlying logic is starting to become clear...
Anyway, I have a puzzle problem I can't work out:
1) I'm setting up a puzzle whereby stepping on a series of pressure plates closes pits in an area behind a grating, (although stepping on the wrong ones opens them all again).
2) When the final 'correct' pressure plate is used, a gate opens allowing access to that area; however the pits do not all have to be closed in order for the player to get to the centre - they're really just a visual cue to show them from behind the grating how far they are through the puzzle.
The problem I have is that I was trying to set up connectors from pits to a script entity; I started by imagining I could steal the 'combination puzzle' script and have a script entity looking at the state of 8 pits, only activting the door when they were all closed. But then I realised that pits don't have connectors in the inspector, and I came unstuck when trying to code this.
I also thought about using a counter linked to the plates to decrement the counter - but then the player could just step on the plate 8 times. I see the inspector features an option to 'activate once', but ideally I want the pressure plates to reset as well, (and start decrementing again) if the player steps on the WRONG pressure plate, (with the result of opening all pits and sending them back to square 1).
I'm sure there's a very simple explaination but I can't see the wood for the trees at present!
Anyway, I have a puzzle problem I can't work out:
1) I'm setting up a puzzle whereby stepping on a series of pressure plates closes pits in an area behind a grating, (although stepping on the wrong ones opens them all again).
2) When the final 'correct' pressure plate is used, a gate opens allowing access to that area; however the pits do not all have to be closed in order for the player to get to the centre - they're really just a visual cue to show them from behind the grating how far they are through the puzzle.
The problem I have is that I was trying to set up connectors from pits to a script entity; I started by imagining I could steal the 'combination puzzle' script and have a script entity looking at the state of 8 pits, only activting the door when they were all closed. But then I realised that pits don't have connectors in the inspector, and I came unstuck when trying to code this.
I also thought about using a counter linked to the plates to decrement the counter - but then the player could just step on the plate 8 times. I see the inspector features an option to 'activate once', but ideally I want the pressure plates to reset as well, (and start decrementing again) if the player steps on the WRONG pressure plate, (with the result of opening all pits and sending them back to square 1).
I'm sure there's a very simple explaination but I can't see the wood for the trees at present!