[Models] New created Models..

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
User avatar
germanny
Posts: 530
Joined: Sat Apr 07, 2012 10:52 pm
Location: Kiel, Germany

Re: [Models] New created Models..

Post 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.
Dungeon Master Resource Pack worker and passionated Beer drinker
Killcannon
Posts: 73
Joined: Sun Apr 12, 2015 2:57 pm

Re: [Models] New created Models..

Post 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!
User avatar
fazzasx
Posts: 104
Joined: Mon May 27, 2013 12:35 am

Re: [Models] New created Models..

Post 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 :)
Zastaph
User avatar
germanny
Posts: 530
Joined: Sat Apr 07, 2012 10:52 pm
Location: Kiel, Germany

Re: [Models] New created Models..

Post 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)
Dungeon Master Resource Pack worker and passionated Beer drinker
Post Reply