some problems

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
Modraneth
Posts: 95
Joined: Thu Aug 27, 2015 8:27 pm
Location: Portugal

Re: some problems

Post by Modraneth »

hi,
im trying to take a weapon from this pack http://www.nexusmods.com/legendofgrimrock2/mods/48/?

i have already made de definition

Code: Select all

    defineObject{
          name = "katana",
          baseObject = "base_item",
          components = {
          {
             class = "Model",
             model = "mod_assets/models/items/dm_weapon_samurai_sword.fbx",
          },
          {
             class ="Item",
             uiName = "Katana",
             gfxAtlas = "mod_assets/textures/dm_icoatlas.tga",
             gfxIndex = 12,
		GfxIndexPowerAttack = 158,
             weight = 1.5,
             impactSound = "impact_blade",
             traits = { "sword", "light_weapon" },
             description = "An expertly forged katana."
          },
          {
             class = "MeleeAttack",
             attackPower = 25,
             accuracy = 5,
             swipe = "horizontal",
             attackSound = "swipe_light",
             cooldown = 3.0,
             baseDamageStat = "strenth",
             damageType = "physical",
             requirements = {"light_weapons" ,3},
	     powerAttackTemplate = "flurry",
             gameEffect = "",
          },
       }
    }


but know im having this problem
the item its show this way http://prntscr.com/8l6r8n on the ground
but its ok when i take it or he was on inventory http://prntscr.com/8l6s1s http://prntscr.com/8l6sac

what do i do?

i have tried do the materials this way

Code: Select all

defineMaterial{
   name = "katana",
   diffuseMap = "mod_assets/textures/items/dm_samurai_sword_dif.tga",
   specularMap = "mod_assets/textures/items/dm_samurai_sword_spec.tga",
   normalMap = "mod_assets/textures/items/normal/dm_samurai_sword_normal.tga",
   doubleSided = false,
   lighting = true,
   alphaTest = false,
   blendMode = "Opaque",
   textureAddressMode = "Wrap",
   glossiness = 40,
   depthBias = 0,
   }
but dont work...
Mods:
Isle of Gunger
The Bloody Path Dropped
A World of Power work in progress
User avatar
Skuggasveinn
Posts: 562
Joined: Wed Sep 26, 2012 5:28 pm

Re: some problems

Post by Skuggasveinn »

If you open up the model dm_weapon_samurai_sword.model with GMT you will see that the material name the model uses is dm_samurai_sword and not katana.
So if you rename your material definition name from katana to dm_samurai_sword the 3d model should have texture in game

Skuggasveinn.
Link to all my LoG 2 assets on Nexus.
Link to all my LoG 1 assets on Nexus.
User avatar
Modraneth
Posts: 95
Joined: Thu Aug 27, 2015 8:27 pm
Location: Portugal

Re: some problems

Post by Modraneth »

it work, thank you very much.
Mods:
Isle of Gunger
The Bloody Path Dropped
A World of Power work in progress
User avatar
Modraneth
Posts: 95
Joined: Thu Aug 27, 2015 8:27 pm
Location: Portugal

Re: some problems

Post by Modraneth »

skuggas maybe u can help me with this too

i want to have flask and i want to make the flask be filled from any water source, and then the water flasks work like a energy potion and give 25 energy.
until now i have this

Code: Select all

defineObject{
	name = "flask",
	baseObject = "base_item",
	components = {
	{
			class = "Model",
			model = "mod_assets/models/items/dm_flask.fbx",
	},
	{
			class = "Item",
			uiName = "Empty Flask",
			gfxAtlas = "mod_assets//textures/dm_icoatlas.tga",
			gfxIndex = 140,
			impactSound = "impact_blunt",
			weight = 0.1,
	},
     }
}

Code: Select all

defineObject{
	name = "water_flask",
	baseObject = "base_item",
	components = {
	{
			class = "Model",
			model = "mod_assets/models/items/dm_flask_water.fbx",
	},
	{
			class = "Item",
			uiName = "Water Flask",
			gfxAtlas = "mod_assets/textures/dm_icoatlas.tga",
			gfxIndex = 141,
			impactSound = "impact_blunt",
			weight = 0.3,
			traits = { "potion" },
	},
	{
		
			class = "UsableItem",
			emptyItem = "flask",
			sound = "consume_potion",
			onUseItem = function(self, champion)
				champion:regainEnergy(25)
				champion:playHealingIndicator()
                                champion:giveitem "flask"
	},
     }
}



i need to make it to be possible to fill the flask for any water source, can that be possible?
Mods:
Isle of Gunger
The Bloody Path Dropped
A World of Power work in progress
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Re: some problems

Post by minmay »

You should familiarize yourself with basic procedural and object oriented programming concepts, and then Lua specifically (it's one of the simplest scripting languages there is, so it shouldn't be hard once you understand those basic concepts). Then you would know how to do pretty much anything you want, just by looking at the Grimrock 2 scripting reference.
It's much faster in the long run than trying to paste a whole mod together when you don't even understand what a table is, trust me.
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.
Post Reply