Page 1 of 5

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

Posted: Mon Nov 03, 2014 12:46 pm
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,
	}


Re: [WIP] Bring on the snails!

Posted: Mon Nov 03, 2014 1:19 pm
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. :)

Re: [WIP] Bring on the snails!

Posted: Mon Nov 03, 2014 1:22 pm
by Doridion
Sticked in the superthread !

Re: [WIP] Bring on the snails!

Posted: Mon Nov 03, 2014 1:45 pm
by Drakkan
Doridion wrote:Sticked in the superthread !
you mean snailed to the superthread ? :)

good to see these "little boys" back in LOG !

Re: [WIP] Bring on the snails!

Posted: Mon Nov 03, 2014 2:13 pm
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)

Re: [WIP] Bring on the snails!

Posted: Mon Nov 03, 2014 2:33 pm
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.

Re: [WIP] Bring on the snails!

Posted: Mon Nov 03, 2014 2:35 pm
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,

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

Posted: Mon Nov 03, 2014 2:37 pm
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!

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

Posted: Mon Nov 03, 2014 2:41 pm
by Prozail
;)

But you have the same issue? no damage done whatsoever?

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

Posted: Mon Nov 03, 2014 2:42 pm
by NutJob
Grimfan wrote:[...]Then I read the screen again and looked at the script and then facepalmed!
My typical day. =)