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!
billb52

Re: Ask a simple question, get a simple answer

Post by billb52 »

Zo Kath Ra
Thankyou for your speedy reply, it is exactly what I wanted and works a dream!
Pompidom
Posts: 497
Joined: Sun May 06, 2018 9:42 pm

Re: Ask a simple question, get a simple answer

Post by Pompidom »

Turtles drop between 0 - 2 turtle steaks at default.
What's the quickest way to turn off all "default randomized" drops?
User avatar
Isaac
Posts: 3192
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac »

MonsterComponent:setLootDrop(table) Will replace an individual turtle's loot, or you could redefine the turtle's monster definition to affect them all; just change the table to suit.

Code: Select all

lootDrop = { 75, "turtle_steak", 75, "turtle_steak" },
This is the default, and it sets a 75% chance for a steak, twice.

The complete monster definition is in the downloadable asset pack for the game.

But this abbreviated definition should work for you; just change the percentages in the loot table.

Code: Select all

--Place in monsters.lua, in the mod scripts folder.
defineObject{
	name = "turtle",
	baseObject = "turtle",
	components = {
		{
			class = "Monster",
			meshName = "turtle_mesh",
			hitSound = "turtle_hit",
			dieSound = "turtle_die",
			footstepSound = "turtle_footstep",
			hitEffect = "hit_blood",
			capsuleHeight = 0.2,
			capsuleRadius = 0.7,
			health = 90,
			evasion = -10,
			exp = 60,
			resistances = { ["poison"] = "weak" },
			traits = { "animal" },
			headRotation = vec(90, 0, 0),

			lootDrop = { 75, "turtle_steak", 75, "turtle_steak" },
		},
	
	},
}
Pompidom
Posts: 497
Joined: Sun May 06, 2018 9:42 pm

Re: Ask a simple question, get a simple answer

Post by Pompidom »

I finally got around downloading the default grimrock 2 asset pack, I added the 2 lines to my init.lua, but no dice.
No explanation how to add it...

https://ibb.co/fBdAzo

As usual, I have no idea what I'm doing :p
User avatar
THOM
Posts: 1281
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Ask a simple question, get a simple answer

Post by THOM »

Well - question is, what do you want to do?
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
Pompidom
Posts: 497
Joined: Sun May 06, 2018 9:42 pm

Re: Ask a simple question, get a simple answer

Post by Pompidom »

Adding the complete asset pack I suppose and activating it in my mod like I did with all the other stuff by adding the correct lines into my init.lua file. For example the asset pack contains a "snail" monster from LoG1. So basically as long I can't see a snail in my monster list in the dungeon editor, then I suppose I failed to add properly the downloadable asset pack :cry:

https://ibb.co/cMdFX8

The assets folder is the grimrock2_asset_pack_2
User avatar
Isaac
Posts: 3192
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac »

First principle here, is that the game already has the asset pack imported as part of it. By making user defined assets, one both creates new assets, and can overwrite any existing assets that they assign an identical name. See the above script, and where it lists its own name as the turtle, and uses the existing turtle object as a base for itself. In this way it overwrites the defined turtle object, while retaining its own changes to it.

The first line of the script is a comment, it mentions where to save the file in your mod folder.
Last edited by Isaac on Sun Jun 24, 2018 7:44 pm, edited 1 time in total.
User avatar
THOM
Posts: 1281
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Ask a simple question, get a simple answer

Post by THOM »

You don't need to add the asset pack because it's already loaded when you start the game (or the editor). Mind that alle assets from the main-game lie in a folder called "assets". This is already included in the game-file.

All added assets are usuall placed in a folder named "mod_assets" (and so the path-names starts to these assets).

Now the confusing part: Some assets are included in the game-file (like the model and the texture of the snail you've mentioned) but the definition is not.

I can't remember exactly but I think there is a definition of the snail included in the script folder of the asset-pack, but it is not "activated" - no path leads to it. So that would be the task to be done by you.

EDIT: Kind of a race between Isaac and me, hm? :D
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
User avatar
Isaac
Posts: 3192
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac »

Assets for some of the Grimrock 1 monsters exist in the Grimrock 2 asset pack, but they are not defined in the Grimrock 2 game. They don't all work in polished manner either. The snail (for instance) has default animations that will clip its eye-stalks through some of the LoG2 doors. The floor grates in LoG2 do not accommodate the Tentacle monster's animations; and actually that can't be fixed without using a custom floor grate model.
User avatar
THOM
Posts: 1281
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Ask a simple question, get a simple answer

Post by THOM »

Concerning the LoG1 monsters mind that there are a few things to look at when you want to include them.

have a look at this thread: viewtopic.php?f=22&t=8278
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
Post Reply