Sleep() and another analogue
Posted: Mon Aug 07, 2017 1:34 pm
Hi there!)
I hope that I don't disturb you much.
After solution with removing Property from Array (thanks CWO) I went on and implement nice Buff Icons display for our shard.
That system was made with RusseL help and with guialtran help.
I synthesized these two and made it.
But! I still have another issue, which I can't understand how to fix it.
Example with Target Spell script - Reactive Armor.
We set with function DoTempMod() params on character and after set on buff icons with BuffOn().
All works fine!
But! If we use script with Target Area Spell like Arch Protections or Mass Curse, where is foreach endforeach - we have a trouble. Script cast to the first character and stopped, 'cause wait to remove Buff icons from that character and follow to another.
Example with Mass Curse:
In my BuffOn there is function at the end of script:
TimeToBuffOff( who, icon, duration );
So, you can now understand. When I use Mass Curse or Arch Protection at the first character, my script follow to that TimeToBuffOff function, and wait, 'cause there is Sleep() function. Scripts wait and doesn't want to move to another character at the radius of 10 tiles. When time is over and Sleep() comes to the end, script follow to the next character and again wait....
I don't know, how and what I have to do, to fix this trouble with Sleep() function.
Oh, eah.. You can see Detach(); function and it doesn't work.
Best regards!
I hope that I don't disturb you much.
After solution with removing Property from Array (thanks CWO) I went on and implement nice Buff Icons display for our shard.
That system was made with RusseL help and with guialtran help.
I synthesized these two and made it.
But! I still have another issue, which I can't understand how to fix it.
Example with Target Spell script - Reactive Armor.
Code: Select all
DoTempMod( cast_on, str_mod, CInt( power ), CInt( duration ), mod_type, spelldata.caster );
var buff_icons := BuffOn( cast_on, spelldata.cfg_elem.name, power, duration );
All works fine!
But! If we use script with Target Area Spell like Arch Protections or Mass Curse, where is foreach endforeach - we have a trouble. Script cast to the first character and stopped, 'cause wait to remove Buff icons from that character and follow to another.
Example with Mass Curse:
Code: Select all
foreach cast_on in ....
...
DoTempMod( cast_on, Lower(spelldata.cfg_elem.mod), (0 - mod_amount), 15, Lower(spelldata.cfg_elem.ModType));
var buff_icons := BuffOn( cast_on, spelldata.cfg_elem.name, mod_amount, 15 );
endforeach
TimeToBuffOff( who, icon, duration );
Code: Select all
function TimeToBuffOff( who, buff, duration )
if (duration <= 0)
duration := 0;
endif
//print(" buffIcon.inc | TimeToBuffOff() | duration : " + duration ); // DEBUG
Detach();
Sleep(duration);
//BuffOff( who, buff );
BuffDebuff_removeIcone2( who, buff );
endfunction
I don't know, how and what I have to do, to fix this trouble with Sleep() function.
Oh, eah.. You can see Detach(); function and it doesn't work.
Best regards!