Ask a simple question, get a simple answer

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!
bongobeat
Posts: 966
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: Ask a simple question, get a simple answer

Post by bongobeat » Thu Feb 01, 2018 5:00 pm

AndakRainor wrote:
@bongobeat: you could look at objects.lua in the spells pack to see how I solved this.
on which spell/object do your refer?
There is "frostburst_cast" that use the skill but I'm not sure if I understand it correctly. Does it change the duration of the frozen condition?

Code: Select all

defineObject{
  name = "frostburst_cast",
  baseObject = "frostburst",
  components = {
    {
      class = "TileDamager",
      attackPower = 11,
      castByChampion = 1,
      damageType = "cold",
      sound = "frostburst",
      onHitMonster = function(self, monster)
        monster:setCondition("frozen", math.random()*(3+party.party:getChampionByOrdinal(self:getCastByChampion()):getSkillLevel("water_magic")))
      end,
    },
  },
}
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505

Badgert
Posts: 249
Joined: Sun Jan 29, 2017 6:14 pm

Re: Ask a simple question, get a simple answer

Post by Badgert » Thu Feb 01, 2018 6:02 pm

Can you please tell me how to make a breakable standard element mine_moss_cave_in ?

User avatar
zimberzimber
Posts: 432
Joined: Fri Feb 08, 2013 8:06 pm

Re: Ask a simple question, get a simple answer

Post by zimberzimber » Fri Feb 02, 2018 12:08 am

Badgert wrote:Can you please tell me how to make a breakable standard element mine_moss_cave_in ?
Take one of the breakable boxes and change their model to the cave in model? :v
My asset pack [v1.10]
Features a bit of everything! :D

Badgert
Posts: 249
Joined: Sun Jan 29, 2017 6:14 pm

Re: Ask a simple question, get a simple answer

Post by Badgert » Fri Feb 02, 2018 10:14 am

I managed to do this like this

Code: Select all

        defineObject{
           name = "mine_moss_cave_in_breakable",
           baseObject = "base_obstacle",
           components = {
              {
                 class = "Model",
                 model = "assets/models/env/mine_cave_in.fbx",
              },
              {
                 class = "Obstacle",
                 hitSound = "summon_stone_hit",
                 hitEffect = "hit_wood",
              },
              {
                 class = "Health",
                 health = 50,
                 immunities = { "poison" },
                 spawnOnDeath = "barrel_crate_block_broken",
                 onDie = function(self)
                    self.go:playSound("summon_stone_die")
                 end,
              },
              {
                 class = "Controller",
              },
           },
           placement = "wall",
           automapTile = "wall",
           editorIcon = 120,
        }
but this collapse is NOT green and immediately reveals itself ...

User avatar
zimberzimber
Posts: 432
Joined: Fri Feb 08, 2013 8:06 pm

Re: Ask a simple question, get a simple answer

Post by zimberzimber » Fri Feb 02, 2018 2:24 pm

Badgert wrote:I managed to do this like this

Code: Select all

        defineObject{
           name = "mine_moss_cave_in_breakable",
           baseObject = "base_obstacle",
           components = {
              {
                 class = "Model",
                 model = "assets/models/env/mine_cave_in.fbx",
              },
              {
                 class = "Obstacle",
                 hitSound = "summon_stone_hit",
                 hitEffect = "hit_wood",
              },
              {
                 class = "Health",
                 health = 50,
                 immunities = { "poison" },
                 spawnOnDeath = "barrel_crate_block_broken",
                 onDie = function(self)
                    self.go:playSound("summon_stone_die")
                 end,
              },
              {
                 class = "Controller",
              },
           },
           placement = "wall",
           automapTile = "wall",
           editorIcon = 120,
        }
but this collapse is NOT green and immediately reveals itself ...
its not green because you're not overriding the materials like the moss_cave_in object does
What do you mean by "immediately reveals itself"?
My asset pack [v1.10]
Features a bit of everything! :D

Badgert
Posts: 249
Joined: Sun Jan 29, 2017 6:14 pm

Re: Ask a simple question, get a simple answer

Post by Badgert » Fri Feb 02, 2018 5:37 pm

zimberzimber wrote:What do you mean by "immediately reveals itself"?
This fragment differs sharply from the others and it is immediately clear that something is wrong with it ...

User avatar
zimberzimber
Posts: 432
Joined: Fri Feb 08, 2013 8:06 pm

Re: Ask a simple question, get a simple answer

Post by zimberzimber » Fri Feb 02, 2018 7:19 pm

Then yeah, just override the texture
My asset pack [v1.10]
Features a bit of everything! :D

Badgert
Posts: 249
Joined: Sun Jan 29, 2017 6:14 pm

Re: Ask a simple question, get a simple answer

Post by Badgert » Fri Feb 02, 2018 10:22 pm

I made such an option:

Code: Select all

        defineObject{
           name = "mine_moss_cave_in_breakable",
           baseObject = "base_obstacle",
           components = {
              {
                 class = "Model",
                 model = "assets/models/env/mine_cave_in.fbx",
		 material = "mine_moss_tile",
		 staticShadow = true,
              },
              {
                 class = "Obstacle",
                 hitSound = "impact_blunt",
                 hitEffect = "hit_dust",
              },
              {
                 class = "Health",
                 health = 50,
                 immunities = { "poison" },
                 spawnOnDeath = "barrel_crate_block_broken",
                 onDie = function(self)
                    self.go:playSound("summon_stone_die")
			   party.party:shakeCamera(0.02,2)
                 end,
              },
              {
                 class = "Controller",
              },
           },
           placement = "wall",
           automapTile = "wall",
           editorIcon = 144,
	   minimalSaveState = true,
        }
it seems to work well ...

User avatar
AndakRainor
Posts: 673
Joined: Thu Nov 20, 2014 5:18 pm

Re: Ask a simple question, get a simple answer

Post by AndakRainor » Thu Feb 08, 2018 12:45 am

Is it possible to occlude a water mesh on a given tile? Or to generate a water mesh dynamically?

minmay
Posts: 2697
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay » Thu Feb 08, 2018 12:50 am

WaterSurfaceMeshComponent creates a single mesh for all water tiles on the level, it doesn't make separate meshes, so you can't occlude parts of it.

The size/shape/triangle count of the mesh has little to do with water performance, however. The shaders are pretty cheap. What's expensive is rendering the reflection buffer in the first place, which is not affected at all by the size/shape/location/complexity of the mesh.
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