Ask a simple question, get a simple answer

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
User avatar
vanblam
Posts: 230
Joined: Sun Nov 09, 2014 12:15 am

Re: Ask a simple question, get a simple answer

Post by vanblam » Wed Aug 14, 2019 4:11 am

minmay wrote:
Wed Aug 14, 2019 12:39 am
If you're getting "black parts", that doesn't sound like an issue with the default normals in the first place. Are you sure these faces are pointing outwards?

I confess I never tested the custom normal part after I made my changes to the plugin, so you could try using the original version of the plugin too in case I managed to break it.
I used yours on my grass, so I don't think you broke that. My branches are just planes and the texture is double sided. Same exact set up on my grass. I put a flat normal map on it to see if the original normal was causing the issue, also set the faces to smooth and flat, got the same results. So its kind of a head scratcher :P

I think I might try to double up the faces and see if that changes anything.

minmay
Posts: 2558
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay » Wed Aug 14, 2019 6:08 am

doubleSided materials are still only properly lit on the front side, the back side will be darker regardless of your normals - you can observe this in many of the models in the standard assets, such as the heather.
Again, are you sure these faces are pointing the direction you want? Look at the model with Solid shading in Blender, maybe turn on normal display in the edit mode Transform menu if it helps you ('n' key to bring up the menu, the normal display options are in the "Mesh Display" tab). Look for faces that are pointing the wrong way like this:
SpoilerShow
Image
Then use Mesh -> Faces -> Flip Normals on those faces.

You can also try to find such faces by using "Select Non Manifold" (ctrl+alt+shift+m by default) and selecting the "Non Contiguous" checkbox.
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.

User avatar
vanblam
Posts: 230
Joined: Sun Nov 09, 2014 12:15 am

Re: Ask a simple question, get a simple answer

Post by vanblam » Wed Aug 14, 2019 2:51 pm

minmay wrote:
Wed Aug 14, 2019 6:08 am
doubleSided materials are still only properly lit on the front side, the back side will be darker regardless of your normals - you can observe this in many of the models in the standard assets, such as the heather.
Again, are you sure these faces are pointing the direction you want? Look at the model with Solid shading in Blender, maybe turn on normal display in the edit mode Transform menu if it helps you ('n' key to bring up the menu, the normal display options are in the "Mesh Display" tab). Look for faces that are pointing the wrong way. You can also try to find such faces by using "Select Non Manifold" (ctrl+alt+shift+m by default) and selecting the "Non Contiguous" checkbox.
The trunk its self is perfect. I always make sure my faces are pointing the right direction. Its the branches (the cross pattern faces) that have the issue, sorry I should been more descriptive on that. here is a couple pictures.

Image
I have 4 bright lights surrounding this tree, I have moved them in many different positions and have the same result.

Image
This is the model in solid view.

minmay
Posts: 2558
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay » Wed Aug 14, 2019 8:42 pm

It really looks like that branch is facing away from the camera to me. Does it look dark from the other side too? If so, I have no idea what's going on.
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.

User avatar
Isaac
Posts: 2824
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac » Wed Aug 14, 2019 9:17 pm

Wouldn't enabling Backface Culling in the viewport make this easier?

User avatar
vanblam
Posts: 230
Joined: Sun Nov 09, 2014 12:15 am

Re: Ask a simple question, get a simple answer

Post by vanblam » Thu Aug 15, 2019 4:58 am

Isaac wrote:
Wed Aug 14, 2019 9:17 pm
Wouldn't enabling Backface Culling in the viewport make this easier?
You know I never used that before :P. That's easier to see if you were trying to find inverted faces :)

User avatar
vanblam
Posts: 230
Joined: Sun Nov 09, 2014 12:15 am

Re: Ask a simple question, get a simple answer

Post by vanblam » Thu Aug 15, 2019 4:59 am

minmay wrote:
Wed Aug 14, 2019 8:42 pm
It really looks like that branch is facing away from the camera to me. Does it look dark from the other side too? If so, I have no idea what's going on.
Yea its dark on both sides. I fiddle around with it and see if I can find the answer :)

Pompidom
Posts: 371
Joined: Sun May 06, 2018 9:42 pm

Re: Ask a simple question, get a simple answer

Post by Pompidom » Thu Aug 15, 2019 11:26 pm

https://ibb.co/qmpbBJv
https://ibb.co/grgtkYH
https://ibb.co/0MKFg65

What can I change to make sure these flowers don't light up like christmas lights from a million miles away?

Code: Select all

defineObject{
	name = "flower_1",
	baseObject = "base_item",
	tags = { "forge_herb" },
	components = {
		{
			class = "Model",
			model = "mod_assets/models/flowers/Bonny_Cl.fbx",
		},
		{
			class = "Item",
			uiName = "Bonny Flower",
			gfxAtlas = "mod_assets/textures/flowers_1.tga",
			gfxIndex = 0,
			weight = 0.2,
			stackable = true,
		},
	},
}
defineMaterial{
	name = "Bonny_Pe",
	diffuseMap = "mod_assets/models/flowers/Bonny_Pe.tga",
--	specularMap = "assets/textures/common/black.tga",
	doubleSided = true,
	lighting = false,
	alphaTest = true,
	blendMode = "Opaque",
	textureAddressMode = "Wrap",
	glossiness = 20,
	depthBias = 0,
}

minmay
Posts: 2558
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay » Fri Aug 16, 2019 12:56 am

change

Code: Select all

lighting = false,
to

Code: Select all

lighting = true,
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.

User avatar
Lorial
Posts: 47
Joined: Sat Dec 29, 2018 12:27 pm

Re: Ask a simple question, get a simple answer

Post by Lorial » Sat Aug 17, 2019 5:13 am

1) Can I activate a function X within a script with a simple console command ingame?
And does it activate the first function within that script so that I have to specify? For instance, I want to skip the first function with alcoveContains and get right to the "proper item placed on surface so do this and that" part.

2) Can I strip a surface from all its current contents before destroying the altar/alcove/misc?

3) How to move an item via script? Preferably in combination with 2) to empty an alcove and move the items to X,Y.

Thanks in advance

Post Reply