How to use the lindworm?

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!
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

How to use the lindworm?

Post by bongobeat »

does anyone succeed to use the lindworm as a basic melee monster or shooting monster?

I have try melee brain, but it don't hurt, he can't even be killed.
With a ogre brain, same thing and no charge.
I have tried with a magma golem brain and a xeloroid brain, only the ranged attack works.

seems that the line
SpoilerShow
shape = "cross",
is here to prevent player to go close to the monster. But when it is activated, the ranged attack don't work anymore.
what is the use of

Code: Select all

			juggernaut = true,
?

so far, my unkillable lindworm fireball shooter with the magma golem brain (god modeOn):
I ve put a groundPound attack, because the brain needs it, or it will always give error in the console.

some of the animations are desactivated.
SpoilerShow

Code: Select all

defineObject{
	name = "lindworm_melee",
	baseObject = "base_monster",
	components = {
		{
			class = "Model",
			model = "assets/models/monsters/lindworm.fbx",
			storeSourceData = true,
		},
		{
			class = "Animation",
			animations = {
				idle = "assets/animations/monsters/lindworm/lindworm_idle.fbx",
				moveForward = "assets/animations/monsters/lindworm/lindworm_walk.fbx",
				turnLeft = "assets/animations/monsters/lindworm/lindworm_turn_left.fbx",
				turnRight = "assets/animations/monsters/lindworm/lindworm_turn_right.fbx",
				attack = "assets/animations/monsters/lindworm/lindworm_attack.fbx",
				attackFrontLeft = "assets/animations/monsters/lindworm/lindworm_attack_front_left.fbx",
				attackFrontRight = "assets/animations/monsters/lindworm/lindworm_attack_front_right.fbx",
				rangedAttack = "assets/animations/monsters/lindworm/lindworm_ranged_attack.fbx",
				wingAttack = "assets/animations/monsters/lindworm/lindworm_wing_attack.fbx",
				getHitFrontLeft = "assets/animations/monsters/lindworm/lindworm_get_hit_front_left.fbx",
				getHitFrontRight = "assets/animations/monsters/lindworm/lindworm_get_hit_front_right.fbx",
				getHitBack = "assets/animations/monsters/lindworm/lindworm_get_hit_back.fbx",
				getHitLeft = "assets/animations/monsters/lindworm/lindworm_get_hit_left.fbx",
				getHitRight = "assets/animations/monsters/lindworm/lindworm_get_hit_right.fbx",
--				fall = "assets/animations/monsters/lindworm/lindworm_get_hit_front_left.fbx",
--				knockback = "assets/animations/monsters/lindworm/lindworm_knockback.fbx",
--				charge = "assets/animations/monsters/lindworm/lindworm_dash.fbx",
				roar = "assets/animations/monsters/lindworm/lindworm_roar.fbx",
--				summon = "assets/animations/monsters/lindworm/lindworm_summon.fbx",
--				intro = "assets/animations/monsters/lindworm/lindworm_intro.fbx",
				death = "assets/animations/monsters/lindworm/lindworm_death.fbx",			},
			currentLevelOnly = true,
		},
		{
			class = "Monster",
			meshName = "lindworm_mesh",
			footstepSound = "ogre_footstep",
			hitSound = "lindworm_hit",
			dieSound = "lindworm_die",
			hitEffect = "hit_dust",
		--	deathEffect = "lindworm_explode",
			capsuleHeight = 0.8,
			capsuleRadius = 0.25,
			collisionRadius = 3.5,
			collisionHeight = 5,
			health = 30,
			protection = 10,
			exp = 1000,
			immunities = { "assassination", "sleep", "frozen", "blinded", "knockback", "burning" },
			resistances = {
				fire = "immune",
				shock = "resist",
				frost = "resist",
				poison = "resist",
			},
		--	shape = "cross",
			juggernaut = true,
			onInit = function(self)
				self:setMonsterFlag("CantDie", true)
			end,
		},
		{
			class = "MonsterMove",
			name = "move",
			sound = "lindworm_walk",
			cooldown = 0.1,
		},
		{
			class = "MonsterTurn",
			name = "turn",
			sound = "lindworm_walk",
		},
		{
			class = "MagmaGolemBrain",
			name = "brain",
			sight = 30,
			morale = 100,
			seeInvisible = true,
			allAroundSight = true,
		},
		{
			class = "MonsterAttack",
			name = "basicAttack",
			animation = "attack",
			attackPower = 80,
			pierce = 5,
			accuracy = 30,
			woundChance = 60,
			reach = 2,
			cooldown = 4,
			sound = "lindworm_attack",
			--impactSound = "ogre_impact",
			cameraShake = true,
			screenEffect = "damage_screen",
		},
		{
			class = "MonsterAttack",
			name = "turnAttack",
			animation = "wingAttack",
			attackPower = 90,
			cooldown = 5,
			sound = "lindworm_attack",
			accuracy = 70,
			woundChance = 40,
			cameraShake = true,
			cameraShakeIntensity = 0.7,
			screenEffect = "damage_screen",
		},
		{
			class = "MonsterAttack",
			name = "groundPound",
			animation = "roar",
			cooldown = 8,
			repeatChance = 0,
			sound = "magma_golem_ground_pound",
			onAttack = function(self)
				local x,y = self.go.x,self.go.y
				local dx,dy = getForward(self.go.facing)
				x = x + dx
				y = y + dy
				spawn("wizard_explosion", self.go.level, x, y, 0, self.go.elevation)
				party.party:shakeCamera(0.7, 0.3)
			end,
		},
		{
			class = "MonsterAttack",
			name = "rangedAttack",
			attackType = "projectile",
			attackPower = 50,
			cooldown = 4,
			animation = "rangedAttack",
			sound = "magma_golem_ranged_attack",
			shootProjectile = "magma_meteor",
		},
	},
}
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Re: How to use the lindworm?

Post by minmay »

There's no way another builtin brain will work with the lindworm. Either use LindwormBrainComponent or write your own brain. I believe juggernaut is what allows it to kill other monsters by walking into them.
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.
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: How to use the lindworm?

Post by bongobeat »

by create your own brain, did that mean a script?
if yes, do you have any exemple of this?

for a custom brain that's what it is written in the scripting reference.

Code: Select all

or implement a custom onThink hook. 
This is Chinese for me :roll:

You are right, after test, juggernaut allow the lindworm to crush other monster.
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Re: How to use the lindworm?

Post by minmay »

Yes, you just add a plain BrainComponent with an onThink hook. Here's a list of functions you can call from within onThink(). This page might be useful too.
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.
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: How to use the lindworm?

Post by bongobeat »

I finally did not succes to make some script, but I use a meleebrain:

this works, but the shooting projectile position must be modified.
SpoilerShow

Code: Select all

defineObject{
	name = "lindworm_RangedBrain",
	baseObject = "base_monster",
	components = {
		{
			class = "Model",
--			model = "assets/models/monsters/lindworm.fbx",
			model = "mod_assets/models/lindworm.fbx",
			storeSourceData = true,
		},
		{
			class = "Animation",
			animations = {
				idle = "assets/animations/monsters/lindworm/lindworm_idle.fbx",
				moveForward = "assets/animations/monsters/lindworm/lindworm_walk.fbx",
				turnLeft = "assets/animations/monsters/lindworm/lindworm_turn_left.fbx",
				turnRight = "assets/animations/monsters/lindworm/lindworm_turn_right.fbx",
				attack = "assets/animations/monsters/lindworm/lindworm_attack.fbx",
				attackFrontLeft = "assets/animations/monsters/lindworm/lindworm_attack_front_left.fbx",
				attackFrontRight = "assets/animations/monsters/lindworm/lindworm_attack_front_right.fbx",
				rangedAttack = "assets/animations/monsters/lindworm/lindworm_ranged_attack.fbx",
				wingAttack = "assets/animations/monsters/lindworm/lindworm_wing_attack.fbx",
				getHitFrontLeft = "assets/animations/monsters/lindworm/lindworm_get_hit_front_left.fbx",
				getHitFrontRight = "assets/animations/monsters/lindworm/lindworm_get_hit_front_right.fbx",
				getHitBack = "assets/animations/monsters/lindworm/lindworm_get_hit_back.fbx",
				getHitLeft = "assets/animations/monsters/lindworm/lindworm_get_hit_left.fbx",
				getHitRight = "assets/animations/monsters/lindworm/lindworm_get_hit_right.fbx",
				fall = "assets/animations/monsters/lindworm/lindworm_get_hit_front_left.fbx",
				roar = "assets/animations/monsters/lindworm/lindworm_roar.fbx",
				death = "assets/animations/monsters/lindworm/lindworm_death.fbx",
			},
			currentLevelOnly = true,
		},
		{
			class = "Monster",
			meshName = "lindworm_mesh",
			footstepSound = "ogre_footstep",
			hitSound = "lindworm_hit",
			dieSound = "magma_golem_die",
			hitEffect = "hit_dust",
--			deathEffect = "lindworm_explode",
			capsuleHeight = 0.8,
			capsuleRadius = 0.25,
			collisionRadius = 3.5,
			collisionHeight = 5,
			health = 3000,
			protection = 10,
			exp = 1000,
				lootDrop = { 100, "lindworm_meat", 50, "lindworm_meat", 25, "lindworm_heart_meat", 15, "lindworm_heart_meat" },
			immunities = { "assassination", "sleep", "frozen", "blinded", "knockback", "burning" },
			resistances = {
				fire = "immune",
				shock = "resist",
				frost = "resist",
				poison = "resist",
			},
	--		shape = "cross",
	--		juggernaut = true,
	--		onInit = function(self)
	--			self:setMonsterFlag("CantDie", true)
	--		end,
		},
		{
			class = "MonsterMove",
			name = "move",
			sound = "lindworm_walk",
			cooldown = 0.1,
		},
		{
			class = "MonsterTurn",
			name = "turn",
			sound = "lindworm_walk",
		},
		{
			class = "RangedBrain",
			name = "brain",
			sight = 10,
			morale = 100,
		},
		{
			class = "MonsterAttack",
			name = "basicAttack",
			animation = "attack",
			reach = 1,
			attackPower = 35,
			pierce = 5,
			accuracy = 15,
			cooldown = 4,
			woundChance = 30,
			sound = "lindworm_attack",
			cameraShake = true,
			screenEffect = "damage_screen",
		},
		{
			class = "MonsterAttack",
			name = "rangedAttack",
			attackType = "projectile",
			attackPower = 50,
			minDistance = 2,
			cooldown = 4,
			animation = "rangedAttack",
			sound = "lindworm_roar",
			shootProjectile = "magma_meteor",
		},
	},
}
SpoilerShow
Image
also how can this projectile position be changed?
SpoilerShow

Code: Select all

{
			class = "MonsterAttack",
			name = "rangedAttack",
			attackType = "projectile",
			attackPower = 50,
			minDistance = 2,
			cooldown = 4,
			animation = "rangedAttack",
			sound = "lindworm_roar",
			shootProjectile = "magma_meteor",
		},
I don't want the magician on the lindworm, so I use an "invisible" texture, to hide the magician. Then make a new lindworm model and replace the materials "healing_crystal", battle_axe", "wizard" and "master_key" by the invisible material in the gmt.
SpoilerShow

Code: Select all

defineMaterial{
	name = "invisib",
	diffuseMap = "assets/textures/common/black.tga",
	doubleSided = false,
	lighting = false,
	alphaTest = false,
	blendMode = "Additive",
	textureAddressMode = "Wrap",
	glossiness = 20,
	depthBias = 0,
}
now the leather saddle and ribbons are still there. To minimise their visual effect, I ve modified the texture of the lindworm that they look like lindworm skin, but the ribbons are still a great problem :lol:
it can be weird, while seeing those thing floating.
SpoilerShow
Image
I wonder if some experienced 3d moder can make a new lindworm, without the magician, and all leather saddle and stuff?
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Re: How to use the lindworm?

Post by minmay »

You should just delete the wizard part of the mesh instead. The animations don't care about the vertices actually being there, I don't think they even care if the bones are actually there. This takes literally less than 20 seconds, here's a model with it already done (use "save link as"): model

*might have changed the normals on the wings due to Blender limitations, sorry
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.
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: How to use the lindworm?

Post by bongobeat »

Thanks! I did not thought that it will be so easyly done in blender! :lol:
sorry for bothering you!

no problem, anyway I'm not using the normal map of the lindworm. Too big file!

<-- downloaded!
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Re: How to use the lindworm?

Post by minmay »

The model normals are completely separate from the normal map. Whether you use a normal map or not they will still be meaningful. See http://en.wikipedia.org/wiki/Normal_mapping. Also, why are you not using the normal map?!?!? There is no reason to do that, it's already in grimrock2.dat!
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.
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: How to use the lindworm?

Post by bongobeat »

minmay wrote:The model normals are completely separate from the normal map. Whether you use a normal map or not they will still be meaningful. See http://en.wikipedia.org/wiki/Normal_mapping. Also, why are you not using the normal map?!?!? There is no reason to do that, it's already in grimrock2.dat!
sorry I misunderstood you. I ve seen what you mean while testing it.

because this texture is about 2,66Mb.
With my "memory limitation", I'm trying to remove as many "no needed" textures I can.
so, this will avoid 2,66 mb of texture to be loaded in memory.

I use the beach_ground normal texture instead.

anyway, this is just a test. I don't use the lindworm right now. I need a dragon, like the log1 dragon (I mean the custom ice lizard monster, which is bigger) and the lindworm is better and will do the job. Until I got one perfect lindworm.
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: How to use the lindworm?

Post by bongobeat »

does anybody know, how to change a spawned spell position?
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
Post Reply