[WIP] Combined custom content thread

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

[WIP] Combined custom content thread

Post by akroma222 »

Hey Everyone,

I have begun porting across content from my last mod, The Labyrinth of Lies. It also seems many others are converting work too....
I am happy for people to post things here or send me work - and I will update and include this work in the original post here.
Hopefully this thread will reflect a large portion of the (converted) custom content created by the community for LoG1 and also new work for LoG2
Credits will of course be listed alongside links (let us make sure we have all the permissions necessary)

This is a work in progress but will eventually contain content including icons, models, textures, particle effects and scripts for use of the following:

Weapons, Armour, Misc items
Races / Classes (not from LoG1)
Spells
Monsters
Environment objects

I will separate individual pieces of work so people can pick and choose what they would like but also upon completing the thread...
I will create a workshop type dungeon with all the content present so people can just grab the lot as a custom content pack.

It is entirely likely that I will also post questions here if I need help with scripting issues while converting content over.

If you see some work here and I have not made the correct credit listing, or you would like my crediting to be more specific - please please let me know and I will make the changes!!

SCRIPTS

PARTY TIMER
Add this definition to init.lua
Party timer will start immediately, incrementing a counter and give you are time count hudPrint msg
SpoilerShow

Code: Select all

-----------------------------------------------party timer

defineObject{
       name = "party",
       baseObject = "party",
       components = {
		{
		class = "Counter",
		name = "partycounter",
		},	
          	{
             	class = "Timer",
		name = "partytimer",
		timerInterval = 1.0,
		triggerOnStart = true,
		onActivate = function(self)
			self.go.partycounter:increment()
			local v = self.go.partycounter:getValue()
			return hudPrint("Time = "..v.."")
		end
          	},
	}
    }
WATER BREATHING CHECK
Use this if you wish to check if your party is underwater (party timer version)
This firstly checks to see if your party has a "zarchton" champion, if so it creates a connector from party timer to initScript(water breathing check)
Change the class check to something if you do not have a zarchton race defined

Put this script in a script entity called (initScript) in your dungeon
SpoilerShow

Code: Select all

function initialize()

	for i = 1,4 do
		local c = party.party:getChampion(i)
		local cRace = c:getRace()
		if cRace == "zarchton" then
			party.partytimer:addConnector("onActivate", "initScript", "waterBreathingCheck")
		end
	end
end
			
----------------------------------------------------------------------------------------------waterBreathingCheck()		
	function waterBreathingCheck()
		
		for i = 1,4 do
			local c = party.party:getChampion(i)
			local cRace = c:getRace()
			if cRace == "zarchton" then
				local tile = party.map:getAutomapTile(party.x,party.y)
				--print(tile)
		
				if tile == 2 then
					if c:hasCondition("water_breathing") == false then
						hudPrint(""..c:getName().." can breath underwater.")
						c:setCondition("water_breathing")
					end
				else
					if c:hasCondition("water_breathing") == true then
						hudPrint(""..c:getName().." is not underwater.")
						c:removeCondition("water_breathing")
					end
				end
			end
		end
	end
Use this Party timer definition / update the one above - put in init.lua
SpoilerShow

Code: Select all

-----------------------------------------------party timer

defineObject{
       name = "party",
       baseObject = "party",
       components = {
		{
		class = "Counter",
		name = "partycounter",
		},	
          	{
             	class = "Timer",
		name = "partytimer",
		timerInterval = 1.0,
		triggerOnStart = true,
		onActivate = function(self)
			self.go.partycounter:increment()
			local v = self.go.partycounter:getValue()
			if initCounter.counter:getValue() == 1 then
				initScript.script.initialize()
				initCounter.counter:decrement()
			end
			return hudPrint("Time = "..v.."")
		end
          	},
	}
    }
ALTER SKILL LEVELS
This script will increase/decrease skill levels, will track this past level 5 and will remove traits when decreasing skills
viewtopic.php?f=22&t=9024

LOCKS AND TRAPS SKILL - CHESTS - keylocked, pickable and trapped
This system introduces a new skill (Locks and Traps)
This skill and specific champion Class' are used to determine outcomes for picklocking chests and disarming trapped chests
viewtopic.php?f=22&t=9046

SOUNDS
Here is a collection of 134 sounds I used in Labyrinth of Lies - but there are many sounds from other peoples work/mods here too
The definitions are found in the same link under sounds.lua (make a folder in your sounds folder called 'akroma')
http://ge.tt/8spBb442?c


ICON ATLAS
To start with, I will share the icon atlases (x13) from The Labyrinth of Lies.
I have also included the gfx index sheet... add this as a layer so you can position your own icons correctly.
Credits to (Almost Human, Minmay, DeDy, Pandafox, Germanny, Mutman, Merethif, Grimwold, Fhizban, .rav3nway, nangeyi and RynoZebz)

Example images (LoG1 - in game)
SpoilerShow
Image
SpoilerShow
Image
SpoilerShow
Image
For all icon files
http://ge.tt/6VdK2L32?c

Miscellaneous Items
PROZAIL's Coins (Gold, silver, copper)
SpoilerShow
Image
DORIDION's Food/Egg/Bottle pack
SpoilerShow
Image
For all misc LoG2 item files
http://ge.tt/1OjGBM32?c


WEAPONS
LIFE LEECH
Taken straight from assassin dagger MeleeAttack component
SpoilerShow

Code: Select all

onHitMonster = function(self, monster, side, dmg, champion)
			if monster:hasTrait("undead") then
				-- draining undeads is not wise
				monster:showDamageText("Backlash", "FF0000")
				champion:damage(dmg*0.7, "physical")
				return false
			elseif monster:hasTrait("elemental") or monster:hasTrait("construct") then
				-- elementals are constructs are immune to leech
				monster:showDamageText("Immune")
				return false
			else
				champion:regainHealth(dmg*0.7)
			end
		end,
DEAL 2x DMG AGAINST MONSTER TYPE **doesn't work as intended for now - fixing soon!!!
If you have a weapon that will deal extra (2x) damage against (plant) monsters...
Give the monster the plant trait (traits = { "plant"} )
onAttack, This code will check the monster in front of the party for the trait then set the new attack power
if there is no monster or if the monster isnt a plant it will return the attack value to the original value
SpoilerShow

Code: Select all

{
          	class = "MeleeAttack",
          	attackPower = 20,
          	accuracy = 0,
          	swipe = "horizontal",
          	attackSound = "swipe_heavy",
          	cooldown = 4.6,
          	baseDamageStat = "strength",
         	damageType = "physical",
		requirements = {"heavy_weapons", 2},
		onAttack = function(self, champion)
			champion:playDamageSound()
			local dx,dy = getForward(party.facing)
			for i in party.map:entitiesAt(party.x + dx,party.y + dy) do
				if i and i.monster then
					if i.monster:hasTrait("plant") then
						self:setAttackPower(40)
						print(""..self:getAttackPower().."")
						return true
					end
				end
			end
			self:setAttackPower(20)
			print(""..self:getAttackPower().."")
		end,
       	},
"NAME" WEAPONS
To make a weapon only be equipped if the champ has a specific name "Drakkan"
You must call this function using the onEquip/onUnequip hook from the item component
SpoilerShow

Code: Select all

function yourWeaponEquip(self, champion, slot)
	local name = champion:getName()
	if slot == 1 or slot == 2 then 
		if name == "Drakkan" then
			hudPrint(""..name.." has equipped a "..name.." only weapon.")
		else
            champion:removeItemFromSlot(slot)
            spawn("..your weapon.."",party.level,party.x,party.y,party.facing, party.elevation)
            playSound("item_drop")
            hudPrint("Only a champ named Drakkan can use this weapon...")
        end
	end
end

function  yourWeaponUnequip(self, champion, slot)
	local name = champion:getName()
	if slot == 1 or slot == 2 then 
		if name == "Drakkan then
			--- do things here if you need to
                end
	end
end
2 SPECIFIC WEAPONS EQUIPPED TOGETHER
To check if you have two specific weapons equipped together
Use the onEquip/onUnequip hook in the item component of your item/s to call the functions
SpoilerShow

Code: Select all

		function comboSwordCheckEquip(self, champion, slot)
			local sword1 = champion:getItem(1)
			local sword2 = champion:getItem(2)
			if sword1 and sword2 then
				if sword1.go.name == "long_sword" and sword2.go.name == "rapier"
				or sword2.go.name == "long_sword" and sword1.go.name == "rapier" then
					hudPrint("this works")
				end
			end
		end
		
		
		function comboSwordCheckUnequip(self, champion, slot)
			local sword1 = champion:getItem(1)
			local sword2 = champion:getItem(2)
			if sword1 and sword2 then
				if sword1.go.name == "long_sword" and sword2.go.name == "rapier"
				or sword2.go.name == "long_sword" and sword1.go.name == "rapier" then
					hudPrint("this works")
				end
			end
		end
		
TO ADD/REMOVE A TRAIT PROPERLY WHEN EQUIPPING
A link to minmay's traitManager script
viewtopic.php?f=22&t=9024&p=88389#p88389

'RACE' ENHANCED POWER ATTACKS
If you want a certain race (or class) to make better power attacks with a certain weapon
EG - Zarchton race gets an extra attack with a thrust power attack
SpoilerShow

Code: Select all

{
             		class = "MeleeAttack",
             		name = "thrust1",
			uiName = "Thrust",
			buildup = 1.0,
			chainAction = "thrust2",
			chainActionDelay = 0.2,
			attackPower = 20,
			swipe = "thrust",
			attackSound = "swipe",
			baseDamageStat = "strength",
			pierce = 10,
			accuracy = 10,
             		cooldown = 2.5,
             		energyCost = 15,
			gameEffect = "An accurate and piercing lunge dealing double damage. Zarchtons attack twice.",
             		requirements = { "accuracy", 1},
             		onAttack = function(self,champion,hand)
				champion:playDamageSound()
             		end,
        	},
		{
             		class = "MeleeAttack",
             		name = "thrust2",
			attackPower = 25,
			swipe = "horizontal",
			attackSound = "swipe_special",
			baseDamageStat = "strength",
			pierce = 20,
			accuracy = 20,
             		onAttack = function(self,champion,hand)
				if champion:getRace() ~= "zarchton" then
					return false
				else
					champion:playDamageSound()
				end
             		end,
        	},

MONSTERS
LIZARDS
Ice, dark, green and fire lizards + steaks
Monsters.lua
SpoilerShow

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 = { "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,
          },
       }
    }

defineObject{
       name = "dark_lizard",
       baseObject = "base_monster",
       components = {
          {
             class = "Model",
             model = "mod_assets/models/dark_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, "dark_lizard_steak" },
             traits = { "animal" },
             immunities = { "blinded"},
             --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,
          },
       }
    }

defineObject{
       name = "fire_lizard",
       baseObject = "base_monster",
       components = {
          {
             class = "Model",
             model = "mod_assets/models/fire_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, "fire_lizard_steak" },
             traits = { "animal" },
             immunities = { "burning"},
             resistances = { fire = "immune", cold ="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,
          },
       }
    }

defineObject{
       name = "green_lizard",
       baseObject = "base_monster",
       components = {
          {
             class = "Model",
             model = "mod_assets/models/green_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, "green_lizard_steak" },
             traits = { "animal" },
             immunities = { "poisoned"},
             resistances = { poison ="absorb"},
             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,
          },
       }
    }
Materials.lua
SpoilerShow

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

defineMaterial{
	name = "green_lizard",
	diffuseMap = "mod_assets/textures/green_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,
}

defineMaterial{
	name = "dark_lizard",
	diffuseMap = "mod_assets/textures/dark_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,
}

defineMaterial{
	name = "fire_lizard",
	diffuseMap = "mod_assets/textures/fire_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,
}
    
--------------------------------------------------------------------FOOD

defineMaterial{
	name = "green_lizard_steak",
	diffuseMap = "mod_assets/textures/green_lizard_steak_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,
}

defineMaterial{
	name = "dark_lizard_steak",
	diffuseMap = "mod_assets/textures/dark_lizard_steak_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,
}

defineMaterial{
	name = "fire_lizard_steak",
	diffuseMap = "mod_assets/textures/fire_lizard_steak_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,
}
Items.lua
SpoilerShow

Code: Select all

-------------------------------------------------------------------FOOD

defineObject{
  	name = "green_lizard_steak",
  	baseObject = "base_item",
  	components = {
    	{
      	class = "Model",
      	model = "mod_assets/models/green_lizard_steak.fbx",
    	},
    	{
      	class = "Item",
      	uiName = "Green Lizard Steak",
      	gfxAtlas = "mod_assets/textures/akroma_icons.tga",
      	gfxIndex = 1,
      	weight = 2.0,
      	multiple = 1,
      	traits = { "food","consumable" },
      	description = "A delicious fillet of green lizard.",
    	},
    	{
      	class = "UsableItem",
      	nutritionValue = 350,
      	onUseItem = function(self,champion)
        	playSound("consume_food")
      	end
    	},
  }
}

defineObject{
  	name = "dark_lizard_steak",
  	baseObject = "base_item",
  	components = {
    	{
      	class = "Model",
      	model = "mod_assets/models/dark_lizard_steak.fbx",
    	},
    	{
      	class = "Item",
      	uiName = "Dark Lizard Steak",
      	gfxAtlas = "mod_assets/textures/akroma_icons.tga",
      	gfxIndex = 2,
      	weight = 2.0,
      	multiple = 1,
      	traits = { "food","consumable" },
      	description = "A delicious fillet of dark lizard.",
    	},
    	{
      	class = "UsableItem",
      	nutritionValue = 350,
      	onUseItem = function(self,champion)
        	playSound("consume_food")
      	end
    	},
  }
}

defineObject{
  	name = "fire_lizard_steak",
  	baseObject = "base_item",
  	components = {
    	{
      	class = "Model",
      	model = "mod_assets/models/fire_lizard_steak.fbx",
    	},
    	{
      	class = "Item",
      	uiName = "Fire Lizard Steak",
      	gfxAtlas = "mod_assets/textures/akroma_icons.tga",
      	gfxIndex = 0,
      	weight = 2.0,
      	multiple = 1,
      	traits = { "food", "consumable" },
      	description = "A delicious fillet of green lizard.",
    	},
    	{
      	class = "UsableItem",
      	nutritionValue = 350,
      	onUseItem = function(self,champion)
        	playSound("consume_food")
      	end
    	},
  }
}
You will need akroma_icons for the steak icons (found under ICONS above)
And models/textures for lizards + steaks - http://ge.tt/2YmIV442?c
Last edited by akroma222 on Wed Dec 31, 2014 11:32 am, edited 26 times in total.
User avatar
cromcrom
Posts: 549
Joined: Tue Sep 11, 2012 7:16 am
Location: Chateauroux in a socialist s#!$*&% formerly known as "France"

Re: [WIP] Akroma custom content thread

Post by cromcrom »

Wow, that is nice, thank you very much. I love the icons, thanks for the gift, you will be credited :-)
A trip of a thousand leagues starts with a step.
User avatar
akroma222
Posts: 1029
Joined: Thu Oct 04, 2012 10:08 am

Re: [WIP] Akroma custom content thread

Post by akroma222 »

Now worries Cromcrom!
Btw, you are credited in Labyrinth of Lies for: General scripting, AOE spells and living tree monster :D
User avatar
Drakkan
Posts: 1318
Joined: Mon Dec 31, 2012 12:25 am

Re: [WIP] Akroma custom content thread

Post by Drakkan »

akroma rules again ! looking forward to this as well as I hope for lots weapons fun stuff :)
Breath from the unpromising waters.
Eye of the Atlantis
User avatar
Doridion
Posts: 256
Joined: Tue Jun 10, 2014 9:23 pm

Re: [WIP] Akroma custom content thread

Post by Doridion »

Thanks, very thanks ^^ I'm converting some work of Germanny ( just actually searching hard for tiles definition ). Can I post my work on this ?
User avatar
akroma222
Posts: 1029
Joined: Thu Oct 04, 2012 10:08 am

Re: [WIP] Akroma custom content thread

Post by akroma222 »

Yes for sure!
Anyone is welcome to contribute to this thread :D

I will do my best to organise incoming work and add it to the original post!

And thank you Drakkan, lots of cool fun weapon stuff to come ;)
MrChoke
Posts: 324
Joined: Sat Oct 25, 2014 7:20 pm

Re: [WIP] Combined custom content thread

Post by MrChoke »

akroma222,
This is very cool. How did you do this without any info on the models yet? Is there a particular tool or app we can use to create a model or fbx file?
User avatar
Doridion
Posts: 256
Joined: Tue Jun 10, 2014 9:23 pm

Re: [WIP] Combined custom content thread

Post by Doridion »

Updated my food collection : Link

Thanks to Germanny for his textures/models of bottles.

Containing Bread, Apple, Eggs ( Green, Red, Blue ), Bottle of water, Bottle of mead, Piece of meat. All gives bit of energy or health ( Can be changed in the Item.lua )
User avatar
akroma222
Posts: 1029
Joined: Thu Oct 04, 2012 10:08 am

Re: [WIP] Combined custom content thread

Post by akroma222 »

MrChoke - I have just had some good guesses at the model names with the work I am doing with daggers, but apart from that I have not been manipulating any LoG2 models yet.
I have been using John Wordsworths Grimrock Model Toolkit that he created for LoG1.

Doridion - will update your assets today ;)
User avatar
akroma222
Posts: 1029
Joined: Thu Oct 04, 2012 10:08 am

Re: [WIP] Combined custom content thread

Post by akroma222 »

Hey folks,

I have trial and errored my way onto Chain Actions (eg Flurry of Slashes)
Here is an example code
SpoilerShow

Code: Select all

defineObject{
     	name = "eviscerater_dagger",	--(DONE)
        baseObject = "assassin_dagger",
        components = {
	{
          	class = "Model",
           	model = "assets/models/items/assassin_dagger.fbx",	
        },
        {
           	class ="Item",
           	uiName = "Eviscerater",
           	gfxAtlas = "assets/textures/gui/items_3.tga",
		gfxIndex = 2,
           	weight = 1.2,
           	impactSound = "impact_blade",
		secondaryAction = "flurry_of_slashes1",
           	traits = { "dagger", "light_weapon" },
           	description = "This dagger has been crafted in such a way to inflict the most internal damage possible on it's target... you suspect it was possibly used for ritual suicides or for hunting extremely tough prey."
        },
        {
           	class = "MeleeAttack",
           	attackPower = 26,
           	accuracy = 5,
           	swipe = "horizontal",
           	attackSound = "swipe",
           	cooldown = 2.2,
           	baseDamageStat = "dexterity",
           	damageType = "physical",
           	requirements = {"light_weapons" ,2},
        },
	{
             	class = "MeleeAttack",			
             	name = "flurry_of_slashes1",
		uiName = "Flurry of Slashes",
		chainAction = "flurry_of_slashes2",
		chainActionDelay = 0.2,
		repeatCount = 0,
		attackPower = 26,
		swipe = "horizontal",
		attackSound = "swipe_special",
		baseDamageStat = "dexterity",
             	cooldown = 0.2,
             	energyCost = 30,
             	requirements = { "accuracy", 2},
             	onAttack = function(self,champion,hand)
			champion:playDamageSound()
             	end,
        },
	{
             	class = "MeleeAttack",			
             	name = "flurry_of_slashes2",
		uiName = "Flurry of Slashes",
		chainAction = "flurry_of_slashes3",
		chainActionDelay = 0.2,
		repeatCount = 0,
		attackPower = 26,
		swipe = "vertical",
		attackSound = "swipe_special",
		baseDamageStat = "dexterity",
             	cooldown = 0.1,
             	energyCost = 30,
             	requirements = { "accuracy", 2},
             	onAttack = function(self,champion,hand)
			champion:playDamageSound()
             	end,
        },
	{
             	class = "MeleeAttack",			
             	name = "flurry_of_slashes3",
		uiName = "Flurry of Slashes",
		attackPower = 26,
		swipe = "horizontal",
		attackSound = "swipe_special",
		baseDamageStat = "dexterity",
             	cooldown = 3.2,
             	energyCost = 30,
             	requirements = { "accuracy", 2},
             	onAttack = function(self,champion,hand)
			champion:playDamageSound()
             	end,
        },
	}
    }	
Progress on the daggers conversion is going well :)
SpoilerShow
Image
Akroma
Post Reply