Custom textures for items/props
Re: Custom textures for items/props
I've made some more progress in principle on the returning of the thrown weapon...
when the thrown returning_axe hits a monster it shoots a fake_returning_axe back at the party.
from here I want to check if the party is ever hit by a fake_returning_axe.. and if so, destroy it and spawn a returning_axe in the champion's hand.
Also I want to check if the party ever picks up a fake_returning_axe... if so, it should be destroyed and replaced with a returning_axe.
All this would mean that if the party moved out of the way they would not catch the returning axe and would have to go pick it up from wherever it landed!
no script to share as yet... I have just tested a few hooks to see if it will work.
when the thrown returning_axe hits a monster it shoots a fake_returning_axe back at the party.
from here I want to check if the party is ever hit by a fake_returning_axe.. and if so, destroy it and spawn a returning_axe in the champion's hand.
Also I want to check if the party ever picks up a fake_returning_axe... if so, it should be destroyed and replaced with a returning_axe.
All this would mean that if the party moved out of the way they would not catch the returning axe and would have to go pick it up from wherever it landed!
no script to share as yet... I have just tested a few hooks to see if it will work.
Puzzle Frameworks - http://www.grimrock.net/forum/viewtopic.php?f=14&t=4564
Magic Pack - https://www.nexusmods.com/grimrock/mods/70
Area of Effect Spell System - http://www.grimrock.net/forum/viewtopic ... 150#p44382
Magic Pack - https://www.nexusmods.com/grimrock/mods/70
Area of Effect Spell System - http://www.grimrock.net/forum/viewtopic ... 150#p44382
Re: Custom textures for items/props
Throwing Axe of Returning!
items.luacreate returning axe item and "fake" item used for the returning graphics. The names are important and must match those in the script to work.
monsters.luaclone every monster and add the onProjectileHit hook to check if monster was hit by returning axe.
init.luaclone the party and add the 3 necessary hooks onAttack; onProjectileHit and OnPickupItem. If you already have a party clone, add these hooks.
script entity called grims_returning_axe_scriptDo a bunch of stuff!!
NOTES
1) Axe only returns if it hits a monster with the hook (so you can prevent some monsters by removing them from the MonsterList)
2) Axe deals 0 ~ 1 damage to a front party member when it returns
3) Axe teleports to the hand of the thrower when it hits the party
4) if the party moves it will not catch the Axe, but can go and pick it up. When you do, it teleports to the hand of the thrower if possible.
5) if the the thrower has no free hands when the axe returns (or is picked up) it will land on the ground, but can be picked up normally.
items.lua
Code: Select all
cloneObject{
name ="returning_throwing_axe",
baseObject="throwing_axe",
uiName = "Throwing Axe of Returning",
sharpProjectile = false,
stackable = false,
}
cloneObject{
name ="fake_returning_throwing_axe",
baseObject="throwing_axe",
uiName = "Fake Throwing Axe",
sharpProjectile = false,
stackable = false,
attackPower = 0,
throwingWeapon = false,
}
monsters.lua
Code: Select all
local monstersList = {"crab","crowern","cube","goromorg","green_slime","herder","herder_big","herder_small","herder_swarm","ice_lizard","ogre","scavenger","scavenger_swarm","shrakk_torr","skeleton_archer","skeleton_archer_patrol","skeleton_patrol","skeleton_warrior","snail","spider","tentacles","uggardian","warden","wyvern"
}
for i=1,# monstersList do
cloneObject{
name = monstersList[i],
baseObject = monstersList[i],
onProjectileHit = function(monster, weapon)
return grims_returning_axe_script.projectileCheck(monster,weapon)
end,
}
end
init.lua
Code: Select all
cloneObject{
name = "party",
baseObject = "party",
onAttack = function(champion,weapon)
return grims_returning_axe_script.weaponCheck(champion,weapon)
end,
onProjectileHit = function(champion,weapon)
return grims_returning_axe_script.partyProjectileCheck(champion,weapon)
end,
onPickUpItem = function(party,item)
return grims_returning_axe_script.partyPickupCheck(party,item)
end,
}
script entity called grims_returning_axe_script
Code: Select all
-- store the ordinal value of the champion using returning Axe --
thrower_ord = 1 -- set starting thrower Ordinal value purely for the case that you first throw the axe from the mousepointer!
-- find the champion ID from the ordinal number --
function findChampionByOrdinal(ord)
for ch = 1,4 do
if party:getChampion(ch):getOrdinal() == ord then
return party:getChampion(ch)
end
end
end
function getDistance(obj1,obj2)
local distance = 0
local XNumber = math.max(obj1.x,obj2.x) - math.min(obj1.x,obj2.x)
local YNumber = math.max(obj1.y,obj2.y) - math.min(obj1.y,obj2.y)
distance = XNumber + YNumber
return distance
end
-- check if party attack with returning Axe --
function weaponCheck(champion,weapon)
if weapon ~= nil then
if weapon.name == "returning_throwing_axe" then
thrower_ord = champion:getOrdinal()
else
-- hudPrint("Other Weapon")
end
else
-- hudPrint("Unarmed")
end
end
-- Check if Monster Hit by returning Axe --
function projectileCheck(monster,weapon)
if weapon.name == "returning_throwing_axe" then
if findEntity(weapon.id) ~= nil then
weapon:destroy()
local distance = getDistance(party,monster)
local facing = (party.facing + 2)%4
local dx,dy = getForward(facing)
shootProjectile("fake_returning_throwing_axe", party.level, monster.x+dx, monster.y+dy, facing, 2*distance, 1, 1, 0, 0, 0, 0, false, false)
end
end
end
-- Check if Party hit by fake axe --
function partyProjectileCheck(champion,weapon)
local throw_champ = findChampionByOrdinal(thrower_ord)
if weapon.name == "fake_returning_throwing_axe" then
weapon:destroy()
if throw_champ:getItem(7) == nil then
throw_champ:insertItem(7,spawn("returning_throwing_axe"))
elseif throw_champ:getItem(8) == nil then
throw_champ:insertItem(8,spawn("returning_throwing_axe"))
else
spawn("returning_throwing_axe",party.level,party.x,party.y,party.facing)
end
end
end
-- Check if party picks up fake axe --
function partyPickupCheck(party,item)
if item.name == "fake_returning_throwing_axe" then
-- hudPrint("fake axe")
item:destroy()
-- setMouseItem(spawn("returning_throwing_axe"))
-- spawn("returning_throwing_axe",party.level,party.x,party.y,party.facing)
local throw_champ = findChampionByOrdinal(thrower_ord)
if throw_champ:getItem(7) == nil then
throw_champ:insertItem(7,spawn("returning_throwing_axe"))
elseif throw_champ:getItem(8) == nil then
throw_champ:insertItem(8,spawn("returning_throwing_axe"))
else
spawn("returning_throwing_axe",party.level,party.x,party.y,party.facing)
end
return false
end
return true
end
NOTES
1) Axe only returns if it hits a monster with the hook (so you can prevent some monsters by removing them from the MonsterList)
2) Axe deals 0 ~ 1 damage to a front party member when it returns
3) Axe teleports to the hand of the thrower when it hits the party
4) if the party moves it will not catch the Axe, but can go and pick it up. When you do, it teleports to the hand of the thrower if possible.
5) if the the thrower has no free hands when the axe returns (or is picked up) it will land on the ground, but can be picked up normally.
Puzzle Frameworks - http://www.grimrock.net/forum/viewtopic.php?f=14&t=4564
Magic Pack - https://www.nexusmods.com/grimrock/mods/70
Area of Effect Spell System - http://www.grimrock.net/forum/viewtopic ... 150#p44382
Magic Pack - https://www.nexusmods.com/grimrock/mods/70
Area of Effect Spell System - http://www.grimrock.net/forum/viewtopic ... 150#p44382
Re: Custom textures for items/props
Two new textures for gobelins added. Now my Lands of Lore collection is somewhat complete (unless I have a time to get to Yvel and White Tower and check them out for more gobelins).
Also I've added Ranger's Shield. A shield that allows opening spell menu. I wish I had one when playing Toorum. Anyway I'm not sure if idea for such shield is actually good one or not, but after all you may use that texture for some regular shields.
If Ranger's Shield is a shield for the mage, there should also be a shield for the rogue. That's why I've made a throwing buckler from round shield but I'm not sharing it because:
a. Round shield model doesn't look good enough - such throwing shield would look better if it had sharp edges and be slightly smaller then round shield.
b. It feels a bit like being Captain America. After throwing hammer of return I'm not sure I'm ready for another Avenger
Also I've added Ranger's Shield. A shield that allows opening spell menu. I wish I had one when playing Toorum. Anyway I'm not sure if idea for such shield is actually good one or not, but after all you may use that texture for some regular shields.
If Ranger's Shield is a shield for the mage, there should also be a shield for the rogue. That's why I've made a throwing buckler from round shield but I'm not sharing it because:
a. Round shield model doesn't look good enough - such throwing shield would look better if it had sharp edges and be slightly smaller then round shield.
b. It feels a bit like being Captain America. After throwing hammer of return I'm not sure I'm ready for another Avenger
Re: Custom textures for items/props
That ranger shield is the best yet! I can only find the model though, I can't find the .dds.
The new gobelins are great too, I'm gonna find a place for all of them.
The new gobelins are great too, I'm gonna find a place for all of them.
Re: Custom textures for items/props
I must have forgot to add them. Both DDS added (spec and dif). I hope everything's fine now.Batty wrote:That ranger shield is the best yet! I can only find the model though, I can't find the .dds.
The new gobelins are great too, I'm gonna find a place for all of them.
Sorry for inconvenience and thanks for the info.
Re: Custom textures for items/props
Wow these are very good, high quality and professional textures.
Huder's Assets newest: Wooden Shield
Re: Custom textures for items/props
Hey, Mere. Would you mind if we posted links to all the custom content you post on the Nexus to the CAP?
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
- Message me to join in!
- Ciccipicci
- Posts: 154
- Joined: Mon Oct 08, 2012 12:55 am
Re: Custom textures for items/props
For the Ranger's shield code there's a couple of thing to correct.
-The definitions in material.lua should add into the object.lua
-The right code to add into the material.lua is:
-The definitions in material.lua should add into the object.lua
-The right code to add into the material.lua is:
SpoilerShow
-- RANGER'S SHIELD
defineMaterial{
name = "ranger_shield",
diffuseMap = "mod_assets/textures/ranger_shield_dif.tga",
specularMap = "mod_assets/textures/ranger_shield_spec.tga",
doubleSided = false,
lighting = true,
alphaTest = false,
blendMode = "Opaque",
textureAddressMode = "Wrap",
glossiness = 20,
depthBias = 0,
}
defineMaterial{
name = "ranger_shield",
diffuseMap = "mod_assets/textures/ranger_shield_dif.tga",
specularMap = "mod_assets/textures/ranger_shield_spec.tga",
doubleSided = false,
lighting = true,
alphaTest = false,
blendMode = "Opaque",
textureAddressMode = "Wrap",
glossiness = 20,
depthBias = 0,
}
Re: Custom textures for items/props
Thanks, I'm glad you like it.Huder wrote:Wow these are very good, high quality and professional textures.
Not at all, in fact I've already posted link in C.A.P. thread before checking this threadNeikun wrote:Hey, Mere. Would you mind if we posted links to all the custom content you post on the Nexus to the CAP?
I think uploading new stuff to Nexus as separate packs is more convenient because adding new scripts to this thread and editing scripts over and over is very mistake-friendly (see below). Maybe I'll keep this thread more as W.I.P. thing.
Thanks for pointing this out. It seems like I failed post editing againCiccipicci wrote:For the Ranger's shield code there's a couple of thing to correct.
-The definitions in material.lua should add into the object.lua
-The right code to add into the material.lua is:
I've edited my post and I hope it's good now.
Re: Custom textures for items/props
I'm not sure I follow, Mere.
I think uploading small packs on the nexus is a good idea too so that players have less to wade through if they want only some of the new assets.
I think the Community Asset pack is good as well so that people who want everything can have it, and it's very easily indexed. (For now. I imagine once Grimrock has 10 000 asset mods like Skyrim, it'll be a bit harder to manage lol.
I think uploading small packs on the nexus is a good idea too so that players have less to wade through if they want only some of the new assets.
I think the Community Asset pack is good as well so that people who want everything can have it, and it's very easily indexed. (For now. I imagine once Grimrock has 10 000 asset mods like Skyrim, it'll be a bit harder to manage lol.
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
- Message me to join in!