whitevo
Feeling good, thats what I do.
I though the issue lands on the same ballpark, just you wanted increase interval and I wanted reduce xD.But don't write in this thread (create new).
> [TFS 1.2] Creaturescript onThink interval ignored [thread] <
My question is, which of these options I should choose and why? (unless there is 3rd even better way)
I want to bring normal monster attacks to my monster AI too, but AI is based on onthink() function. Sadly it executes only once per second.
In order to be able to add attack what deals damage every 400 milliseconds I have came up with 2 solutions below.
1st option:
Reducing the onThink interval in source to 100 milliseconds.
If that is better solution then: How I go about it?
It just can't be as simple as changing >this< value to 100.
2nd option:
On the monster hit calculating How many addEvents() I should place on the monster>target and leave the leftover milliseconds for another hit calculation.
small example code:
Code:
addEvent(dealDelayDMG, milliseconds , combatTable)
Code:
function dealDelayDMG(combatTable)
--doing the error escape thing here
target_in_distance = checkDistance(combatTable)
if target_in_distance then
dealDamage(combatTable)
end
end