Page 1 of 1

What is a "blocker"? It is getting auto-spawned at exits

Posted: Sat Nov 29, 2014 11:06 pm
by MrChoke
I spent lots of time wondering why my code was failing to make a path to one of the forest_exits at times. I came to realize that "at some point" in the game's initialization, the squares right in front of exits start giving values of "true" for map:isBlocked(). Even though, the square is NOT blocked by anything I placed in the editor or spawned. I can walk on the square as well. Calling entitiesAt() on the square revealed that the game itself is spawning an entity called "blocker" there. Ok.... why? I guess I have seen monster AI behavior always avoid the squares in front of exits and I never knew why. Maybe this is why? The "blocker" square blocks mobs but not the party? Is that its purpose?

I am about to try to see if I can destroy this upon game start. Hopefully I can.

UPDATE:
So I can destroy the blocker via script which is good. And yes, it is this object that blocks monster movement. However, I still don't see its purpose. If the intent is to keep the mobs off the exit, that happens anyway since the exit is an obstacle. I had to uncheck "obstacle" on the exit and destroy the blocker and then a monster can enter the exit square. NO, he didn't leave the level (BUMMER). He just acts like its another square it seems.

Re: What is a "blocker"? It is getting auto-spawned at exit

Posted: Sun Nov 30, 2014 12:17 am
by Kaliflour
I've been tinkering with the editor, and yes, it appears blockers are meant to stop monsters from entering certain squares. You can activate/deactivate blockers you place yourself, but I'm not sure about the auto-spawned ones.

Re: What is a "blocker"? It is getting auto-spawned at exit

Posted: Sun Nov 30, 2014 1:24 am
by Isaac
Calling entitiesAt() did not work for me; I had assumed they had removed it... just like allEntities(). :shock:

I get the error for calling an assumed global that is nil.

What's the working syntax that you used, if you don't mind? 8-)

Re: What is a "blocker"? It is getting auto-spawned at exit

Posted: Sun Nov 30, 2014 1:52 am
by MrChoke
Isaac wrote:Calling entitiesAt() did not work for me; I had assumed they had removed it... just like allEntities(). :shock:

I get the error for calling an assumed global that is nil.

What's the working syntax that you used, if you don't mind? 8-)
entitiesAt() is now a function on the map object. Once you have access to a map object, you will need to iterate thru what is returned. Example:

Code: Select all

local entTbl = party.map:entitiesAt(15, 15)
for ent in entTbl do
    print(ent.name)
end

Re: What is a "blocker"? It is getting auto-spawned at exit

Posted: Sun Nov 30, 2014 2:41 am
by Batty
It's probably there because monsters would follow you and coagulate on the last square before exit.

Then you could exit and reenter on top of them thus killing them all just as when you teleport onto a monster. :)

Re: What is a "blocker"? It is getting auto-spawned at exit

Posted: Sun Nov 30, 2014 2:54 am
by Isaac
MrChoke wrote:
Isaac wrote:Calling entitiesAt() did not work for me; I had assumed they had removed it... just like allEntities(). :shock:

I get the error for calling an assumed global that is nil.

What's the working syntax that you used, if you don't mind? 8-)
entitiesAt() is now a function on the map object. Once you have access to a map object, you will need to iterate thru what is returned. Example:

Code: Select all

local entTbl = party.map:entitiesAt(15, 15)
for ent in entTbl do
    print(ent.name)
end
Thank you. 8-)

* :mrgreen: I just discovered this in the script ref, minutes ago, and rushed back to edit my post.

[AFAIK], Monsters do not trigger the exits, but the effect can be simulated with teleporters... best to start the tunnel/exit model one or more tiles in from the wall, so that the monster is in the tunnel before they just pop away (vanish); but it does work ~albeit with a telefrag risk. I would expect that even the fades can be faked with the GameMode.fadeOut function call.