Page 18 of 36
Re: The Custom Alcove Thread. (Neikun, Batty and Crisman)
Posted: Thu Oct 11, 2012 7:18 am
by Deadlylama
Neikun wrote:Oh dear. That is an issue.
Perhaps an invisible teleporter activated by item only that sends the item back to the square thrown? is that possible? hmm
Testing it. accidentally discovered a cool puzzle mechanic.
I wish I new how to change where exactly it appears in a square.
i got an idea, maybe a hidden pressure plate reacting to items in this square which powers a script that puts any item facing in the direction of the "waltar" into it.
Re: The Custom Alcove Thread. (Neikun, Batty and Crisman)
Posted: Thu Oct 11, 2012 1:35 pm
by Kuningas
Neikun wrote:Oh dear. That is an issue.
Perhaps an invisible teleporter activated by item only that sends the item back to the square thrown? is that possible? hmm
Testing it. accidentally discovered a cool puzzle mechanic.
I wish I new how to change where exactly it appears in a square.
Have you tried this? I noticed it in the scripting reference, but haven't had the chance to test it:
"Item:setSubtileOffset(x, y)
Sets item’s relative position to the center of tile."
And the invisible pressure-plate thing just might work... I'll give it a shot.
EDIT: how to check items in a map square or a pressure plate? I am quessing getContents won't work here...
Re: The Custom Alcove Thread. (Neikun, Batty and Crisman)
Posted: Thu Oct 11, 2012 1:41 pm
by Deadlylama
Kuningas wrote:Neikun wrote:Oh dear. That is an issue.
Perhaps an invisible teleporter activated by item only that sends the item back to the square thrown? is that possible? hmm
Testing it. accidentally discovered a cool puzzle mechanic.
I wish I new how to change where exactly it appears in a square.
Have you tried this? I noticed it in the scripting reference, but haven't had the chance to test it:
"Item:setSubtileOffset(x, y)
Sets item’s relative position to the center of tile."
ill test this, as i already used it in my own dungeon, i will post my script when im done
Edit: Script works, any item gets put in the middle of the tile, but sadly you can still push the item into the walltar D:
still, here is it:
Code: Select all
function CheckItems()
for i in entitiesAt(self.level,self.x,self.y) do
if (i.setSubtileOffset ~= nil ) then
i:setSubtileOffset(0,0)
end
end
end
its meant to be used in a script entity in the same tile as the walltar with a hidden pressure plate in the same tile that only reacts to items and calls the function.
Re: The Custom Alcove Thread. (Neikun, Batty and Crisman)
Posted: Thu Oct 11, 2012 1:46 pm
by Grimwold
Kuningas wrote:EDIT: how to check items in a map square or a pressure plate? I am quessing getContents won't work here...
for i in entitiesAt(level,x,y) do
Re: The Custom Alcove Thread. (Neikun, Batty and Crisman)
Posted: Thu Oct 11, 2012 1:53 pm
by Kuningas
Deadlylama wrote:Kuningas wrote:Neikun wrote:Oh dear. That is an issue.
Perhaps an invisible teleporter activated by item only that sends the item back to the square thrown? is that possible? hmm
Testing it. accidentally discovered a cool puzzle mechanic.
I wish I new how to change where exactly it appears in a square.
Have you tried this? I noticed it in the scripting reference, but haven't had the chance to test it:
"Item:setSubtileOffset(x, y)
Sets item’s relative position to the center of tile."
ill test this, as i already used it in my own dungeon, i will post my script when im done
Alright. : D I got this far myself, but I can't seem to use the setSubtileOffset with this because it treats it as an entity, I think.
EDIT: Once again, my favourite codemaster to the rescue! ; D Thanks, but this time I figured it out myself immediately after asking it... which is kind of silly.
EDIT 2: Also, I think it needs to be moved to another square -- else the party will "kick" it under the altar again : /
EDIT 3: AHA! By the wheels of progress everturning, I've nearly perfected a solution!
Code: Select all
function itemrecover(item)
for i in entitiesAt(1, 20, 6) do
if i.class == Item then
print("this works so far")
ItemRecoverTeleport:activate()
break
else
end
end
end
Now I just need it to dectivate when the item leaves, which should be a piece of cake.
Actually, I think I don't need that function -- I suppose I could just activate the teleporter with the pressure plate : /.
EDIT *whoknowshowmany*: Yup, works like a charm. I feel a bit... silly.
EDIT *previous + 1*: this, of course, also teleports items that are set on the floor by the player... Maybe if I set it not to work while the party is in that square...?
EDIT AGAIN: No, I could do it, but I think it is a bit excessive, considering the item is also teleported if another item is thrown into the square -- and I'd say the chances of people throwing stuff in the room is pretty much equal to the chance that people will drop stuff in the square. At least now they can't lose them... But I gotta admit, it is nagging me a bit.
Re: The Custom Alcove Thread. (Neikun, Batty and Crisman)
Posted: Fri Oct 12, 2012 1:43 am
by Neikun
I want to make this thread easier to reference, but since it's mostly images and code, it'd be kinda hard. Anyone have some suggested layouts?
Spoilers are kinda large D:
Does is make sense to categorize by logical alcove and physical alcove?
Re: The Custom Alcove Thread. (Neikun, Batty and Crisman)
Posted: Fri Oct 12, 2012 2:22 am
by Komag
I'm not sure which is the best way, can you explain the difference a bit? I'm also thinking how we can get this stuff into the wiki as well
Re: The Custom Alcove Thread. (Neikun, Batty and Crisman)
Posted: Fri Oct 12, 2012 2:29 am
by Neikun
Well I've recently set up the custom sounds thread in a much cleaning looking format. (Will make it easier to post it to the wiki, as well)
And I would like to do something similar in this thread.
I just don't know how I would categorize the alcoves to make them into a neat list.
Alphabetically perhaps?
Re: The Custom Alcove Thread. (Neikun, Batty and Crisman)
Posted: Fri Oct 12, 2012 2:31 am
by Komag
yeah but I mean what is logical vs physical alcove?
Re: The Custom Alcove Thread. (Neikun, Batty and Crisman)
Posted: Fri Oct 12, 2012 2:35 am
by Neikun
A logical alcove is an alcove without a model, useful for making alcoves with multiple position slots.
A physical alcove has a model file in it.
Since physical alcoves often have trouble stacking, one of the best ways of doing a multiple slot alcove is to have a physical alcove as a base, and place logical alcoves with slots in different x,y,z positions and rotations as desired.
That's almost a wiki worthy explanation, I think :0