[Monster] Bring on the snails! [now with turbo-mode]

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
Prozail
Posts: 158
Joined: Mon Oct 27, 2014 3:36 pm

[Monster] Bring on the snails! [now with turbo-mode]

Post by Prozail »

Started trying to figure out the full monster-definitions..
Yes, the snail model, animations, textures, and sounds are all in the .dat from the start, you only need to add scripts.

Note: When dabbling with definition files outside the editor... Some changes gets read on CTRL+R, but not all.. some stuff is cached!
So! RESTART YOUR EDITOR EVERY ONCE IN A WHILE


Monster definition

Code: Select all


defineAnimationEvent{
	 animation = "assets/animations/monsters/snail/snail_attack.fbx",
	 event = "attack",
	 frame = 13,
}

defineObject{
	name = "snail",
	baseObject = "base_monster",
	components = {
		{
			class = "Model",
			model = "assets/models/monsters/snail.fbx",
			storeSourceData = true,
		},
		{
			class = "Animation",
			name = "animation",
			currentLevelOnly = true,
			animations = {
				idle = "assets/animations/monsters/snail/snail_idle.fbx",
				moveForward = "assets/animations/monsters/snail/snail_walk.fbx",
				turnLeft = "assets/animations/monsters/snail/snail_turn_left.fbx",
				turnRight = "assets/animations/monsters/snail/snail_turn_right.fbx",
				attack = "assets/animations/monsters/snail/snail_attack.fbx",
				getHitFrontLeft = "assets/animations/monsters/snail/snail_get_hit_front_left.fbx",
				getHitFrontRight = "assets/animations/monsters/snail/snail_get_hit_front_right.fbx",
				getHitBack = "assets/animations/monsters/snail/snail_get_hit_back.fbx",
				getHitLeft = "assets/animations/monsters/snail/snail_get_hit_left.fbx",
				getHitRight = "assets/animations/monsters/snail/snail_get_hit_right.fbx",
				fall = "assets/animations/monsters/snail/snail_get_hit_front_left.fbx",
			},
		},
		{
			class = "Monster",
			meshName = "snail_mesh",
			level=1,
			health = 90,
			evasion = -10,
			exp = 60,
			lootDrop = { 75, "snail_slice", 10, "snail_slice" },
			traits = { "animal" },
			hitEffect = "hit_goo",
			capsuleHeight = 0.2,
			capsuleRadius = 0.7,
			hitSound = "snail_hit",
			dieSound = "snail_die",
		},
		{
			class = "MeleeBrain",
			name = "brain",
			sight = 2.5,
		},
		{
			class = "MonsterMove",
			name = "move",
			sound = "snail_walk",
			resetBasicAttack = false,
			turnDir = 0,
			cooldown = 4,
		},
		{
			class = "MonsterTurn",
			name = "turn",
			sound = "snail_walk",
			cooldown = 4,
		},
		{
			class = "MonsterAttack",
			name = "basicAttack",
			sound = "snail_attack",
			cooldown = 4,
			attackPower = 6,
			animationSpeed = 1,
			animation = "attack",
		},
	}
}

Materials and sounds

Code: Select all

defineMaterial{
	name = "snail",
	diffuseMap = "assets/textures/monsters/snail_dif.tga",
	specularMap = "assets/textures/monsters/snail_spec.tga",
	normalMap = "assets/textures/monsters/snail_normal.tga",
	doubleSided = false,
	lighting = true,
	alphaTest = false,
	blendMode = "Opaque",
	textureAddressMode = "Wrap",
	glossiness = 100,
	depthBias = 0,
}


defineMaterial{
	name = "snail_shell",
	diffuseMap = "assets/textures/monsters/snail_dif.tga",
	specularMap = "assets/textures/monsters/snail_spec.tga",
	normalMap = "assets/textures/monsters/snail_normal.tga",
	doubleSided = false,
	lighting = true,
	alphaTest = false,
	blendMode = "Opaque",
	textureAddressMode = "Wrap",
	glossiness = 40,
	depthBias = 0,
}

--- Sounds


	defineSound{
		name = "snail_walk",
		filename = "assets/samples/monsters/snail_walk_01.wav",
		loop = false,
		volume = 0.7,
		minDistance = 1,
		maxDistance = 10,
	}

	defineSound{
		name = "snail_attack",
		filename = {
			"assets/samples/monsters/snail_attack_01.wav",
			--"assets/samples/monsters/snail_attack_02.wav",
		},
		loop = false,
		volume = 1,
		minDistance = 1,
		maxDistance = 10,
	}

	defineSound{
		name = "snail_hit",
		filename = { 
			"assets/samples/weapons/hit_bone_01.wav",
			"assets/samples/weapons/hit_bone_02.wav",
			"assets/samples/weapons/hit_flesh_01.wav",
		},
		loop = false,
		volume = 1,
		minDistance = 1,
		maxDistance = 10,
	}

	defineSound{
		name = "snail_die",
		filename = "assets/samples/monsters/snail_die_01.wav",
		loop = false,
		volume = 1,
		minDistance = 1,
		maxDistance = 10,
	}

Last edited by Prozail on Thu Nov 06, 2014 9:15 am, edited 10 times in total.
Grimfan
Posts: 369
Joined: Wed Jan 02, 2013 7:48 am

Re: [WIP] Bring on the snails!

Post by Grimfan »

This should definitely be added to the Monster Thread if you can get an actual snail working Prozail (the Monster Thread is linked to the Editing Superthread as a sort of monster repository to keep all the monsters in more or less one place). I was going to start this process once the asset pack was out, but a far better modder (yourself of course) has already started the process. :)
User avatar
Doridion
Posts: 256
Joined: Tue Jun 10, 2014 9:23 pm

Re: [WIP] Bring on the snails!

Post by Doridion »

Sticked in the superthread !
User avatar
Drakkan
Posts: 1318
Joined: Mon Dec 31, 2012 12:25 am

Re: [WIP] Bring on the snails!

Post by Drakkan »

Doridion wrote:Sticked in the superthread !
you mean snailed to the superthread ? :)

good to see these "little boys" back in LOG !
Breath from the unpromising waters.
Eye of the Atlantis
User avatar
Prozail
Posts: 158
Joined: Mon Oct 27, 2014 3:36 pm

Re: [WIP] Bring on the snails!

Post by Prozail »

Ok.. there is something wrong that i can't figure out.

I have him up and running, chasing me and such, but when he attacks, he never hits or does any damage whatsoever.
Right now i've thrown every variant of property into the MonsterAttack Component, just for testing, and nothing seems to do anything.
The hooks are working as intended though, so... WHAT am i missing?

(updated first post, and you only need the script to test it, no external resources)
Grimfan
Posts: 369
Joined: Wed Jan 02, 2013 7:48 am

Re: [WIP] Bring on the snails!

Post by Grimfan »

I'm getting the following repeated everytime the snail attacks:

onBeginAction table: 0x3b0f7bc8
onEndAction table: 0x3b0f7bc8

This is not probably news to you, but I'd thought I'd post it anyhow.
NutJob
Posts: 426
Joined: Sun Oct 19, 2014 6:35 pm

Re: [WIP] Bring on the snails!

Post by NutJob »

Grimfan wrote:I'm getting the following repeated everytime the snail attacks:

onBeginAction table: 0x3b0f7bc8
onEndAction table: 0x3b0f7bc8

It's letting you know it's working, that's it.

Code: Select all

         onBeginAction = function(self)
            print("onBeginAction",self)
            return true
         end,
         onPerformAction = function(self,a,b,c)
            print("onPerformAction",self,a,b,c)
            return true
         end,
         onEndAction = function(self)
            print("onEndAction",self)
            return true
         end,
Grimfan
Posts: 369
Joined: Wed Jan 02, 2013 7:48 am

Re: [WIP] Bring on the snails! *stuck*

Post by Grimfan »

Yeah, I posted then stupidly just realized that when I looked at it again. :oops:

I was half doing that and half looking at something else at the same time. Then I read the screen again and looked at the script and then facepalmed!
User avatar
Prozail
Posts: 158
Joined: Mon Oct 27, 2014 3:36 pm

Re: [WIP] Bring on the snails! *stuck*

Post by Prozail »

;)

But you have the same issue? no damage done whatsoever?
NutJob
Posts: 426
Joined: Sun Oct 19, 2014 6:35 pm

Re: [WIP] Bring on the snails! *stuck*

Post by NutJob »

Grimfan wrote:[...]Then I read the screen again and looked at the script and then facepalmed!
My typical day. =)
Post Reply