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!
User avatar
akroma222
Posts: 1029
Joined: Thu Oct 04, 2012 10:08 am

Re: Ask a simple question, get a simple answer

Post by akroma222 »

Ok, yup Ive located the definition in minmays pack (sorry - forgot where exactly it was)
There are a still a few diff things it could be - my best guess atm is that you havent changed or updated Texture or Model locations / Material definitions etc
Those things will crash the game as soon as you click to place the monster in your dungeon (again, best guess)

I would strongly suggest double checking file locations and spelling typos just to be sure firstly
Also - have you added this line to your init.lua :

Code: Select all

import "assets/scripts/monsters/tentacles.lua"
(OR imported g1.lua at all? - you mention you just cut pasted the above def into your monster.lua ..?)
You definitely need to make sure that you have the base games 'tentacles' definition already imported before minmays version in your monsters.lua

Code: Select all

defineObject{
   name = "tentacles",
   baseObject = "tentacles",
Obviously its nothing wrong w minmays definition - just double check those few things and see if you can find the issue there
If not then it may be easier to upload the files and I can run through and check it out myself
User avatar
Mysterious
Posts: 226
Joined: Wed Nov 06, 2013 8:31 am

Re: Ask a simple question, get a simple answer

Post by Mysterious »

Hi Akroam.

I pasted this into my init.lua file: import "assets/scripts/monsters/tentacles.lua"
and it still does not work. If I try to put the monster on the floor it crashes with:

string {"Animation.lua"];10 file not found
assets/animations/monsters/drainage_tentcles/drainage_tentcles_attack_from_back_animation
stack traceback:

I have no idea whats going on lol.

EDIT I have the latest version of Grimrock, it just cant find the animation files.
EDIT 2:
Ok I got it to works wow man. I had to copy this into my monster.lua

Code: Select all

--- Original Monster
defineObject{
	name = "tentacles",
	baseObject = "base_monster",
	components = {
		{
			class = "Model",
			model = "assets/models/monsters/drainage_tentacles.fbx",
			storeSourceData = true,
		},
		{
			class = "Animation",
			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_from_back.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",
			},
			currentLevelOnly = true,
		},
		{
			class = "Monster",
			meshName = "drainage_tentacles_mesh",
			hitSound = "tentacles_hit",
			dieSound = "tentacles_die",
			hitEffect = "hit_goo",
			capsuleHeight = 1,
			capsuleRadius = 0.1,
			health = 420,
			immunities = { "assassination", "backstab", "sleep", "blinded", "knockback" },
			resistances = {
				["cold"] = "resist",
				["shock"] = "weak",
			},
			exp = 320,
			headRotation = vec(90, 0, 0),
		},
		{
			class = "TentacleBrain",
			name = "brain",
			sight = 2.5,
			allAroundSight = true,
		},
		{
			class = "MonsterTurn",
			name = "turn",
			sound = "tentacles_walk",
		},
		{
			class = "TentacleHide",
			name = "hide",
		},
		{
			class = "MonsterAttack",
			name = "basicAttack",
			attackPower = 25,
			accuracy = 15,
			cooldown = 4,
			sound = "tentacles_attack",
			causeCondition = "paralyzed",
			conditionChance = 20,
		},
	},
}

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,
}

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,
}
If I use the (above) monster in my mod it crashes. If I use the below monster, which I just named ie (tentcles_min) It works perfectly.

Code: Select all

defineObject{
	name = "tentacles_min",
	baseObject = "tentacles",
	components = {
		{
			class = "Animation",
			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",
			},
			currentLevelOnly = true,
		},
		{
			class = "TentacleBrain",
			name = "brain",
			sight = 2.5,
			allAroundSight = true,
			onThink = function(self)
				-- fix bug with builtin brain
				if not self.partyOnLevel then
					return self:performAction("hide") or self:wait()
				else
					return false
				end
			end,
		},
		{ -- fix another bug with builtin brain
			class = "MonsterAction",
			name = "move",
			onBeginAction = function(self) return false end,
		},
		{ -- fix another bug with builtin brain
			class = "MonsterAction",
			name = "turn",
			onBeginAction = function(self) return false end,
		},
	}
}
User avatar
Mysterious
Posts: 226
Joined: Wed Nov 06, 2013 8:31 am

Re: Ask a simple question, get a simple answer

Post by Mysterious »

Hi all.

Ok I use this on Potions: champion:playHealingIndicator()

I have noticed there are more of the indicators but I cannot find the names. Can anyone tell me what the rest of the indicator names are or is there just one?

Thxs :)
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: Ask a simple question, get a simple answer

Post by bongobeat »

minmay wrote:
bongobeat wrote:
minmay wrote:You should never have multiple WaterSurfaceComponents on the same level. Remove all the WaterSurfaceComponents except one. You can still use multiple models for the ocean, but there should only be one WaterSurfaceComponent on the level.
I was afraid you say that! :shock:

Is there no way to keep the different watersurfaces? E.g: By keeping the ocean and destroying the water_surface and recreating it when needed.


It's gonna be difficult to completely remove the water_surface here. This level is some kind of harbor, and there are things to do underwater. I can't possibly remove those things without changing access to 2 levels.
Why do you think you need multiple WaterSurfaceComponents on the level? What advantage do you think you are getting by using more than one?
Well I didn't know that you can have (and should) only one. But what is the matter when using 5 water_surface_component on the same map? Except for the issue of reflection.

By the way, first I used a water_surface (who has the waterSurfaceComponent) and 4 custom beach_ocean without waterSurfaceComponent. There was still the reflection issue, when you enter an ocean tile.

So, I finally use the custom ocean without the WaterSurfaceComponent 3 times on the map, an ocean with waterSurfaceComponent and fog parameters (used one time on the map), and one water_surface without the waterSurfaceComponent. The reflection is ok everywhere.
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
User avatar
Zo Kath Ra
Posts: 937
Joined: Sat Apr 21, 2012 9:57 am
Location: Germany

Re: Ask a simple question, get a simple answer

Post by Zo Kath Ra »

Mysterious wrote:Hi all.

Ok I use this on Potions: champion:playHealingIndicator()

I have noticed there are more of the indicators but I cannot find the names. Can anyone tell me what the rest of the indicator names are or is there just one?

Thxs :)
What other indicators are there?
minmay
Posts: 2780
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay »

bongobeat wrote:Well I didn't know that you can have (and should) only one. But what is the matter when using 5 water_surface_component on the same map? Except for the issue of reflection.
The game only has one reflection buffer. The only things you accomplish by having multiple WaterSurfaceComponents on the same level are:
1. You make it difficult to know which WaterSurfaceComponent will be used to calculate the reflection buffer. This is bad.
2. You make performance slightly worse. This is also bad.

Note that WaterSurfaceComponent isn't really affected by disabling it. You should remove the components entirely, not just disable 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.
Badgert
Posts: 258
Joined: Sun Jan 29, 2017 6:14 pm

Re: Ask a simple question, get a simple answer

Post by Badgert »

There is such an object

Code: Select all

defineObject{
	name = "mine_door_spear",
	baseObject = "base_door",
	components = {
		{
			class = "Model",
			model = "assets/models/env/mine_door_spear.fbx",
		},
		{
			class = "Door",
			openVelocity = 4,
			closeVelocity = -6,
			openingDirection = "down",
			maxHeight = 2,
			sparse = true,
			killPillars = false,
			openSound = "spear_door",
			closeSound = "spear_door",
			--lockSound = "wall_sliding_lock",
		},
	},
}
Can I make it NOT displayed on the auto-map?
User avatar
Isaac
Posts: 3185
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac »

Badgert wrote:There is such an object
...
Can I make it NOT displayed on the auto-map?
What effect—exactly , and specifically, are you trying to achieve? (Or what is it that you are intending to do with it?)
Badgert
Posts: 258
Joined: Sun Jan 29, 2017 6:14 pm

Re: Ask a simple question, get a simple answer

Post by Badgert »

I want to make an invisible labyrinth of these elements. But as soon as I open the map - there are no secrets left ...
User avatar
Isaac
Posts: 3185
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac »

Badgert wrote:I want to make an invisible labyrinth of these elements. But as soon as I open the map - there are no secrets left ...
Can they ever be seen? Are these walls intended to become visible on the map when discovered?

The easiest way to make them permanently invisible on the automap, is to set the object's automap tile to the number for a blank one; like setting it to 24.

Code: Select all

defineObject{
   name = "mine_door_spear_hidden",
   baseObject = "base_door",
   automapIcon = 24, --blank
   components = {
      {
         class = "Model",
         model = "assets/models/env/mine_door_spear.fbx",
      },
      {
         class = "Door",
         openVelocity = 4,
         closeVelocity = -6,
         openingDirection = "down",
         maxHeight = 2,
         sparse = true,
         killPillars = false,
         openSound = "spear_door",
         closeSound = "spear_door",
         --lockSound = "wall_sliding_lock",
      },
   },
}
Post Reply