Page 1 of 1

Take item out of Alcove

Posted: Sun Sep 29, 2013 5:42 am
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..

Re: Take item out of Alcove

Posted: Sun Sep 29, 2013 6:49 am
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).

Re: Take item out of Alcove

Posted: Sun Sep 29, 2013 11:52 am
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..

Re: Take item out of Alcove

Posted: Sun Sep 29, 2013 12:38 pm
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.

Re: Take item out of Alcove

Posted: Sun Sep 29, 2013 1:38 pm
by Komag
might be better to simply activate or deactivate the blocker

Re: Take item out of Alcove

Posted: Sun Sep 29, 2013 3:07 pm
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..

Re: Take item out of Alcove

Posted: Sun Sep 29, 2013 3:19 pm
by Isaac
I didn't catch that you were working with real blockers; I was still thinking it was Cube related. :oops:

Re: Take item out of Alcove

Posted: Sun Sep 29, 2013 3:36 pm
by Eleven Warrior
hi Isaac..

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