Wagtunes' Modding Questions

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
User avatar
Isaac
Posts: 3185
Joined: Fri Mar 02, 2012 10:02 pm

Re: Useful scripts repository

Post by Isaac »

Twice tried, each time it says that the archive is corrupt.
wagtunes
Posts: 316
Joined: Sun Feb 04, 2018 11:04 pm

Re: Useful scripts repository

Post by wagtunes »

Isaac wrote: Thu May 06, 2021 4:23 am Twice tried, each time it says that the archive is corrupt.
Well, that's interesting. I wonder if it's because I created it with the dungeon open in the editor. Let me try to create it with everything closed and I'll get back to you.
wagtunes
Posts: 316
Joined: Sun Feb 04, 2018 11:04 pm

Re: Useful scripts repository

Post by wagtunes »

Okay, made a new archive.

https://www.dropbox.com/s/3x3ytbw7jrscim4/Ra2.zip?dl=0

I created it on one PC and downloaded it and unzipped it on another and it unzipped fine. So hopefully this one will work.
User avatar
Zo Kath Ra
Posts: 937
Joined: Sat Apr 21, 2012 9:57 am
Location: Germany

Re: Useful scripts repository

Post by Zo Kath Ra »

Isaac wrote: Thu May 06, 2021 4:23 am Twice tried, each time it says that the archive is corrupt.
Both archives work for me.
I'm using Manjaro Linux

If the temple_catacomb_alcove is facing east or west, you can put items into it.
But if it's facing north or south, you can only remove the items that are already inside.

@Isaac
So the problem is with anchorPos, targetPos or targetSize?

Here's the definition again:

Code: Select all

defineObject{
	  name = "temple_catacomb_alcove",
	  class = "Alcove",
	  anchorPos = vec(0, 0.75, 0.3),
	  targetPos = vec(0, 1.3, 0),
	  targetSize = vec(0, 0.5, 0.6),
	  model = "assets/models/env/temple_catacomb_empty.fbx",
	  placement = "wall",
	  replacesWall = true,
	  editorIcon = 92,
}
wagtunes
Posts: 316
Joined: Sun Feb 04, 2018 11:04 pm

Re: Useful scripts repository

Post by wagtunes »

Zo Kath Ra wrote: Thu May 06, 2021 12:17 pm
Isaac wrote: Thu May 06, 2021 4:23 am Twice tried, each time it says that the archive is corrupt.
Both archives work for me.
I'm using Manjaro Linux

If the temple_catacomb_alcove is facing east or west, you can put items into it.
But if it's facing north or south, you can only remove the items that are already inside.

@Isaac
So the problem is with anchorPos, targetPos or targetSize?

Here's the definition again:

Code: Select all

defineObject{
	  name = "temple_catacomb_alcove",
	  class = "Alcove",
	  anchorPos = vec(0, 0.75, 0.3),
	  targetPos = vec(0, 1.3, 0),
	  targetSize = vec(0, 0.5, 0.6),
	  model = "assets/models/env/temple_catacomb_empty.fbx",
	  placement = "wall",
	  replacesWall = true,
	  editorIcon = 92,
}
Wo, wait a minute. Why is that? What should it matter what direction the catacomb is facing? And then, okay, if that is a problem, how do I change the direction?

Sorry, this is all so very confusing.
User avatar
Zo Kath Ra
Posts: 937
Joined: Sat Apr 21, 2012 9:57 am
Location: Germany

Re: Useful scripts repository

Post by Zo Kath Ra »

wagtunes wrote: Thu May 06, 2021 12:30 pm Wo, wait a minute. Why is that? What should it matter what direction the catacomb is facing? And then, okay, if that is a problem, how do I change the direction?

Sorry, this is all so very confusing.
When I used the word "direction", I meant "facing".
(click on temple_catacomb_alcove_1 in the dungeon editor, and the object's facing is marked with a green triangle)

The problem appears to be the line:
targetSize = vec(0, 0.5, 0.6),

In the LoG1 asset pack, all *_alcove objects have this targetSize vector:
targetSize = vec(0.6, 0.5, 0.6),

The first number is 0.6 not 0
If you change the first number from 0 to 0.6 it will work.

Why does the wrong value of 0 work, if the alcove is facing east/west, but not north/south?
Looks like a numerical/rounding error.
Can't tell you more, because I don't have the LoG1 source code.
wagtunes
Posts: 316
Joined: Sun Feb 04, 2018 11:04 pm

Re: Useful scripts repository

Post by wagtunes »

Zo Kath Ra wrote: Thu May 06, 2021 1:26 pm
wagtunes wrote: Thu May 06, 2021 12:30 pm Wo, wait a minute. Why is that? What should it matter what direction the catacomb is facing? And then, okay, if that is a problem, how do I change the direction?

Sorry, this is all so very confusing.
When I used the word "direction", I meant "facing".
(click on temple_catacomb_alcove_1 in the dungeon editor, and the object's facing is marked with a green triangle)

The problem appears to be the line:
targetSize = vec(0, 0.5, 0.6),

In the LoG1 asset pack, all *_alcove objects have this targetSize vector:
targetSize = vec(0.6, 0.5, 0.6),

The first number is 0.6 not 0
If you change the first number from 0 to 0.6 it will work.

Why does the wrong value of 0 work, if the alcove is facing east/west, but not north/south?
Looks like a numerical/rounding error.
Can't tell you more, because I don't have the LoG1 source code.
Yep, that did it. FWIW, I copied the script from one of the other dungeon mods. So I have no idea why they would have changed that value to zero.

Thanks. There is no way I could have ever figured that out. Still, on the other alcoves that face E and W, you can replace the item. Very, very strange.
minmay
Posts: 2780
Joined: Mon Sep 23, 2013 2:24 am

Re: Useful scripts repository

Post by minmay »

Alcove's "collision box" for clicking doesn't get rotated to match the Alcove's rotation. With the standard assets, this doesn't matter since all of the targetSizes have equal X and Z dimensions so the 4 possible rotations result in the same box. However if you want to make a custom Alcove with a targetSize that isn't "square" like that, then you'll need two different versions of it, one for east/west and one for north/south.

Same thing goes for Altar's targetSize.
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.
wagtunes
Posts: 316
Joined: Sun Feb 04, 2018 11:04 pm

Re: Useful scripts repository

Post by wagtunes »

minmay wrote: Thu May 06, 2021 3:11 pm Alcove's "collision box" for clicking doesn't get rotated to match the Alcove's rotation. With the standard assets, this doesn't matter since all of the targetSizes have equal X and Z dimensions so the 4 possible rotations result in the same box. However if you want to make a custom Alcove with a targetSize that isn't "square" like that, then you'll need two different versions of it, one for east/west and one for north/south.

Same thing goes for Altar's targetSize.
Thanks. Honestly, this is far enough down the rabbit hole of the mechanics of this game that I have no idea what you're talking about but I think I at least know how to fix this problem should it happen again. I'm guessing that by fiddling with these coordinates I can make it so that the item appears at the top of the catacomb, which I have seen in several dungeons.
User avatar
Isaac
Posts: 3185
Joined: Fri Mar 02, 2012 10:02 pm

Re: Useful scripts repository

Post by Isaac »

wagtunes wrote: Thu May 06, 2021 3:26 pmI'm guessing that by fiddling with these coordinates I can make it so that the item appears at the top of the catacomb, which I have seen in several dungeons.
In the Foundry there are shelves that accept items on both top & bottom.

I don't have the source project with me, but I think I used two alcoves with different click regions to do it. So both have to be on the same tile, with the same facing. (Or I might have automated this, via script. :? )
Post Reply