Take item out of Alcove

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
User avatar
Eleven Warrior
Posts: 752
Joined: Thu Apr 18, 2013 2:32 pm
Location: Australia

Take item out of Alcove

Post by Eleven Warrior »

Hi..

What I want to do is this.. A (alcove has a dagger in it) the player takes the dagger out of the Alcove door opens and Blockers are destroyed..
A message comes up then a sound..


X Monster X
door1--------door2

alcove1
(with dagger in it).

I can it to work when a dagger is placed into the Alcove but not sure about the other way around.. I tried this connected to the alcove:

function StealNo()
if ha2:getItemCount() == 0 then
block2:destroy()
hermitdoor1:open() else
hermitdoor1:close()
end
end

Any Help with this Thxs..
User avatar
Isaac
Posts: 3192
Joined: Fri Mar 02, 2012 10:02 pm

Re: Take item out of Alcove

Post by Isaac »

Eleven Warrior wrote:Hi..
I can it to work when a dagger is placed into the Alcove but not sure about the other way around.. I tried this connected to the alcove:
Have you tried it with 'activate always' checked for the alcove? That should make any interaction trigger its event(s).
User avatar
Eleven Warrior
Posts: 752
Joined: Thu Apr 18, 2013 2:32 pm
Location: Australia

Re: Take item out of Alcove

Post by Eleven Warrior »

Hi..

Yeah I did that and it works, the trouble is say the player puts the Dagger back in the Alcove thinking they are safe now. That's when I get a Duplicate error or the Editor said the (Blocker is a Nil Value (Destroy Blocker). See the Blocker in destroyed already and when Dagger is returned it tries to do the Destroy Function again, maybe my function is looping not sure..
User avatar
Isaac
Posts: 3192
Joined: Fri Mar 02, 2012 10:02 pm

Re: Take item out of Alcove

Post by Isaac »

Eleven Warrior wrote:Hi..

Yeah I did that and it works, the trouble is say the player puts the Dagger back in the Alcove thinking they are safe now. That's when I get a Duplicate error or the Editor said the (Blocker is a Nil Value (Destroy Blocker). See the Blocker in destroyed already and when Dagger is returned it tries to do the Destroy Function again, maybe my function is looping not sure..
That would seem to call for a script. Perhaps add a counter that increments to 1 on the first use, and if it's later found to be 1 (or more?) then it could bypass the alcove/blocker code block; (unless you want the alcove to refuse the dagger entirely).

Or just put in a check for the Blocker's id string; and if that doesn't exist, don't try to destroy it.
User avatar
Komag
Posts: 3659
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: Take item out of Alcove

Post by Komag »

might be better to simply activate or deactivate the blocker
Finished Dungeons - complete mods to play
User avatar
Eleven Warrior
Posts: 752
Joined: Thu Apr 18, 2013 2:32 pm
Location: Australia

Re: Take item out of Alcove

Post by Eleven Warrior »

Hi .. Guys

Damm i should have relised that Komag, i forgot the Blockers can be Deactivated (LOL). Ill script it in.
blocker_1:deactivate() That makes more sense.

Another way i did it was when I destroyed the Blockers I destroyed the alcove and spawned another alcove in its place, this also worked.

In the end i put a Wall grate in front of the alcove, player opens the grate, takes dagger, grate close's and blockers destroyed, Ogre attacks the party.. This method is effective and i like it. 3 ways to do what i wanted LOL..

Thxs again guys for your help..
User avatar
Isaac
Posts: 3192
Joined: Fri Mar 02, 2012 10:02 pm

Re: Take item out of Alcove

Post by Isaac »

I didn't catch that you were working with real blockers; I was still thinking it was Cube related. :oops:
User avatar
Eleven Warrior
Posts: 752
Joined: Thu Apr 18, 2013 2:32 pm
Location: Australia

Re: Take item out of Alcove

Post by Eleven Warrior »

hi Isaac..

Yeahi should have mentioned that sorryY they are the normal blockers and the one you made..
Post Reply