Page 3 of 3

Re: some problems

Posted: Sun Sep 27, 2015 11:18 pm
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...

Re: some problems

Posted: Sun Sep 27, 2015 11:59 pm
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.

Re: some problems

Posted: Mon Sep 28, 2015 12:11 am
by Modraneth
it work, thank you very much.

Re: some problems

Posted: Mon Sep 28, 2015 12:18 am
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?

Re: some problems

Posted: Mon Sep 28, 2015 3:59 am
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.