Page 175 of 396

Re: Ask a simple question, get a simple answer

Posted: Thu Dec 15, 2016 11:21 pm
by AndakRainor
Is there a way to avoid the burning condition animation on already dead monsters ?

I have a few spells that burn monsters to fix, for example:

Code: Select all

defineObject{
  name = "volcanic_eruption",
  baseObject = "base_spell",
  components = {
    {
      class = "Particle",
      particleSystem = "volcanic_eruption",
      offset = vec(0, 1.3, 0),
      destroyObject = true,
    },
    {
      class = "Light",
      color = vec(1, 1, 1),
      brightness = 10,
      range = 6,
      offset = vec(0, 1.3, 0),
      fadeOut = 0.75,
      disableSelf = true,
      fillLight = true,
    },
    {
      class = "TileDamager",
      attackPower = 10,
      damageType = "fire",
      onHitMonster = function(self, monster)
        if monster:isAlive() then
          monster:setCondition("burning", 5)
          -- mark condition so that exp is awarded if monster is killed by the condition
          local burning = monster.go.burning
          local ordinal = self:getCastByChampion()
          if burning and ordinal then burning:setCausedByChampion(ordinal) end
  
          monster:setCondition("poisoned", 25)
          -- mark condition so that exp is awarded if monster is killed by the condition
          local poisonedCondition = monster.go.poisoned
          if poisonedCondition and ordinal then poisonedCondition:setCausedByChampion(ordinal) end
        end
      end,
    },
  },
}

Re: Ask a simple question, get a simple answer

Posted: Fri Dec 16, 2016 5:29 pm
by THOM
Is there a way to get the current condition of a monster? In my case I want to do something if a certain type of monster is burning.

I could use a timer and check for the condition of a all living monster of that type but is there a more elegant, more resource saving way? Is there some kind of onUpdate event with monsters that could trigger my script?

Re: Ask a simple question, get a simple answer

Posted: Fri Dec 16, 2016 9:30 pm
by Isaac
THOM wrote:Is there a way to get the current condition of a monster? In my case I want to do something if a certain type of monster is burning.
Is this for a specific monster, or any random monster that's on fire?

If a random target, the Projectile, Bomb, and Tiledamager components each have hooks that can tell you what monster was hit by them, and from there those can be checked for the burning condition.

If it's a specific monster, then you can use the onDamage hook to check for the burning condition, (each time it's damaged).

Re: Ask a simple question, get a simple answer

Posted: Fri Dec 16, 2016 10:43 pm
by minmay
Monster conditions are all implemented as Components. Just check the monster's object for the existence of a component called "blinded", "burning", "entangled", "frozen", "poisoned", "sleep", or "stunned".

Re: Ask a simple question, get a simple answer

Posted: Sun Dec 18, 2016 10:01 am
by zimberzimber
Was playing on a custom dungeon, and I received a D3DError, but only when the 'Texture Resolution' option was set to low.
What's causing this?

Re: Ask a simple question, get a simple answer

Posted: Sun Dec 18, 2016 11:34 am
by minmay
Texture with missing mipmaps.

Re: Ask a simple question, get a simple answer

Posted: Sun Dec 18, 2016 7:51 pm
by kelly1111
I have a question about:

the swamp dungeon fog object.
When I disable the fog particles I get a nice green haze all across the level. how is this haze replicated in another object?
what i want is an object that doesnt fill the whole level with the haze, like the swamp dungeon fog does.
anyone have any suggestions on how to make it ?

Re: Ask a simple question, get a simple answer

Posted: Sun Dec 18, 2016 7:56 pm
by THOM
Well - why don't you copy over the Definition of the swamp-fog-object, rename it and delete the particle-component, that you don't want?

Re: Ask a simple question, get a simple answer

Posted: Sun Dec 18, 2016 11:57 pm
by minmay
You want FogParamsComponent.

Re: Ask a simple question, get a simple answer

Posted: Wed Dec 21, 2016 10:12 pm
by THOM
Is it possible to search for enteties not on the current level?

Because this

Code: Select all

for e in party.map:allEntities() do
would search on the level the party is on. What do I have to use if I want to search in a specific other level?