lukatxd
Well-Known Member
- Joined
- Dec 9, 2010
- Messages
- 135
- Solutions
- 1
- Reaction score
- 58
I know it may seem like a duplicate, but from the threads I found in this forum, they're not pointing to the same argument, and I tried their solutions beforehand.
I was trying to make a crossbow that shoots faster than normal without changing tfs sources, then I found the addEvent but I couldnt make it work there, so i decided to make a spell simulate that same effect.
Basically an exori frigo machine gun
current code looks like this:
But I am getting the message:
I already tried this, but the spell dont shoot anymore
I then went to see what was inside the "variant" argument by simply printing the keys in the table and I saw that it had a type and pos fields.
So I tried separating the arguments to rebuild the variant in the "shoot" method. Similar to this link from the forum.
That way the spell still shoots, but the warnings dont stop, they just change the target and the culprit is "variant.type". I'm kinda lost at this point.
I was trying to make a crossbow that shoots faster than normal without changing tfs sources, then I found the addEvent but I couldnt make it work there, so i decided to make a spell simulate that same effect.
Basically an exori frigo machine gun
current code looks like this:
LUA:
function onCastSpell(creature, variant)
addEvent(shoot, 0, creature,variant)
addEvent(shoot, 200, creature,variant)
addEvent(shoot, 400, creature,variant)
addEvent(shoot, 600, creature,variant)
return true;
end
function shoot(creature,variant)
combat:execute(creature, variant)
return true
end
But I am getting the message:
Lua Script Error: [Spell Interface]
data/spells/scripts/attack/ice_strike.luanCastSpell
LuaScriptInterface::luaAddEvent(). Argument #3 is unsafe
stack traceback:
[C]: in function 'addEvent'
data/spells/scripts/attack/ice_strike.lua:17: in function <data/spells/scripts/attack/ice_strike.lua:14>
I already tried this, but the spell dont shoot anymore
Hi everybody
I need a simple help for this spells....
the truth is that I do not know much about... buy someone can explain me, I'll be grateful.
this is my script.lua
I need a simple help for this spells....
the truth is that I do not know much about... buy someone can explain me, I'll be grateful.
this is my script.lua
LUA:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HOLYAREA)
combat:setArea(createCombatArea(DYBBUK_AREA1))
function onGetFormulaValues(player, level, maglevel)
local min = (level / 2.5) + (maglevel * 20) + 50
local max = (level / 2.5) + (maglevel * 18.4) + 50
return -min, -max
end...
I then went to see what was inside the "variant" argument by simply printing the keys in the table and I saw that it had a type and pos fields.
So I tried separating the arguments to rebuild the variant in the "shoot" method. Similar to this link from the forum.
Why wont this hit twice? tfs 1.3, the second time it will only display the hitarea effect.
LUA:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_WEAPONTYPE)
function onGetFormulaValues(player, skill, attack, factor)
local min = (player:getLevel() / 5) + (skill * attack * 0.01) + 1
local max = (player:getLevel() / 5) + (skill * attack * 0.03) + 6
return -min, -max
end
combat:setCallback(CALLBACK_PARAM_SKILLVALUE...
That way the spell still shoots, but the warnings dont stop, they just change the target and the culprit is "variant.type". I'm kinda lost at this point.