Page 3 of 6

Re: [ASSETS] LOG 1 MONSTERS - Enhanced Edition

Posted: Thu Nov 27, 2014 5:30 pm
by Prozail
Tentacles. I went back to the LoG1 source and tried to clean a few things up. Thom and I were overthinking it.

Code: Select all

---

defineAnimationEvent{
	animation = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_attack.fbx",
	event = "attack",
	frame = 15,
}

defineAnimationEvent{
	animation = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_attack.fbx",
	event = "attack",
	frame = 20,
}

defineAnimationEvent{
	animation = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_attack.fbx",
	event = "attack",
	frame = 25,
}

defineAnimationEvent{
	animation = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_attack_left.fbx",
	event = "attack",
	frame = 12,
}

defineAnimationEvent{
	animation = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_attack_left.fbx",
	event = "attack",
	frame = 18,
}

defineAnimationEvent{
	animation = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_attack_left.fbx",
	event = "attack",
	frame = 24,
}

defineAnimationEvent{
	animation = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_attack_right.fbx",
	event = "attack",
	frame = 11,
}

defineAnimationEvent{
	animation = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_attack_right.fbx",
	event = "attack",
	frame = 18,
}

defineAnimationEvent{
	animation = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_attack_right.fbx",
	event = "attack",
	frame = 25,
}

defineAnimationEvent{
	animation = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_attack_back.fbx",
	event = "attack",
	frame = 12,
}

defineAnimationEvent{
	animation = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_attack_back.fbx",
	event = "attack",
	frame = 18,
}

defineAnimationEvent{
	animation = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_attack_back.fbx",
	event = "attack",
	frame = 26,
}
---
defineMaterial{
	name = "drainage_tentacles",
	diffuseMap = "assets/textures/monsters/drain_tentacles_dif.tga",
	specularMap = "assets/textures/monsters/drain_tentacles_spec.tga",
	normalMap = "assets/textures/monsters/drain_tentacles_normal.tga",
	doubleSided = false,
	lighting = true,
	alphaTest = false,
	blendMode = "Opaque",
	textureAddressMode = "Wrap",
	glossiness = 35,
	depthBias = 0,
}
---
	defineSound{
		name = "tentacles_attack",
		filename = "assets/samples/monsters/tentacles_attack_01.wav",
		loop = false,
		volume = 1,
		minDistance = 1,
		maxDistance = 10,
	}

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

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

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

	defineSound{
		name = "tentacles_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 = "tentacles_die",
		filename = "assets/samples/monsters/tentacles_die_01.wav",
		loop = false,
		volume = 1,
		minDistance = 1,
		maxDistance = 10,
	}

---

defineObject{
	name = "tentacles",
	baseObject = "base_monster",
	components = {
	 {
		name = "model",
		class = "Model",
		model = "assets/models/monsters/drainage_tentacles.fbx",
		storeSourceData = true,
	 },
	 {
	 class = "Animation",
	 name = "animation",
	 currentLevelOnly = true,
		animations = {
			idle = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_idle.fbx",
			turnLeft = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_turn_left.fbx",
			turnRight = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_turn_right.fbx",
			hide = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_hide.fbx",
			reveal = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_raise.fbx",
			attack = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_attack.fbx",
			attackBack = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_attack_back.fbx",
			attackLeft = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_attack_left.fbx",
			attackRight = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_attack_right.fbx",
			getHitFrontLeft = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_get_hit_front_left.fbx",
			getHitFrontRight = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_get_hit_front_right.fbx",
			getHitBack = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_get_hit_front_left.fbx",
			getHitLeft = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_get_hit_front_right.fbx",
			getHitRight = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_get_hit_front_left.fbx",
			fall = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_get_hit_front_left.fbx",
		},
	 },
	{
		class = "Monster",
		meshName = "drainage_tentacles_mesh",
		level=1,
		health = 420,
		exp = 320,
		traits = { "animal" },
		immunities = { "assassination", "backstab" },
		hitEffect = "hit_goo",
		capsuleHeight = 1,
		capsuleRadius = 0.1,
		hitSound = "tentacles_hit",
		dieSound = "tentacles_die",
	},
	{
		class = "TentacleBrain",
		name = "brain",
		sight = 2.5,
		allAroundSight = true,
	},
	{
		class = "MonsterMove",
		name = "move",
		sound = "tentacles_walk", 
	},
	{
		class = "MonsterTurn",
		name = "turn",
		animations = { "turnLeft", "turnRight" },
		sound = "tentacles_walk",
	},
	{
		class = "TentacleHide",
		name = "hide"
	},
	{
		class = "MonsterAttack",
		name = "basicAttack",
		sound = "tentacles_attack",
		impactSound = "tentacles_hit",
		accuracy = 15,
		cooldown = 3,
		attackPower = 25,
		animationSpeed = 1, 
		animations = { "attack", "attackBack", "attackLeft", "attackRight" },
		onDealDamage = function(self, champion, damage)
			if math.random() <= 0.2 then
				champion:setConditionValue("paralyzed", 10)
			end
		end,
	},
	},
}


Re: [ASSETS] LOG 1 MONSTERS - Enhanced Edition

Posted: Fri Nov 28, 2014 12:12 am
by THOM
Cool, Prozail - it gets closer and closer.

some comments:
- AFAIK an immunity "assassination" is not supported anymore. Therefore I left it out - couldn't find an equivalent. Unless "knockback" would match.
- I've added the sound "tentacles_retreat"
- the side-attacks doesn't do any damage - even all animations are implemented. something's still missing?

I am still messing around with the attack- and hide-actions. I've scripted a version were Tentacles always hides if the party is diagonal or is approaching from behind (to turn to party). Works fine - but no side- or backattacks of the party are possible anymore. Still this monster is a bit too passive, if I do not add something l,ike that.

Re: [ASSETS] LOG 1 MONSTERS - Enhanced Edition

Posted: Fri Nov 28, 2014 9:06 am
by Prozail
Ahh. i didn't even notice the side attacks didn't do damage, but that's an easy fix. Change all the events to be "attack" instead of "attack_right" etc. I've fixed my above post.

it you want more aggression you can lower the cooldown (and strength) of the attack, or maybe increase the animation speed slightly, say 1.2 or so.

Re: [ASSETS] LOG 1 MONSTERS - Enhanced Edition

Posted: Fri Nov 28, 2014 11:48 am
by THOM
Great. Now I think we've got our Tantacles as we know it from LoG1. That was my aim. To alter it a bit is a task that every Modder can do by his own... :mrgreen:

Fun to figure that out with you, Prozail. 8-)

Again here is the code, final version (I hope):

Code: Select all

-- Tentacles -------------------------------------------------------------

defineAnimationEvent{
animation = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_attack.fbx",
event = "attack",
frame = 15,
}

defineAnimationEvent{
animation = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_attack.fbx",
event = "attack",
frame = 20,
}

defineAnimationEvent{
animation = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_attack.fbx",
event = "attack",
frame = 25,
}

defineAnimationEvent{
animation = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_attack_left.fbx",
event = "attack",
frame = 12,
}

defineAnimationEvent{
animation = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_attack_left.fbx",
event = "attack",
frame = 18,
}

defineAnimationEvent{
animation = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_attack_left.fbx",
event = "attack",
frame = 24,
}

defineAnimationEvent{
animation = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_attack_right.fbx",
event = "attack",
frame = 11,
}

defineAnimationEvent{
animation = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_attack_right.fbx",
event = "attack",
frame = 18,
}

defineAnimationEvent{
animation = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_attack_right.fbx",
event = "attack",
frame = 25,
}

defineAnimationEvent{
animation = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_attack_back.fbx",
event = "attack",
frame = 12,
}

defineAnimationEvent{
animation = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_attack_back.fbx",
event = "attack",
frame = 18,
}

defineAnimationEvent{
animation = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_attack_back.fbx",
event = "attack",
frame = 26,
}

-- ---------------
defineObject{
       name = "tentacles",
       baseObject = "base_monster",
       components = {
          {
	     name = "model",
             class = "Model",
             model = "assets/models/monsters/drainage_tentacles.fbx",
             storeSourceData = true,
	     
          },
          {
             class = "Animation",
             name = "animation",
             currentLevelOnly = true,
             animations = {
             idle = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_idle.fbx",
             turnLeft = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_turn_left.fbx",
             turnRight = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_turn_right.fbx",
    	     hide = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_hide.fbx", 
    	     reveal = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_raise.fbx",	
             attack = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_attack.fbx",
             attackLeft = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_attack_left.fbx",
             attackRight = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_attack_right.fbx",
             getHitFrontLeft = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_get_hit_front_left.fbx",
             getHitFrontRight = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_get_hit_front_right.fbx",
             getHitBack = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_get_hit_front_left.fbx",
             getHitLeft = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_get_hit_front_right.fbx",
             getHitRight = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_get_hit_front_left.fbx",
             fall = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_get_hit_front_left.fbx",
           },
          },
          {
             class = "Monster",
             meshName = "drainage_tentacles_mesh",
             level=1,
             health = 420,
             exp = 320,
             traits = { "animal" },
	     immunities = { "backstab" },
             hitEffect = "hit_goo",
             capsuleHeight = 1,
             capsuleRadius = 0.1,
             hitSound = "tentacles_hit",
             dieSound = "tentacles_die",
          },
          {
             class = "TentacleBrain",
             name = "brain",
             sight = 2.5,
	     allAroundSight = true,
          },
          {
             class = "MonsterMove",
             name = "move",
             sound = "tentacles_walk",      
          },
          {
             class = "MonsterTurn",
             name = "turn",
             sound = "tentacles_walk",    
             animations = { "turnLeft", "turnRight" }, 
          },
   	  {
     	     class = "TentacleHide",
     	     name = "hide",
             sound = "tentacles_retreat", 
     	  },

          {
             class = "MonsterAttack",
             name = "basicAttack",
             sound = "tentacles_attack",  
             impactSound = "tentacles_hit",    
             accuracy = 15,                    
             cooldown = 3,
             attackPower = 25,
             animationSpeed = 1,	--?? set correct? no equivalent in LoG1
             animations = { "attack", "attackBack", "attackLeft", "attackRight" },
	onDealDamage = function(self, champion, damage)
        	if math.random() <= 0.2 then
            	champion:setConditionValue("paralyzed", 10)
        	end
	end,
          },
       }
    }

And don't forget to define the sounds:

Code: Select all

-- Tentacles Sounds --------------------------------------------------------------

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

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

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

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

	defineSound{
		name = "tentacles_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 = "tentacles_die",
		filename = "assets/samples/monsters/tentacles_die_01.wav",
		loop = false,
		volume = 1,
		minDistance = 1,
		maxDistance = 10,
	}

Re: [ASSETS] LOG 1 MONSTERS - Enhanced Edition

Posted: Fri Nov 28, 2014 4:50 pm
by OGDA
Hello,

in the editor preview it works without problems, but when I try it ingame, after a few seconds (no matter on which level of the map) the tentacles retreat/hide and the game crashes:

[string "Tentacles.lua"]:0: attempt to call method 'hide' (a nil value) stack traceback....

I've got the following line in init.lua:
import "assets/scripts/grimrock1/grimrock1_materials.lua"

The first part of your code is in objects.lua (also tried monsters.lua), the second in sounds.lua

Do I need to change something else or does some of the code go elsewhere?

Kind regards,
Joerg

Re: [ASSETS] LOG 1 MONSTERS - Enhanced Edition

Posted: Fri Nov 28, 2014 6:01 pm
by OGDA
After some further tests:

The problem only occurs if I start on a level where there's no tentacle. -> crash

If I start on a level with a tentacle it doesn't crash.
Very strange...

Unfortunately it even crashes when the monster hasn't the hide-flag set. :-/

I guess I also have to copy the assets from the asset pack v2.
That was successfull (textures appear on the tentacles). Is there maybe any file I'm missing?

Re: [ASSETS] LOG 1 MONSTERS - Enhanced Edition

Posted: Fri Nov 28, 2014 6:13 pm
by THOM
When the Tentacle is spawned at the start of a game, it is up on the surface. But after one or two seconds it retreats down.

Maybe there is some collision if the hide method is called, but there is nothing to hide??? Very strange. I'm not good at scripting. Cannot help a lot...

Re: [ASSETS] LOG 1 MONSTERS - Enhanced Edition

Posted: Fri Nov 28, 2014 6:17 pm
by OGDA
What kind of pit or grating element do you use on the tentacle-field?

Re: [ASSETS] LOG 1 MONSTERS - Enhanced Edition

Posted: Fri Nov 28, 2014 6:28 pm
by THOM
Thats not defined AFAIK.

It was not neccesary in LoG1, to put a floorgrating under him - and I think it is not in LoG2.

But I have to confess, that I never tried to use a Tentacle in an exported mod.

Re: [ASSETS] LOG 1 MONSTERS - Enhanced Edition

Posted: Fri Nov 28, 2014 6:32 pm
by OGDA
Hmm, I've tried with every possible combination of asset-there, -not-there, grating, -no-grating.

It only works if the tentacle is on the same level the user spawns.
With saving/loading and starting on a different level etc. I guess its just not working currently.