Weapon Creation - light component and texture issues.

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!
Post Reply
User avatar
MadCatter
Posts: 34
Joined: Mon Nov 03, 2014 5:02 am
Location: Southampton, UK

Weapon Creation - light component and texture issues.

Post by MadCatter »

Hi everyone. I've been working on a lantern item in a Zelda theme which acts as a torch when held, and as a special attack creates a fireburst spell.

1) I have created a custom model (based on the wall lanterns), but I'm having some texture wrapping issues as you can see below.
The texture mapping is set to "Wrap" (i believe it only repeats the texture 3 times). How can i get it to cover the entire model, or is the error in the model itself?
SpoilerShow
Image
2) I am not sure what the coding is to add the light property to the object. Current object definition is attached below.
SpoilerShow

Code: Select all

defineObject{
   name = "hand_lantern",
   baseObject = "base_item",
      components = {
      {
         class = "Model",
         model = "mod_assets/models/sx_lantern.fbx",
      },
	  {
         class ="Item",
         uiName = "Lantern",
		 gfxAtlas = "mod_assets/textures/items_atlas.dds",
         gfxIndex = 0,
         gfxIndexPowerAttack = 1,
         secondaryAction = "Fire_Blast",
		 impactSound = "impact_blade",
         weight = 1.5,
         traits = { "item" },
         description = "An old oil lantern.",
      },
	  {
         class = "MeleeAttack",
         attackPower = 5,
         accuracy = 5,
         --attackSound = "swipe_bow",
         cooldown = 2.0,
         baseDamageStat = "strength",
         damageType = "physical",
      },
	  {
        class = "CastSpell",         
        name = "Fire_Blast",
		uiName = "Fire Blast",
		spell = "fireburst",
		repeatCount = 0,
		cooldown = 6,
        energyCost = 30,
	  },
   },
   editorIcon = 24,
}
3) The version of Photoshop I have (elements 5) does not support alpha channel masks so my icons are stuck with white backgrounds. Is there any other software that does? (preferably free?)


Thanks for your help :D
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Re: Weapon Creation - light component and texture issues.

Post by minmay »

MadCatter wrote:1) I have created a custom model (based on the wall lanterns), but I'm having some texture wrapping issues as you can see below.
The texture mapping is set to "Wrap" (i believe it only repeats the texture 3 times). How can i get it to cover the entire model, or is the error in the model itself?
I haven't heard of this happening with Grimrock's wrap addressing, so I'd check the model first. Your modeling software should have the option to load a texture. From the screenshot it looks like you didn't unwrap some parts of the mesh.
MadCatter wrote:2) I am not sure what the coding is to add the light property to the object. Current object definition is attached below.
If you want it to glow exactly like a torch, you want TorchItemComponent. If you want a different color/brightness/etc you'd probably have to use the onEquipItem and onUnequipItem hooks to add and remove a LightComponent to/from the party (I haven't done this yet so I'm not going to provide any code).
MadCatter wrote:3) The version of Photoshop I have (elements 5) does not support alpha channel masks so my icons are stuck with white backgrounds. Is there any other software that does? (preferably free?)
I endorse GIMP, completely free and there's a DDS export plugin.
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.
User avatar
MadCatter
Posts: 34
Joined: Mon Nov 03, 2014 5:02 am
Location: Southampton, UK

Re: Weapon Creation - light component and texture issues.

Post by MadCatter »

That's great, thanks so much :D
Post Reply