Hi,
Is there a possibility to remove certain effects on the map. For instance - after using a water based talent, the burning on the floor would dissapear.
In the code reference only the add_Effect function is mentioned.
Cheers.
how to remove effects on map
Moderator: Moderator
-
- Archmage
- Posts: 379
- Joined: Tue Nov 11, 2003 10:54 am
- Location: Wroclaw/Poland
Re: how to remove effects on map
Code: Select all
for i = #game.level.map.effects, 1, -1 do
local e = game.level.map.effects
if e.damtype == DamageType.WHATEVER and e.grids[x] and e.grids[x][y] then
table.remove(game.level.map.effects, i)
end
end

[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning

-
- Archmage
- Posts: 379
- Joined: Tue Nov 11, 2003 10:54 am
- Location: Wroclaw/Poland
Re: how to remove effects on map
Will be tested shortlyUntested

-
- Archmage
- Posts: 379
- Joined: Tue Nov 11, 2003 10:54 am
- Location: Wroclaw/Poland
Re: how to remove effects on map
Ok,
When I use
the whole effect is removed. So if my effect is an AOE effect of radius 3, the whole effect will be removed.
But what if i want only to remove the effect from a specific tile on the map?
When I use
Code: Select all
table.remove(game.level.map.effects, i)
But what if i want only to remove the effect from a specific tile on the map?
Re: how to remove effects on map
Its either too much effort to get working, or I may have coded Whistling Winds in the Druid class to do it. Can't remember which.
My feedback meter decays into coding. Give me feedback and I make mods.
Re: how to remove effects on map
Is there any reason you couldn't have a bunch of effects, each one tile in a radius of 3 instead?MisiuPysiu wrote:So if my effect is an AOE effect of radius 3, the whole effect will be removed.
-
- Archmage
- Posts: 379
- Joined: Tue Nov 11, 2003 10:54 am
- Location: Wroclaw/Poland
Re: how to remove effects on map
Actually no particular reason. I'm just using the methods available when creating AOE effects. I could write an own function to do it differently of course.Is there any reason you couldn't have a bunch of effects, each one tile in a radius of 3 instead?
Well, i guess i will come back to this problem later. Right now ill try to finish my first class addon.
Cheers:)
Re: how to remove effects on map
Misiu,
Each effect lists the area it covers under its "grids" attribute. If you iterate over all the effects, and within that iteration you iterate over the grids for those effects (first x, then y), then, when the x and y value matches that of your ability, you can trim down your effects grid-by-grid. If your ability is an AoE, you will have to add another iteration to the three already described, as you'll need to run the check for every grid within the AoE.
I'm a little tight for time at the moment, but I can flesh out the code later in case I haven't described it well enough.
A mam nadzieję, że moja propozycja będzie cieszyć się powodzeniem
Each effect lists the area it covers under its "grids" attribute. If you iterate over all the effects, and within that iteration you iterate over the grids for those effects (first x, then y), then, when the x and y value matches that of your ability, you can trim down your effects grid-by-grid. If your ability is an AoE, you will have to add another iteration to the three already described, as you'll need to run the check for every grid within the AoE.
I'm a little tight for time at the moment, but I can flesh out the code later in case I haven't described it well enough.
A mam nadzieję, że moja propozycja będzie cieszyć się powodzeniem
