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
7Soul
Posts: 209
Joined: Sun Oct 19, 2014 1:56 am
Location: Brazil

Re: Ask a simple question, get a simple answer

Post by 7Soul »

minmay wrote: Mon Aug 12, 2019 8:21 pm

Code: Select all

onDamage = function(self, champion, damage, damageType)
	if GameMode.damageRecurse then
		GameMode.damageRecurse = nil
		return true
	elseif damage > 1 then
		damage = math.max(1,damage-champion:getLevel())
		GameMode.damageRecurse = true
		champion:damage(damage,"pure")
		return false
	end
end
Minmay you're a beast! But where did this "GameMode.damageRecurse" come from?
Join the LoG discord server: https://discord.gg/ArgAgNN :D

My Mods
User avatar
THOM
Posts: 1274
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Ask a simple question, get a simple answer

Post by THOM »

vanblam wrote: Mon Aug 12, 2019 5:56 pm Silly question, can you spread items across a surface, instead of it all being clumped in one spot?
By the mechanics of the vanilla game: no.

But you can use GameObject:setSubtileOffset(x, y) to change the placement of an item on a surface. You can use this to place items at their starting location in the game and you can write a function that places an object every time it is put on a surface...
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
minmay
Posts: 2780
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay »

7Soul wrote: Mon Aug 12, 2019 8:53 pmMinmay you're a beast! But where did this "GameMode.damageRecurse" come from?
Umm...my brain I guess? Naming variables is hard.
It would be cleaner to use an upvalue instead of sticking it in GameMode of course, but I don't remember whether that hook gets serialized (if it does, using an upvalue in it wouldn't work) and was too lazy to check, so I put the variable in GameMode instead.
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: 3185
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac »

I believe this was mistaking the variable name for being an undocumented game function.
User avatar
7Soul
Posts: 209
Joined: Sun Oct 19, 2014 1:56 am
Location: Brazil

Re: Ask a simple question, get a simple answer

Post by 7Soul »

minmay wrote: Mon Aug 12, 2019 9:21 pm
7Soul wrote: Mon Aug 12, 2019 8:53 pmMinmay you're a beast! But where did this "GameMode.damageRecurse" come from?
Umm...my brain I guess? Naming variables is hard.
It would be cleaner to use an upvalue instead of sticking it in GameMode of course, but I don't remember whether that hook gets serialized (if it does, using an upvalue in it wouldn't work) and was too lazy to check, so I put the variable in GameMode instead.
It's what Isaac said, I didn't know you could set variables like that
Join the LoG discord server: https://discord.gg/ArgAgNN :D

My Mods
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 »

For ItemConstrainBox, is there a part to this that will allow it block thrown objects?
minmay
Posts: 2780
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay »

No, you need ProjectileColliderComponent for that.
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 Aug 13, 2019 12:01 am No, you need ProjectileColliderComponent for that.
Ahh I see. Thanks
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 »

I'm using minmays modified blender import/export and I'm trying to use the foliage utilities, I can't seem to get it to work anymore, I've used it in the past on my grass and it worked properly. I made a tree with some branches and its animated, I added the custom_normal vertex group to the model, created an empty that I labeled tree_normal and I put it about 10 units away from the tree. In Grimrock I still have the same black parts on some branches ( I have moved that tree_normal in every which way possible). Now when I removed the vertex group and the empty, I still have the same exact black branches, its as tho the foliage utilities have no effect what so ever. Is there something I'm missing?

Here is my blender set up.

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

Re: Ask a simple question, get a simple answer

Post by minmay »

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.
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.
Post Reply