blocker for party?

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
User avatar
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

Re: blocker for party?

Post by Neikun »

Couldn't you just use an invisible textured blockage or door?
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
  • Message me to join in!
User avatar
SpiderFighter
Posts: 789
Joined: Thu Apr 12, 2012 4:15 pm

Re: blocker for party?

Post by SpiderFighter »

Neikun wrote:Couldn't you just use an invisible textured blockage or door?
Indeed! Got one in your pocket? ;)

[Edit: ...and isn't that what I just said, in many, many more words? rofl!]
User avatar
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

Re: blocker for party?

Post by Neikun »

Sorry I skimmed to be honest. I'm on the verge of going for a nap.
https://www.dropbox.com/s/pua54yentpbpp ... _empty.dds
Here is a 1 pixel invisible texture.
Just define a material with it, retexture a door model with that material, save the new model and define it as a secret door, perhaps.
Or you could retexture an unbreakable blockage and save it as a new blockage.
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
  • Message me to join in!
User avatar
SpiderFighter
Posts: 789
Joined: Thu Apr 12, 2012 4:15 pm

Re: blocker for party?

Post by SpiderFighter »

Neikun wrote:Sorry I skimmed to be honest. I'm on the verge of going for a nap.
https://www.dropbox.com/s/pua54yentpbpp ... _empty.dds
Here is a 1 pixel invisible texture.
Just define a material with it, retexture a door model with that material, save the new model and define it as a secret door, perhaps.
Or you could retexture an unbreakable blockage and save it as a new blockage.
I thought this was an odd time for you to be out about. Enjoy your nap, and rest well in the comfort that you do much good in this world. :)
Alcator
Posts: 37
Joined: Fri Apr 13, 2012 9:59 am

Re: blocker for party?

Post by Alcator »

actually, you could use DEactivated BLOCKERS, and in your onMove hook check if at the "destination" tile there is this blocker.

When a blocker is deactivated, monsters can move through it with no problem.

This would be slightly more efficient than placing all those N/S/W/E hidden pressure plates (at the very least, there would be less objects to place) and it would also be easier to check visually (you see the red "X" marks)
User avatar
SpiderFighter
Posts: 789
Joined: Thu Apr 12, 2012 4:15 pm

Re: blocker for party?

Post by SpiderFighter »

Alcator wrote:actually, you could use DEactivated BLOCKERS, and in your onMove hook check if at the "destination" tile there is this blocker.

When a blocker is deactivated, monsters can move through it with no problem.

This would be slightly more efficient than placing all those N/S/W/E hidden pressure plates (at the very least, there would be less objects to place) and it would also be easier to check visually (you see the red "X" marks)
Maybe it's too early for me (no coffee yet), but I'm not sure how using blockers that affect only monsters would help stick the party to a specific tile?
Alcator
Posts: 37
Joined: Fri Apr 13, 2012 9:59 am

Re: blocker for party?

Post by Alcator »

Yep, this is the best way:

Put this into your objects.lua:

Code: Select all

-- this defines party_blocker -- don't forget to always set it to "deactivated", so that monsters can get through.
cloneObject{
  name = "party_blocker",
  baseObject = "blocker",
  editorIcon = 96,
}

-- this defines a party which cannot pass party_blockers:
cloneObject{
  name = "party",
  baseObject = "party",
  onMove = function(self, dir)
    local dx,dy = getForward(dir)
    local destX = self.x + dx
    local destY = self.y + dy
    for i in entitiesAt(party.level,destX,destY) do
      if i ~= nil and i.name == "party_blocker" then
        return false 
      end
    end
  end,
}
Demo map source: Party Blocker Test
In the map, you have a room with drainage tiles on the floor which the party cannot enter, but spiders run across it easily.
User avatar
SpiderFighter
Posts: 789
Joined: Thu Apr 12, 2012 4:15 pm

Re: blocker for party?

Post by SpiderFighter »

Alcator wrote:Yep, this is the best way:

Put this into your objects.lua:

Code: Select all

-- this defines party_blocker -- don't forget to always set it to "deactivated", so that monsters can get through.
cloneObject{
  name = "party_blocker",
  baseObject = "blocker",
  editorIcon = 96,
}

-- this defines a party which cannot pass party_blockers:
cloneObject{
  name = "party",
  baseObject = "party",
  onMove = function(self, dir)
    local dx,dy = getForward(dir)
    local destX = self.x + dx
    local destY = self.y + dy
    for i in entitiesAt(party.level,destX,destY) do
      if i ~= nil and i.name == "party_blocker" then
        return false 
      end
    end
  end,
}
Demo map source: Party Blocker Test
In the map, you have a room with drainage tiles on the floor which the party cannot enter, but spiders run across it easily.
If this really works, excellent job! This would be the very simple solution that it really seemed was out there waiting to be discovered (I had tried to use the blocker before, but couldn't get it to work without crashing). Is there a way to use it without creating a specific (cloned) party, though, via an in-editor script that calls the party at the start of the game?

[EDIT: Never mind, that question was due to my own ignorance. You've created the fix that everyone's been asking for, and it works beautifully! ]
Last edited by SpiderFighter on Thu Mar 21, 2013 4:28 pm, edited 1 time in total.
User avatar
Komag
Posts: 3654
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: blocker for party?

Post by Komag »

using the onMove party hook seems pretty essential to this approach, but it's also no problem to use a party hook, why the hesitation? You can always just add it to any existing hooks you may have in place, there is no conflict.
Finished Dungeons - complete mods to play
User avatar
SpiderFighter
Posts: 789
Joined: Thu Apr 12, 2012 4:15 pm

Re: blocker for party?

Post by SpiderFighter »

Komag wrote:using the onMove party hook seems pretty essential to this approach, but it's also no problem to use a party hook, why the hesitation? You can always just add it to any existing hooks you may have in place, there is no conflict.
I'm not sure if you're talking to me? I think, maybe because of how active I am here, that people assume I know anything at all about lua, when I really don't. I think I misunderstood the usage of the cloned party as being incompatible with a custom party.

[EDIT: Never mind, my question was due to my own ignorance. Alcator has created the fix that everyone's been asking for, and it works beautifully! ]
Last edited by SpiderFighter on Thu Mar 21, 2013 4:29 pm, edited 1 time in total.
Post Reply