Page 65 of 65

Re: [Models] New created Models..

Posted: Mon Apr 13, 2015 9:53 pm
by germanny
OOps :)
Sorry to read about these probs - i thought all people using this would be aware to look carefully at my example dungeon...
Really bad description failure by me. Well, in real i forgot to mention it exactly in my manual v3.. and since i have soo small time
to bother with grimrock (i really want but... ) it was forgotten over time.

In the objects.lua - at the beginning - you´ll find this section:

Code: Select all

cloneObject{
   name = "party",
   baseObject = "party",
   onAttack = function (self, weapon)
      return DMDungeonInit.whatWeapon(self, weapon)
   end,
}
Was implemented because item 'dm_pickaxe' only should be able to destroy the "dm_cavein_breakable".
For that functionality it is necessary to use a party hook.
These section from "dm_cavein_breakable" in objects.lua:

Code: Select all

-- IMPORTANT! clone party + script 'DMDungeonInit' in dungeon needed! see DM Set manual.
   onDamage = function(self, dmg, dmgType)
		if dmgType == "fire" or
			dmgType == "cold" or
			dmgType == "shock" or
			dmgType == "poison"
		then
		hudPrint("Magic has no effect on Stone and Gravel!")
		return false
		else
		return DMDungeonInit.checkDamage(self, dmg, dmgType)
		end
   end,
Here the in-example-dungeon script DMDungeonInit is asked. It MUST exist in the dungeon, otherwise the game may crash ;) sorry..
So here the initial script that you must set at level 1 of your dungeon:
Script: DMDungeonInit

Code: Select all

usedWeapon = ""

    function checkDamage(self, dmg, dmgType)

       if usedWeapon == "dm_pickaxe" then
          usedWeapon = ""
          return true
       else
          if self.name == "dm_cavein_breakable" then
           hudPrint("Use a Pickaxe for digging..")
		  end
          usedWeapon = ""
          return false
       end

    end

    function whatWeapon(self, weapon)

       if weapon then
          usedWeapon = weapon.name
       end
       return true

    end
You´ll see a variable 'whatWeapon' - it is the one out of that party on attack function inside objects.lua.

Summary:
Objects.lua
- clone party script
- dm_cavein_breakable object definition
Items.lua
- dm_pickaxe item definition
Dungeon editor file
- script function - DMDungeonInit - must be set!
(you will find mine at the first level in the top left corner)
Then all should work as expected! (hopefully) xD

Please be gentle with me ;)
Wish you all a cool mod experience with grimrock 2 - damn, if i would have enough time... so full of ideas.

Re: [Models] New created Models..

Posted: Wed Apr 15, 2015 12:31 am
by Killcannon
Thanks for the response and the explanation Germanny! <3 I admit I'm only using a few things from your mod and did not look at the test dungeon at all. I did read the manual, and did not see anything about needing the other lua in it. I've gone ahead and updated everything back and it works fine now!

Re: [Models] New created Models..

Posted: Wed Apr 15, 2015 11:30 am
by fazzasx
Hi Germanny,

I would like to know how you created the sharetx file and how you got the dm_gem_green, blue, yellow etc to be referenced from that file and also how the iconatlas works?

I know that your a busy man, and to be honest so am I, so can you point me in the direction of where to learn this or how I would be able to add an extra colour (e.g. red gem) to the .dds and then update the iconatlas?

I think just some basic pointers, and or a link to where to learn it should be enough if that's ok?

Best regards, and I think your models are great :)

Re: [Models] New created Models..

Posted: Sun May 03, 2015 10:28 am
by germanny
@fazzax:
Sharetx.. the gem texture, no?
For Photoshop!
I saved in Blender the UV-grid as png, loaded it in.
On a second layer i filled with color, with a bit transparency (test it out).
Third layer - to paint via hand along the uv-grid lines (mesh edges) to make it less transparent there.
Make layer with uv-grid invisible, collapse the other layers.

Now you must add the alpha channel.
Set the background color to white.
Go to layers tab, select the collapsed layer, press ctrl and click onto the layer.
This will select all with transp.
Go to the channels tab and add a new channel, automacically named alpha1.
Choose that alpha channel, and press ctrl+d to generate the alpha.

Save as dds (ps-plugin)