Since we are waiting for asset pack to be released...

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
Blichew
Posts: 157
Joined: Thu Sep 27, 2012 12:39 am

Since we are waiting for asset pack to be released...

Post by Blichew »

Thanks to Doridion we have a bunch of object definitions. Look for his post below. Here's just the code for easier management and less clicking :)

Monsters - based on Snails brought back from LoG1 (by Prozail)
SpoilerShow
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,
	}

Monsters - based on Ice Lizards - from LoG1 too (by sps999)
SpoilerShow
This goes in monsters.lua: This script is the one that needs the table of animations, near the bottom

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

defineObject{
   name = "ice_lizard",
   baseObject = "base_monster",
   components = {
      {
         class = "Model",
         model = "assets/models/monsters/ice_lizard.fbx",
         storeSourceData = true,
      },
      {
         class = "Animation",
         name = "animation",
         currentLevelOnly = true,
         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",
         },
      },
      {
         class = "Monster",
         meshName = "ice_lizard_mesh",
         level=1,
         health = 650,
         evasion = 10,
         exp = 675,
         lootDrop = { 70, "ice_lizard_steak" },
         traits = { "animal" },
		 immunities = { "blinded", "frozen" },
		 resistances = { cold="immune", fire="weak"},
         hitEffect = "hit_blood",
         capsuleHeight = 0.4,
         capsuleRadius = 0.5,
		 footstepSound = "ice_lizard_footstep",
		 hitSound = "ice_lizard_hit",
		 dieSound = "ice_lizard_die",
		 --onPerformAction = function(self,a,b,c)
            --print(self.go.id,a,b,c)
         --end
      },
      {
         class = "IceLizardBrain",
         name = "brain",
      },
      {
         class = "MonsterMove",
         name = "move",
         sound = "ice_lizard_walk",
         resetBasicAttack = false,
         turnDir = 0,
         cooldown = 1,
      },
      {
         class = "MonsterTurn",
         name = "turn",
         sound = "ice_lizard_walk",
         cooldown = 1,
      },
      {
         class = "MonsterAttack",
         name = "basicAttack",
         sound = "ice_lizard_attack",
         cooldown = 1,
         attackPower = 40,
         animationSpeed = 1,
         animation = "attack",
      },
      {
         class = "MonsterAttack",
         name = "turnAttack",
         sound = "ice_lizard_attack",
         cooldown = 1,
         attackPower = 40,
         animationSpeed = 1,
         animations = {"attack_right", "attack_left"},
		 turnToAttackDirection = true,
      },
   }
}
This goes in materials.lua:

Code: Select all

defineMaterial{
	name = "ice_lizard",
	diffuseMap = "assets/textures/monsters/ice_lizard_dif.tga",
	specularMap = "assets/textures/monsters/ice_lizard_spec.tga",
	normalMap = "assets/textures/monsters/ice_lizard_normal.tga",
	doubleSided = false,
	lighting = true,
	alphaTest = false,
	blendMode = "Opaque",
	textureAddressMode = "Wrap",
	glossiness = 65,
	depthBias = 0,
	}
This goes in sound.lua:

Code: Select all

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

	defineSound{
		name = "ice_lizard_walk",
		filename = "assets/samples/monsters/ice_lizard_walk_01.wav",
		loop = false,
		volume = 0.5,
		minDistance = 1,
		maxDistance = 4,
	}

	defineSound{
		name = "ice_lizard_footstep",
		filename = "assets/samples/monsters/ice_lizard_footstep_01.wav",
		loop = false,
		volume = 0.4,
		minDistance = 1,
		maxDistance = 6,
	}

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

	defineSound{
		name = "ice_lizard_die",
		filename = "assets/samples/monsters/ice_lizard_die_01.wav",
		loop = false,
		volume = 1,
		minDistance = 1,
		maxDistance = 10,
	}
Tiles - Old Dungeon Style (by Doridion who has them here - with download link inside)
SpoilerShow
tiles.lua

Code: Select all

defineTile{
  name = "user_floor",
  editorIcon = 192,
  color = {110,130,110,255},
  solid = false,
  builder = "dungeon",
	ceiling = {
		"user_ceiling_flat_00", 50,
		"user_ceiling_flat_01", 50,
	},
	wall = {
		"user_wall_stone", 50,
		"user_wall_scratch", 10,
		"user_wall_crack", 5,
		"user_wall_lichen", 10,
		"user_wall_moss_a", 15,
		"user_wall_moss_b", 15,
	},
	floor = {
		"user_floor", 100,
	},
	ceilingEdgeVariations = false,
	automapTile = “rocky_wall”,
}
objects.lua

Code: Select all

defineObject{
	name = "user_wall_stone",
	components = {
    {
      class = "Model",
      model = "mod_assets/models/env/user_wall_stone.fbx",
    },
  },
  placement = "wall",
  automapTile = "wall",
}

defineObject{
	name = "user_wall_crack",
	components = {
    {
      class = "Model",
      model = "mod_assets/models/env/user_wall_crack.fbx",
    },
  },
  placement = "wall",
}

defineObject{
	name = "user_wall_scratch",
	components = {
    {
      class = "Model",
      model = "mod_assets/models/env/user_wall_scratch.fbx",
    },
  },
  placement = "wall",
}

etc...
with the rest being viewable in the pack ready to download

Door - (by Doridion) - made clickable :)
SpoilerShow

Code: Select all

defineObject{
	name = "my_clickable_door",
        baseObject = "[name of the door you want to use]",
	components = {
		{
			class = "Door",
         sparse = true,
			killPillars = true,
		},
		{
			class = "Clickable",
			maxDistance = 1,
         -- offset vector is the point where begin the clickable box
			offset = vec(0,1.3,0),
         -- size is the size of our clickable box
			size = vec(2.5,2.5,0.3),
			onClick = function(self)
				self.go.door:toggle()
			end
		},
		{
			class = "Controller",
			onOpen = function(self, name)
				self.go.door:open()
			end,
			onClose = function(self)
				self.go.door:close()
			end,
			onToggle = function(self)
				self.go.door:toggle()
			end,
		},
	},
	placement = "wall",
	editorIcon = 124,
}
for doors with custom models look further into linked topic

Items - by Akroma222 who has them gathered there Whole topic is a combination of item/item packs with links to download:
Sounds
Icons
Misc items

Sample code with water bottle (by Doridion - download here because of custom models):
SpoilerShow
items.lua

Code: Select all

    defineObject{
      name = "user_food_water_full",
      baseObject = "base_item",
      components = {
        {
          class = "Model",
          model = "mod_assets/models/items/user_food_water_full.fbx",
        },
        {
          class = "Item",
          uiName = "Water",
          gfxAtlas = "mod_assets/textures/gui/water_bottle_icon.tga",
          gfxIndex = 1,
          weight = 0.7,
          multiple = 1,
          traits = { "food" },
          description = "A water bottle",
        },
        {
          class = "UsableItem",
          nutritionValue = 200,
          emptyItem = "user_food_water_empty",
          onUseItem = function(self,champion)
            champion:regainEnergy(20)
            champion:regainHealth(100)
          end
        },
      }
    }
materials.lua

Code: Select all

    defineMaterial{
       name = "user_food_water_full",
       diffuseMap = "mod_assets/textures/items/user_food_water_full_dif.tga",
        specularMap = "mod_assets/textures/items/user_food_water_full_spec.tga",
       normalMap = "mod_assets/textures/items/user_food_water_full_normal.tga",
       doubleSided = false,
       lighting = true,
       alphaTest = false,
       blendMode = "Opaque",
       textureAddressMode = "Wrap",
       glossiness = 10,
       depthBias = 0,
    }
Weapons - based on akroma222's knife
SpoilerShow

Code: Select all

        defineObject{
              name = "knife",
              baseObject = "base_item",
              components = {
              {
                 class = "Model",
                 model = "assets/models/items/knife.fbx",
              },
              {
                 class ="Item",
                 uiName = "Knife",
                 --gfxAtlas = "you can set your own",
                 gfxIndex = 47,
                 weight = 0.7,
                 impactSound = "impact_blade",
                 traits = { "daggers", "light_weapon" },
                 description = "A blunt, rusty knife probably used for scaling fish."
              },
              {
                 class = "MeleeAttack",
                 attackPower = 5,
                 accuracy = 0,
                 swipe = "horizontal",
                 attackSound = "swipe",
                 cooldown = 3.0,
                 baseDamageStat = "dexterity",
                 damageType = "physical",
                 requirements = {"light_weapons" ,2},
                 gameEffect = "A test text you can set.",
              },
           }
        }
I'll update this post with rest of the code as soon as I'll have some more time :) - for now look 3 posts below for links to designated topics.


:EDIT: original post below for reference
As pointed out preparing us an asset pack takes more time that any of us would want :) (still - completely understandable) maybe we could just ask for a sample of it, like you know-an alcove, a monster (group) and anything else you could throw at us:)

And i mean just definitions, not actual models, etc.

I know we have like property list, method list, etc. but having a complete and working definition would be easier to read and therefor easier to adapt to own needs :)
Last edited by Blichew on Mon Nov 10, 2014 2:14 pm, edited 9 times in total.
User avatar
Eleven Warrior
Posts: 752
Joined: Thu Apr 18, 2013 2:32 pm
Location: Australia

Re: Since we are waiting for asset pack to be released...

Post by Eleven Warrior »

Man I +1 to this it would make simpler lol.
Grimfan
Posts: 369
Joined: Wed Jan 02, 2013 7:48 am

Re: Since we are waiting for asset pack to be released...

Post by Grimfan »

Just a single example of each type of monster, object, item, etc would be quite useful for both beginning and advanced modders.
User avatar
Doridion
Posts: 256
Joined: Tue Jun 10, 2014 9:23 pm

Re: Since we are waiting for asset pack to be released...

Post by Doridion »

For definition, all our modders actually got in the forum :

- Monsters and there
- Tiles ( walls, ceilings, floors )
- Doors
- Items and there
- Food
- Weapons
- Scrolls
- Tomes
- Blocker as barrels or thickets
- Sounds
- Classes, Traits and Races
- Alcoves ( definition below )
SpoilerShow

Code: Select all

defineObject{
	name = "user_alcove",
   baseObject = "dungeon_alcove"
	components = {
    {
      class = "Surface",
      -- Modify by adding debugDraw = true
	  offset = vec(0,0.91,0.3),
	  size = vec(1.4,0.6,0,0),
    },
	{
      class = "Clickable",
      -- Modify by adding debugDraw = true
	  offset = vec(0,1.2,0.3),
	  size = vec(1.3,0.6,0.6),
    },
},
  placement = "wall",
  replacesWall = true,
  editorIcon = 8,
}
- Altars ( definition below )
SpoilerShow

Code: Select all

defineObject{
	name = "user_altar",
   baseObject = "altar",
	components = {
	  maxDistance = 1,
		{
			class = "Surface",
      -- Modify by adding debugDraw = true
			offset = vec(0.3,0.48,0),
			size = vec(2,1.2,0,0),
		},
		{
			class = "Clickable",
      -- Modify by adding debugDraw = true
			maxDistance = 1,
			offset = vec(0.3,0.8,0),
			size = vec(2,0.8,1.2),
		},
		{
			class = "Obstacle",
		},
		{
			class = "ProjectileCollider",
		},
	},
	placement = "floor",
	editorIcon = 52,
}
I given all links to all definitions in the forum, for missing definition, i can propose to give them here when we discover them ;)

Ahem ... all of these ( except for alcoves and altars ) can be found via the search or the superthread :D
Last edited by Doridion on Sun Nov 09, 2014 10:58 am, edited 4 times in total.
NutJob
Posts: 426
Joined: Sun Oct 19, 2014 6:35 pm

Re: Since we are waiting for asset pack to be released...

Post by NutJob »

Thanks Doridion for consolidating known information about this. The search function is not very useful to me if I don't know what I'm looking for in the first place.
User avatar
The cube
Posts: 94
Joined: Tue Apr 23, 2013 6:09 pm
Location: Barren Desert

Re: Since we are waiting for asset pack to be released...

Post by The cube »

woah, so nobody has defined tomes yet?

Oh, and thank you very much doridion.
User avatar
Doridion
Posts: 256
Joined: Tue Jun 10, 2014 9:23 pm

Re: Since we are waiting for asset pack to be released...

Post by Doridion »

No thanks NutJob ^^ I taken the hard work of gathering informations and useful scripts/definitions/etc in the superthread, it's normal that i'm informed of a big part of modders progression ;)

Bliiiitcheeeeeewwwww !!!! You got some work ! Can you copy/reshape the definitions and post them in the first post of the thread ? Think it could be a good way to have ( the time we had the LoG2 asset pack available ) all the definitions in one depositary ;) And as you created this thread ..... :mrgreen:

@The cube : we got, added to the list ;)
NutJob
Posts: 426
Joined: Sun Oct 19, 2014 6:35 pm

Re: Since we are waiting for asset pack to be released...

Post by NutJob »

Doridion wrote:Bliiiitcheeeeeewwwww !!!!
Bless you!
User avatar
Doridion
Posts: 256
Joined: Tue Jun 10, 2014 9:23 pm

Re: Since we are waiting for asset pack to be released...

Post by Doridion »

NutJob wrote:
Doridion wrote:Bliiiitcheeeeeewwwww !!!!
Bless you!
Thanks *fetches a tissue* Snirfl :geek:
User avatar
Blichew
Posts: 157
Joined: Thu Sep 27, 2012 12:39 am

Re: Since we are waiting for asset pack to be released...

Post by Blichew »

Sure thing, will try to do that in a few hours when I get home. And thanks for getting them definitions together.

As a side note and somewhat definition-related: has anyone come up with adding custom components with different hooks? Like the case with clickable door.
Post Reply