blocker for party?
Re: blocker for party?
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
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!
- SpiderFighter
- Posts: 789
- Joined: Thu Apr 12, 2012 4:15 pm
Re: blocker for party?
Indeed! Got one in your pocket?Neikun wrote:Couldn't you just use an invisible textured blockage or door?
![Wink ;)](./images/smilies/icon_e_wink.gif)
[Edit: ...and isn't that what I just said, in many, many more words? rofl!]
Re: blocker for party?
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.
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
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!
- SpiderFighter
- Posts: 789
- Joined: Thu Apr 12, 2012 4:15 pm
Re: blocker for party?
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.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.
![Smile :)](./images/smilies/icon_e_smile.gif)
Re: blocker for party?
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)
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)
- SpiderFighter
- Posts: 789
- Joined: Thu Apr 12, 2012 4:15 pm
Re: blocker for party?
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 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)
Re: blocker for party?
Yep, this is the best way:
Put this into your objects.lua:
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.
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,
}
In the map, you have a room with drainage tiles on the floor which the party cannot enter, but spiders run across it easily.
- SpiderFighter
- Posts: 789
- Joined: Thu Apr 12, 2012 4:15 pm
Re: blocker for party?
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?Alcator wrote:Yep, this is the best way:
Put this into your objects.lua:
Demo map source: Party Blocker TestCode: 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, }
In the map, you have a room with drainage tiles on the floor which the party cannot enter, but spiders run across it easily.
[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.
Re: blocker for party?
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
- SpiderFighter
- Posts: 789
- Joined: Thu Apr 12, 2012 4:15 pm
Re: blocker for party?
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.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.
[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.