Ask a simple question, get a simple answer
Re: Ask a simple question, get a simple answer
Hi there, it's me again.
I was wondering, is there a way to prevent the auto map from mapping certain tiles? I've looked in the scripting reference but there doesn't seem to be anything appropriate. Is there a possible workaround to make it work, in case the code itself can't do that directly?
I was wondering, is there a way to prevent the auto map from mapping certain tiles? I've looked in the scripting reference but there doesn't seem to be anything appropriate. Is there a possible workaround to make it work, in case the code itself can't do that directly?
Re: Ask a simple question, get a simple answer
Do you mean ~not exposing the area of the map, (retaining the fog-of-war in certain places)?
Or do you mean not identifying certain objects on the exposed map?
*As for the Fog-Of-War... people can draw their own maps in a notebook; (and likely will, if a permanent fog is implemented).
Or do you mean not identifying certain objects on the exposed map?
*As for the Fog-Of-War... people can draw their own maps in a notebook; (and likely will, if a permanent fog is implemented).
Re: Ask a simple question, get a simple answer
That's what I mean. I don't mind players mapping on their own, it's just a section of the map that I want having this little feature. Is it feasible?Isaac wrote:*As for the Fog-Of-War... people can draw their own maps in a notebook; (and likely will, if a permanent fog is implemented).
Re: Ask a simple question, get a simple answer
Have a look at this project: https://www.dropbox.com/s/srqyshj4900d5 ... r.zip?dl=0
It implements a kind of Fog-of-War that keeps selected areas unrecorded on the map.
In the editor there are two new fog_of_war assets, one obscures a single tile, and the other will obscure a definable region of tiles.
It implements a kind of Fog-of-War that keeps selected areas unrecorded on the map.
In the editor there are two new fog_of_war assets, one obscures a single tile, and the other will obscure a definable region of tiles.
- zimberzimber
- Posts: 432
- Joined: Fri Feb 08, 2013 8:06 pm
Re: Ask a simple question, get a simple answer
I'm having a weird issue with sockets. I've defined an object that features nothing but a bunch of sockets that hold items. So far so good.
The problem is that said items cannot be picked up from the tile the object is placed on, but only from adjacent tiles. And it doesn't matter where the socket is placed, even if its offset is -1.49, 0 , -1.49 and you're standing on the opposite tile.
Here's the object definition:
Also, how can I enable the source "console" for the script component on a non-script-entity (with the script component)?
The problem is that said items cannot be picked up from the tile the object is placed on, but only from adjacent tiles. And it doesn't matter where the socket is placed, even if its offset is -1.49, 0 , -1.49 and you're standing on the opposite tile.
Here's the object definition:
Code: Select all
defineObject{
name = "river_sockets",
baseObject = "base_floor_decoration",
components = {
{
class = "Socket",
name = "s1",
offset = vec(0.35, 0, 1.49),
rotation = vec(0, 0, 0),
onInit = function(self)
self:addItem(spawn("crystal_flower").item)
end,
},
{
class = "Socket",
name = "s2",
offset = vec(-0.35, 0, 1.1),
rotation = vec(0, 0, 0),
onInit = function(self)
self:addItem(spawn("blooddrop_cap").item)
end,
},
{
class = "Socket",
name = "s3",
offset = vec(-0.35, 0, 0.4),
rotation = vec(0, 0, 0),
onInit = function(self)
self:addItem(spawn("aether_weed").item)
end,
},
{
class = "Socket",
name = "s4",
offset = vec(0.8, -0.05, 0.55),
rotation = vec(0, 0, 0),
onInit = function(self)
self:addItem(spawn("brass_key").item)
end,
},
{
class = "Socket",
name = "s5",
offset = vec(-0.5, 0, -0.85),
rotation = vec(0, 0, 0),
onInit = function(self)
self:addItem(spawn("skull").item)
end,
},
},
placement = "floor",
editorIcon = 104,
}
My asset pack [v1.10]
Features a bit of everything!
Features a bit of everything!
Re: Ask a simple question, get a simple answer
Thanks, that was very useful.Isaac wrote:Have a look at this project: https://www.dropbox.com/s/srqyshj4900d5 ... r.zip?dl=0
It implements a kind of Fog-of-War that keeps selected areas unrecorded on the map.
http://i271.photobucket.com/albums/jj12 ... 7hw5lo.jpg
In the editor there are two new fog_of_war assets, one obscures a single tile, and the other will obscure a definable region of tiles.
Re: Ask a simple question, get a simple answer
So my question is... is there a way to select the Question-mark icon for a spawned map marker?
It's a runtime event if you set it via the onInit hook [instead]... and does not display during the preview.
If you mean view the script in the inspector, in editor... That will happen automatically if you set the script source in the object definition.zimberzimber wrote:Also, how can I enable the source "console" for the script component on a non-script-entity (with the script component)?
It's a runtime event if you set it via the onInit hook [instead]... and does not display during the preview.
Re: Ask a simple question, get a simple answer
You cannot change the MapMarkerComponent symbol dynamically but you can set it in the object definition.Isaac wrote:So my question is... is there a way to select the Question-mark icon for a spawned map marker?
Code: Select all
defineObject{
name = "map_marker_question",
placement = "floor",
components = {
{
class = "MapMarker",
symbol = "question",
},
}
}
defineObject{
name = "map_marker_cross",
placement = "floor",
components = {
{
class = "MapMarker",
symbol = "cross",
},
}
}
defineObject{
name = "map_marker_exclamation",
placement = "floor",
components = {
{
class = "MapMarker",
symbol = "exclamation",
},
}
}
SocketComponent is very finicky about allowing the player to take items out of it. It's specialized for the beach puzzle statue and the essence holder statues (which are themselves questionable) and often you are better served with a SurfaceComponent that uses an onAcceptItem hook to only allow one item to be inserted. In this case, you don't let the player insert items at all, which suggests to me that you don't want to use either component - just place the items in the editor and set their world position to the desired position.zimberzimber wrote:I'm having a weird issue with sockets. I've defined an object that features nothing but a bunch of sockets that hold items. So far so good.
The problem is that said items cannot be picked up from the tile the object is placed on, but only from adjacent tiles. And it doesn't matter where the socket is placed, even if its offset is -1.49, 0 , -1.49 and you're standing on the opposite tile.
Here's the object definition:Code: Select all
defineObject{ name = "river_sockets", baseObject = "base_floor_decoration", components = { { class = "Socket", name = "s1", offset = vec(0.35, 0, 1.49), rotation = vec(0, 0, 0), onInit = function(self) self:addItem(spawn("crystal_flower").item) end, }, { class = "Socket", name = "s2", offset = vec(-0.35, 0, 1.1), rotation = vec(0, 0, 0), onInit = function(self) self:addItem(spawn("blooddrop_cap").item) end, }, { class = "Socket", name = "s3", offset = vec(-0.35, 0, 0.4), rotation = vec(0, 0, 0), onInit = function(self) self:addItem(spawn("aether_weed").item) end, }, { class = "Socket", name = "s4", offset = vec(0.8, -0.05, 0.55), rotation = vec(0, 0, 0), onInit = function(self) self:addItem(spawn("brass_key").item) end, }, { class = "Socket", name = "s5", offset = vec(-0.5, 0, -0.85), rotation = vec(0, 0, 0), onInit = function(self) self:addItem(spawn("skull").item) end, }, }, placement = "floor", editorIcon = 104, }
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
Thank you. I could not find that written anywhere; but I suppose I missed it somewhere.minmay wrote:symbol = "question",
@brzrkr minmay's solution above can be used to change the map marker icon from feather to the question mark, in the fog-of-war script... if you use it.
That was going to be my suggestion as well. I wrote a function that spawns those items at the script's location, then offsets from the script's world location. It worked, but something odd happened... I had the script print all of the item and script world location tables, and the printed numbers never changed between previews [as expected], but the on screen locations of each item did; often by up to an in-game foot and a half. The same thing happened when I used subtileOffset, (which I had tried using before switching to setWorldPosition).... just place the items in the editor and set their world position to the desired position.
*I wondered if accurate positioning was the only reason for choosing sockets.
Re: Ask a simple question, get a simple answer
No, it was never documented anywhere before my post.Isaac wrote:Thank you. I could not find that written anywhere; but I suppose I missed it somewhere.minmay wrote:symbol = "question",
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.