Ask a simple question, get a simple answer
- zimberzimber
- Posts: 432
- Joined: Fri Feb 08, 2013 8:06 pm
Re: Ask a simple question, get a simple answer
Apperantly, you can't pick up items from both sockets and surfaces if you're standing on their tile. I assume they were designed for altars and other object which you can't stand inside.
My asset pack [v1.10]
Features a bit of everything!
Features a bit of everything!
Re: Ask a simple question, get a simple answer
You can if they have wall placement mode instead of floor placement.zimberzimber wrote:Apperantly, you can't pick up items from both sockets and surfaces if you're standing on their tile. I assume they were designed for altars and other object which you can't stand inside.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Re: Ask a simple question, get a simple answer
But [of course] this then reverses it, and you can no longer interact with the objects from outside of the same cell.
@zimberzimber
Is pixel perfect placement important to what you are doing?
@zimberzimber
Is pixel perfect placement important to what you are doing?
- zimberzimber
- Posts: 432
- Joined: Fri Feb 08, 2013 8:06 pm
Re: Ask a simple question, get a simple answer
Pretty much.Isaac wrote: @zimberzimber
Is pixel perfect placement important to what you are doing?
I've created an object with tiny spaces on the ground that fit for holding herbs.
Can't upload an image until next week.
My asset pack [v1.10]
Features a bit of everything!
Features a bit of everything!
Re: Ask a simple question, get a simple answer
I have a script that simply spawns the items into the cell, then moves them to a determined offset. Numerically the locations are consistent, but in preview, [for some as yet unexplained reason] the objects models rarely appear in the expected (pixel perfect) location assigned to them.zimberzimber wrote:Pretty much.Isaac wrote: @zimberzimber
Is pixel perfect placement important to what you are doing?
I've created an object with tiny spaces on the ground that fit for holding herbs.
Can't upload an image until next week.
- zimberzimber
- Posts: 432
- Joined: Fri Feb 08, 2013 8:06 pm
Re: Ask a simple question, get a simple answer
Wouldn't the items move if you are to walk over the cell? That's the main reason I don't want to spawn them just like that.
My asset pack [v1.10]
Features a bit of everything!
Features a bit of everything!
Re: Ask a simple question, get a simple answer
Just off the top of my head [untried], you might be able to redefine the sockets using 'wall' placement, and then use a floor_triggered script to rotate the sockets to face the party; and [necessarily] use a keyed table [0-3] with appropriate offsets for each item ~to not appear to shift position... even though the sockets may have to switch cells.
Re: Ask a simple question, get a simple answer
Sounds like you're moving them at the wrong time. For example if this is the entire source of a script entity:Isaac wrote:I have a script that simply spawns the items into the cell, then moves them to a determined offset. Numerically the locations are consistent, but in preview, [for some as yet unexplained reason] the objects models rarely appear in the expected (pixel perfect) location assigned to them.zimberzimber wrote:Pretty much.Isaac wrote: @zimberzimber
Is pixel perfect placement important to what you are doing?
I've created an object with tiny spaces on the ground that fit for holding herbs.
Can't upload an image until next week.
Code: Select all
etherweed_1:setWorldPosition(24,0,24)
Code: Select all
function a()
etherweed_1:setWorldPosition(24,0,24)
end
delayedCall(self.go.id,0,"a")
zimberzimber, you want items that can't be pushed, but otherwise don't behave as if in a surface or socket. Your first instinct should NOT be to use a socket anyway. The hack Isaac suggests, aside from being kind of ridiculous, won't accomplish it, because being in a surface/socket doesn't just restrict the squares you can pick up the item from, it completely changes the allowed distance for picking up items, among other things.
Instead, use ItemConstrainBoxComponent. It lets you define an arbitrary 3D box that items cannot be pushed into or dropped into. If you completely cover an item's possible push paths (which can be done with just one ItemConstrainBoxComponent, or you can use 2 very thin ones to avoid blocking other areas), that item won't get pushed. You do have to cover the whole path and not just the starting point, though.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Re: Ask a simple question, get a simple answer
Can you prove that?minmay wrote: The hack Isaac suggests, aside from being kind of ridiculous, won't accomplish it....
Re: Ask a simple question, get a simple answer
Yes, but instead of exhaustively proving the difference, I will explain it more precisely. If an item is not in a surface or socket, and there's not something in the way, you can pick it up if it is at the party's elevation and its world x distance and world z distance from the party are both under 2.5 meters. If an item is in a surface or socket, not only must the party be on the right square facing the right way, the distance requirement is relaxed to (what appears to be) the maximum clickable distance, considerably higher than 2.5 meters. Here is a demonstration: paste this in the console:Isaac wrote:Can you prove that?minmay wrote: The hack Isaac suggests, aside from being kind of ridiculous, won't accomplish it....
Code: Select all
s=spawn("beach_puzzle_statue")
s.socket:setOffset(s.socket:getOffset()+vec(4,0,0))
a=spawn("rapier")
b=spawn("rapier")
b.model:setEmissiveColor(vec(-1,0,1)) -- visually mark as the non-socket rapier
s.socket:addItem(a.item)
b:setWorldPosition(a:getWorldPosition())
b:setWorldRotation(a:getWorldRotation())
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.