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
Lorial
Posts: 91
Joined: Sat Dec 29, 2018 12:27 pm

Re: Ask a simple question, get a simple answer

Post by Lorial »

I am trying to make a breakable object with immunities to everything except for damageType "X", but "physical" seems to cover every type of melee damage type. No custom damageType I add to weapons works, including "pure" and "dispel". Apparently, "resistances" as used for monsters does not work for "health" component.
What am I missing?!
minmay
Posts: 2780
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay »

HealthComponents with immunity to physical damage also become unaffected by all melee, projectile, and firearm attacks. That's just what it does. Not much else to say.
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: 243
Joined: Sun Nov 09, 2014 12:15 am

Re: Ask a simple question, get a simple answer

Post by vanblam »

Has anyone figured out how to create a custom grass or vegetation that does not have dark/black areas on it? I have tried everything I can think of to get my grass to look like forest grass (not animated). I keep running into the same problem over and over. I set up my object and material scripts identical to vegetation_atlas. I've exported the model in many different fashions (smooth/flat shade), the meshes are just simple planes with a texture lol. My normal map and specular are very similar and I've tried it without both, came out the same.

Image
There Grass

Image
My Grass
User avatar
Skuggasveinn
Posts: 562
Joined: Wed Sep 26, 2012 5:28 pm

Re: Ask a simple question, get a simple answer

Post by Skuggasveinn »

Have you tried creating a Foliage vertex group in Blender ?

Image

That was supposed to help with lights for grass etc .

edit (link to the original thread).
viewtopic.php?f=22&t=8086&hilit=bitcpy&start=50#p86862

Skuggasveinn.
Link to all my LoG 2 assets on Nexus.
Link to all my LoG 1 assets on Nexus.
User avatar
vanblam
Posts: 243
Joined: Sun Nov 09, 2014 12:15 am

Re: Ask a simple question, get a simple answer

Post by vanblam »

Skuggasveinn wrote: Tue Apr 02, 2019 1:48 am Have you tried creating a Foliage vertex group in Blender ?

Image

That was supposed to help with lights for grass etc .

edit (link to the original thread).
viewtopic.php?f=22&t=8086&hilit=bitcpy&start=50#p86862

Skuggasveinn.
Thanks man :D that did the trick. I did have a feeling it had something to do with normals lol
minmay
Posts: 2780
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay »

I plan to port the importer/exporter to Blender 2.8 a few months from now, and support the Normal Edit modifier in the exporter.

Another thing that can make your foliage dark aside from the normals: as you might have noticed, double sided materials only get lit properly from one side. If your double-sided mesh is really low-poly - like this one - it can be worth it to use a single-sided material with 2 copies of each face (one facing each way) instead of a double-sided material.
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: 243
Joined: Sun Nov 09, 2014 12:15 am

Re: Ask a simple question, get a simple answer

Post by vanblam »

minmay wrote: Tue Apr 02, 2019 3:27 am I plan to port the importer/exporter to Blender 2.8 a few months from now, and support the Normal Edit modifier in the exporter.

Another thing that can make your foliage dark aside from the normals: as you might have noticed, double sided materials only get lit properly from one side. If your double-sided mesh is really low-poly - like this one - it can be worth it to use a single-sided material with 2 copies of each face (one facing each way) instead of a double-sided material.
I was thinking of checking that out, because they are very low poly. I cant wait for your importer :D
User avatar
akroma222
Posts: 1029
Joined: Thu Oct 04, 2012 10:08 am

Re: Ask a simple question, get a simple answer

Post by akroma222 »

minmay wrote: Sat Mar 30, 2019 7:16 pm

Code: Select all

defineObject{
	name = "really_crappy_gun",
	baseObject = "base_item",
	components = {
		{
			class = "Model",
			model = "assets/models/items/pistol.fbx",
		},
		{
			class = "Item",
			uiName = "Really Crappy Gun",
			gfxIndex = 333,
			impactSound = "impact_blunt",
			weight = 1.1,
			traits = { "firearm" },
		},
		{
			class = "FirearmAttack",
			attackPower = 5,
			cooldown = 6,
			range = 1,
			attackSound = "gun_shot_small",
			ammo = "pellet",
			requirements = { "firearms", 1 },
			onAttack = function(self, champion, slot)
				self:setRange(1-champion:getSkillLevel("firearms"))
			end,
			onPostAttack = function(self, champion, slot)
				self:setRange(1)
			end,
		},
	},
}
It's a bit more involved if you want the firearm to be able to jam or backfire (jams don't call onPostAttack, backfires call onBackfire instead of onPostAttack) but still fairly simple, and I can explain how to do that too if needed.
Minmay - hoping your offer is still on the table - just how to re-implement the Jammed and Backfire features..??
( explain / dot point / post a simple example - just need to make sure I dont forget anything ;-) )
Many thanks!
Akroma
minmay
Posts: 2780
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay »

That wasn't an offer to re-implement jamming and backfiring, it was an offer to make the fixed range work with jams and backfires.
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
akroma222
Posts: 1029
Joined: Thu Oct 04, 2012 10:08 am

Re: Ask a simple question, get a simple answer

Post by akroma222 »

minmay wrote: Tue Apr 02, 2019 7:45 pm That wasn't an offer to re-implement jamming and backfiring, it was an offer to make the fixed range work with jams and backfires.
True that, my mistake :oops:
This is one of the last features for Firearm attack I need to fix up (but I know nothing of the math involved)
I will post again when I know exactly what I need to find out 8-)
Post Reply