Requesting some specific helpful tips

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Ryeath_Greystalk
Posts: 366
Joined: Tue Jan 15, 2013 3:26 am
Location: Oregon

Re: Requesting some specific helpful tips

Post by Ryeath_Greystalk »

Aleitheo wrote: The second thing is how do I make a script that deletes an item or two (eg: wall button) only when activated (eg: via another button). Basically I want a certain button to no longer trigger when it's purpose has been fulfilled. At the moment I have found the commend that deletes certain objects but don't know how to set it so it only triggers at the appropriate time.
This is a little more difficult to explain without know for sure what you are trying to use to disable the button.
If the button only needs to be pressed once then it is easy, just set for activate once. If the button is controlling a script then just put a check at the beginning. Use a counter set to 0 and do something like

if counter:getValue() == 0 then
-- run script
end

then when the button accomplishes it's job have the result increment the counter so the button will no longer be able to run the function.

Be careful trying to use the destroy command on buttons as I think they are part of the wall and will do some strange things if you get rid of them. Not sure on this though.
Aleitheo
Posts: 14
Joined: Tue Mar 19, 2013 7:59 pm

Re: Requesting some specific helpful tips

Post by Aleitheo »

The secrets are now done.

As for that button I want deleting, the setup is as follows.

The player enters a room full of pits and to their side is a button. when they press this button two of the pits close and a sequence starts where pits open and close indefinitely. If the player attempts to leave the room they walk over a hidden pressure plate that cancels everything and resets it back to normal. Once the player makes their way across the pits and onto solid ground, the sequence stops via a hidden pressure plate and a line of pits back to the entrance close up to form a bridge with all the other pits being open regardless of their state before.

When the player stands on this pressure plate a secret is triggered and the player is granted some XP. Since a bridge is now made across the player no longer needs the button to start the sequence. If the player triggers the button again after this and goes back over again, the bridge will not appear without the consequence of granting the player a way of getting infinite XP and secrets.

Hopefully you get what I am trying to say, I basically want that button at the end that triggers the bridge, secret and XP to also deal with that button and the resetting pressure plate at the beginning of the room. Deleting them isn't entirely necessary if disabling them is possible.
Ryeath_Greystalk
Posts: 366
Joined: Tue Jan 15, 2013 3:26 am
Location: Oregon

Re: Requesting some specific helpful tips

Post by Ryeath_Greystalk »

I understand the setup and there are probably a couple different ways to handle this depending on the control layout our using.

I think the easiest way will be with scripting and using two counters as a flags.

To start set a counter to 0. Connect button to script and trapdoor_counter. Button press increments the counter to 1. Script runs a check

if trapdoor_counter:getValue() == 1 then
trapdoor_timer:activate() -- this is assuming use of timers to toggle pits.
end

This will start the process but have no other effect if the player stands there repeatedly pressing the button. You can use the hidden pressure plate at the exit to reset the counter to 0 which would reset the button for the next press.

Now this creates the problem of the player resetting the button on the way out even if they have solved the puzzle. So one solution to that is force the player to leave via a different route so they avoid resetting the button. Of course your room layout may not allow for that. Which is why I recommend a second counter.

Set a second counter to 0 and when the player completes the puzzle have the counter increment to 1. Then use that as another check. So

if trapdoor_counter:getValue() == 1 and success_counter:getValue() == 0 then
trapdoor_timer:activate()
end

and to take it one more step, why disable the puzzle when you could just not allow the player to be awarded more than once even if they complete it again. Again using the counter

if success_counter:getValue() == 0 then
award XP and secret
else
hudPrint("Quit trying to scam the system, you have already completed this puzzle!")
end

Just a few suggestions.

Good luck with it.
Aleitheo
Posts: 14
Joined: Tue Mar 19, 2013 7:59 pm

Re: Requesting some specific helpful tips

Post by Aleitheo »

Reshaping the room so the player leaves it from the end of the puzzle may take a bit of work (I'd probably have to rotate the thing or use a really long corridor or teleporter). However if I do it that way I have to prevent the player from going back the way they came if the buttons aren't disabled.

Would something along these lines be possible for a script attached to a counter that is attached to the puzzle ending button?

if LvlOneSecretPitCounter=0 then
LvlOneSecretPitButton:delete()
end


Obviously not accurate code but you get the idea, that button at the end is what triggers the secret, XP and sets up the trapdoors to make a bridge, shouldn't something like that also be possible?
User avatar
msyblade
Posts: 792
Joined: Fri Oct 12, 2012 4:40 am
Location: New Mexico, USA
Contact:

Re: Requesting some specific helpful tips

Post by msyblade »

Okay Aleithio: got ya a couple of scripts here that should do the trick. First, the one you're asking for, connect your "exit" hidden_plate to decrement the counter, and set the counter to 1.Connect the counter to this script, and rename id's as necessary.

Code: Select all

function check ()
if LvlOneSecretPitCounter:getValue() == 0 
then 
LvlOneSecretPitButton:destroy()
end
But Neikun pointed out to me, that wouldnt it be just as easy to connect the plate to a script that says

Code: Select all

function destroyButton()
LvlOneSecretPitButton:destroy()
end
and skip the counter altogether?
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
Aleitheo
Posts: 14
Joined: Tue Mar 19, 2013 7:59 pm

Re: Requesting some specific helpful tips

Post by Aleitheo »

Counter skipped, I used the last script and everything works fine.

I've gone through the dungeon from the start to the stairs down the the next floor while picking out all the secrets.

http://steamcommunity.com/sharedfiles/f ... =136781954

The dungeon is ready for testing, it does have a good few mod assets including two different tilesets. The first one being the Northern Dungeon and the other being the mine tileset from The Mine of Malan Vael (the floor using this one hasn't even been built yet).
Post Reply