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!
minmay
Posts: 2780
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay »

Grimrock does not actually have any concept of a "wall". There are just solid tiles, obstacles, and doors. You cannot get the behaviour of a solid tile with an object, but obstacles are generally close enough.
It sounds like in this case, you want door behaviour but don't care about opening it. In this case, use forest_ruins_wall_01 as a guide:

Code: Select all

defineObject{
	name = "forest_ruins_wall_01",
	components = {
		{
			class = "Model",
			model = "assets/models/env/forest_ruins_wall_01.fbx",
			staticShadow = true,
		},
		{
			class = "Door",
		},
		{
			class = "Occluder",
			model = "assets/models/env/forest_ruins_wall_01_occluder.fbx",
		},
	},
	placement = "wall",
	editorIcon = 160,
	automapIcon = 88,
	minimalSaveState = true,
}
Simply add a DoorComponent to the object, and make sure your model has a node named "gate" with an appropriately sized bounding box and an origin at 0,0,0. There is no need to add an explicit ProjectileColliderComponent unless you f*** up your bounding box, doors are already projectile colliders.

Alternatively, don't change the object and just put a solid wall tile behind it in the editor instead, since the two models you mentioned are already one-sided anyway so you can never let the player see them from behind...

Edit: If you add a DoorComponent without having a "gate" node, as THOM is telling you to do for some absolutely unfathomable reason, then almost nothing will work. The object will still stop the party from passing through, but you will need to add your own, EXPLICITLY SIZED, ProjectileColliderComponent, ItemConstraintBoxComponent, etc. You will also receive console warnings. It is much better to have a working gate node instead.
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.
User avatar
AndakRainor
Posts: 674
Joined: Thu Nov 20, 2014 5:18 pm

Re: Ask a simple question, get a simple answer

Post by AndakRainor »

I just noticed this :
SpoilerShow
Image
So it seems the dungeon builder is not very friendly with elevation. Is there a way to redefine it ? Or should I work with redefined tiles to avoid the dungeon wall drain placed just over an open path ? Also, when seen from the opposite side, the ceiling has an open wall so even a normal wall would not fit. Can I make it automatically more logical or should I place elements manually every where this happens ?
minmay
Posts: 2780
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay »

When using that tile you need to place the dungeon_wall_height_difference object on all ceiling elevation transitions.
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.
User avatar
THOM
Posts: 1274
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Ask a simple question, get a simple answer

Post by THOM »

@minmay: would have been nicer if you just had written
minmay wrote: If you add a DoorComponent without having a "gate" node, as THOM is telling you to do for some absolutely unfathomable reason, then almost nothing will work.
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
User avatar
Kuro01
Posts: 36
Joined: Tue Jun 23, 2015 2:05 pm

Re: Ask a simple question, get a simple answer

Post by Kuro01 »

Hello, I been having trouble getting this monster to work properly from the asset pack2.
Everything seems to work fine but it never hits me, always misses. Maybe someone can help me.
Couldn't find lizard sounds so I'm using turtle.

Code: Select all

defineObject{
	name = "ice_lizard",
	baseObject = "base_monster",
	components = {
		{
			class = "Model",
			model = "assets/models/monsters/ice_lizard.fbx",
			storeSourceData = true,
		},
		{
			class = "Animation",
			animations = {
				idle = "assets/animations/monsters/ice_lizard/ice_lizard_idle.fbx",
				moveForward = "assets/animations/monsters/ice_lizard/ice_lizard_walk.fbx",
				turnLeft = "assets/animations/monsters/ice_lizard/ice_lizard_turn_left.fbx",
				turnRight = "assets/animations/monsters/ice_lizard/ice_lizard_turn_right.fbx",
				attack = "assets/animations/monsters/ice_lizard/ice_lizard_attack.fbx",
				turnAttackLeft =  "assets/animations/monsters/ice_lizard/ice_lizard_attack_left.fbx",
				turnAttackRight =  "assets/animations/monsters/ice_lizard/ice_lizard_attack_right.fbx",
				getHitFrontLeft = "assets/animations/monsters/ice_lizard/ice_lizard_get_hit_front_left.fbx",
				getHitFrontRight = "assets/animations/monsters/ice_lizard/ice_lizard_get_hit_front_right.fbx",
				getHitBack = "assets/animations/monsters/ice_lizard/ice_lizard_get_hit_back.fbx",
				getHitLeft = "assets/animations/monsters/ice_lizard/ice_lizard_get_hit_left.fbx",
				getHitRight = "assets/animations/monsters/ice_lizard/ice_lizard_get_hit_right.fbx",
				fall = "assets/animations/monsters/ice_lizard/ice_lizard_get_hit_front_left.fbx",
			},
			currentLevelOnly = true,
		},
		{
			class = "Monster",
			meshName = "ice_lizard_mesh",
			footstepSound = "turtle_footstep",
			hitSound = "turtle_hit",
			dieSound = "turtle_die",
			hitEffect = "hit_blood",
			capsuleHeight = 0.4,
			capsuleRadius = 0.5,
			collisionRadius = 5.1,
			health = 650,			
			protection = 5,
			evasion = 10,
			immunities = { "cold" },
			exp = 675,
			lootDrop = { 70, "ice_lizard_steak" },
		},
		{
			class = "IceLizardBrain",
			name = "brain",
			sight = 4,
		},
		{
			class = "MonsterMove",
			name = "move",
			sound = "turtle_walk",
			cooldown = 1,
		},
		{
			class = "MonsterTurn",
			name = "turn",
			sound = "turtle_footstep",
		},
		{
			class = "MonsterAttack",
			name = "basicAttack",
			attackPower = 40,
			accuracy = 20,
			cooldown = 4,
			sound = "turtle_attack",
		},
	},
}
User avatar
THOM
Posts: 1274
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Ask a simple question, get a simple answer

Post by THOM »

Have you added the animation definitions?

Code: Select all

    defineAnimationEvent{
       animation = "assets/animations/monsters/ice_lizard/ice_lizard_attack.fbx",
       event = "attack",
       frame = 10,
    }

    defineAnimationEvent{
       animation = "assets/animations/monsters/ice_lizard/ice_lizard_attack_left.fbx",
       event = "attack",
       frame = 10,
    }

    defineAnimationEvent{
       animation = "assets/animations/monsters/ice_lizard/ice_lizard_attack_right.fbx",
       event = "attack",
       frame = 10,
    }

    defineAnimationEvent{
       animation = "assets/animations/monsters/ice_lizard/ice_lizard_walk.fbx",
       event = "footstep",
       frame = 10,
    }

    defineAnimationEvent{
       animation = "assets/animations/monsters/ice_lizard/ice_lizard_walk.fbx",
       event = "footstep",
       frame = 21,
    }

    defineAnimationEvent{
       animation = "assets/animations/monsters/ice_lizard/ice_lizard_turn_left.fbx",
       event = "footstep",
       frame = 10,
    }

    defineAnimationEvent{
       animation = "assets/animations/monsters/ice_lizard/ice_lizard_turn_right.fbx",
       event = "footstep",
       frame = 10,
    }
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
User avatar
Kuro01
Posts: 36
Joined: Tue Jun 23, 2015 2:05 pm

Re: Ask a simple question, get a simple answer

Post by Kuro01 »

Nope, Thanks
User avatar
Kuro01
Posts: 36
Joined: Tue Jun 23, 2015 2:05 pm

Re: Ask a simple question, get a simple answer

Post by Kuro01 »

I have another question. I use to use this glass door mod from Grimrock 1, Are models and texture from Grimrock 1 compatible with 2?. Can't get to work. Here the web page from nexus.
I know codes have to be tweaked.


http://www.nexusmods.com/grimrock/mods/ ... D194&pUp=1
Last edited by Kuro01 on Sat Aug 15, 2015 8:14 pm, edited 1 time in total.
minmay
Posts: 2780
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay »

models: yes
textures: diffuse and specular maps, yes, but not normal maps; they have a different format that you need to convert to.
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.
User avatar
aaneton
Posts: 189
Joined: Fri Sep 21, 2012 1:53 pm

Re: Ask a simple question, get a simple answer

Post by aaneton »

How do I check if a alcove has an item with a specific trait, e.g. I want to check if an alcove surface has a two-handed sword placed on surface. The traits would be "two_handed" and "sword".
My Grimrock mod (LoG1): The Onkalo Project
My Android (and windows desktop) game: Balloon Gentleman
Post Reply