• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TFS 1.X+ New runes with unpatterned area

Trevys

Member
Joined
Apr 1, 2014
Messages
11
Reaction score
10
Hi guys, I'm trying to make runes with different areas, and I came across this difficulty.
1658893440226.png1658893449064.png

When I use the rune in one direction, the area goes one way, and when I use it in another direction, the area goes out in another.
It's like some system forces you to invert the area according to the direction the rune is thrown, and I didn't want that, I'd like a fixed area on all sides. I even tested it with other areas to prove this, follow the images.


Lua:
combate local = Combate()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, 7)


AREA_KUNAI = {
    {1, 1, 1},
    {1, 3, 0},
    {1, 1, 1}
}

combat:setArea(createCombatArea(AREA_KUNAI))



função onGetFormulaValues(player, level, maglevel)
    local min = (nível / 4,5) + (maglevel * 6) + 25
    local max = (nível / 4,5) + (maglevel * 8) + 45
    return -min, -max
fim

combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

função onCastSpell(criatura, variante)
    return combat:execute(criatura, variante)
fim

Does anyone know how I can solve this problem? I know that in normal spells direction="0" solves it, but in runes it's not working
 
Last edited:
Solution
Does anyone know how I can solve this problem? I know that in normal spells direction="0" solves it, but in runes it's not working
direction = 0 - sets spell target position on player, so there is no direction between player and target position - it uses 'NORTH' spell orientation (not rotated)
direction = 1 - sets spell target position 1 tile in front of player, so there is some direction between these 2 positions
but that config is ignored for spells that have target (all runes). For them it takes target position from tile on which player clicked using rune.
Then it goes to 'combat area' calculation that returns 1 of 4 areas generated when you declared new area (rotated 0, 90, 180, 270 degree)...
Hi guys, I'm trying to make runes with different areas, and I came across this difficulty.
View attachment 69550View attachment 69551

When I use the rune in one direction, the area goes one way, and when I use it in another direction, the area goes out in another.
It's like some system forces you to invert the area according to the direction the rune is thrown, and I didn't want that, I'd like a fixed area on all sides. I even tested it with other areas to prove this, follow the images.


Lua:
combate local = Combate()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, 7)


AREA_KUNAI = {
    {1, 1, 1},
    {1, 3, 0},
    {1, 1, 1}
}

combat:setArea(createCombatArea(AREA_KUNAI))



função onGetFormulaValues(player, level, maglevel)
    local min = (nível / 4,5) + (maglevel * 6) + 25
    local max = (nível / 4,5) + (maglevel * 8) + 45
    return -min, -max
fim

combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

função onCastSpell(criatura, variante)
    return combat:execute(criatura, variante)
fim

Does anyone know how I can solve this problem? I know that in normal spells direction="0" solves it, but in runes it's not working
Maybe you can try to swap the "
AREA_KUNAI = {
{1, 1, 1},
{1, 3, 0},
{1, 1, 1}
}
" with
local area = createCombatArea(AREA_SQUARE1X1)
setCombatArea(combat, area)
 
Does anyone know how I can solve this problem? I know that in normal spells direction="0" solves it, but in runes it's not working
direction = 0 - sets spell target position on player, so there is no direction between player and target position - it uses 'NORTH' spell orientation (not rotated)
direction = 1 - sets spell target position 1 tile in front of player, so there is some direction between these 2 positions
but that config is ignored for spells that have target (all runes). For them it takes target position from tile on which player clicked using rune.
Then it goes to 'combat area' calculation that returns 1 of 4 areas generated when you declared new area (rotated 0, 90, 180, 270 degree)

If you don't want to rewrite engine, create 4 combats, each with rotated area and in onCastSpell check direction between player and target. Then select combat that will look as you want after C++ rotate it.
 
Solution
direction = 0 - sets spell target position on player, so there is no direction between player and target position - it uses 'NORTH' spell orientation (not rotated)
direction = 1 - sets spell target position 1 tile in front of player, so there is some direction between these 2 positions
but that config is ignored for spells that have target (all runes). For them it takes target position from tile on which player clicked using rune.
Then it goes to 'combat area' calculation that returns 1 of 4 areas generated when you declared new area (rotated 0, 90, 180, 270 degree)

If you don't want to rewrite engine, create 4 combats, each with rotated area and in onCastSpell check direction between player and target. Then select combat that will look as you want after C++ rotate it.

I understand, so the only way to fix this without creating the 4 areas, would be to change the sources? What if I did post action? Would the area still be inverted?

Maybe you can try to swap the "
AREA_KUNAI = {
{1, 1, 1},
{1, 3, 0},
{1, 1, 1}
}
" with
local area = createCombatArea(AREA_SQUARE1X1)
setCombatArea(combat, area)


Did not work :\
 
Last edited:
I understand, so the only way to fix this without creating the 4 areas, would be to change the sources? What if I did post action? Would the area still be inverted?
It does not matter where (spells, actions, some addEvent) and how you cast this spell. If it's combat, it has area and it's shot from distance, it will invert area.
 
Back
Top