PDA

View Full Version : Damaging Sparkles



Lelouche Vi Britannia
05-12-2016, 11:17 PM
Been looking all over the script functions and I can't find anything on it. I know damaging sparkles are hard coded like the magic book's fire damage is, which is fine, I always thought it was fluff anyway. What I can't find is a script function to add that effect on a custom item.

For example, if I wanted to add damaging sparkles to the magic thrown by the wand, how would I do that? What function(s) do I need to use to make that happen?

Dimentio
05-13-2016, 08:41 AM
You'd need either a global function or an FFC script launched by said wand item. I'd go with global. Have a timer

int timer = 0;
timer++;
timer %=8;
running, and when the timer reaches a certain number,

if (timer == 1)
detect all magic LWeapons using a for script

for (int i = 1; i <= Screen->NumLWeapons(); i++) {
lweapon Magic = Screen->LoadLWeapon(i);
if (Magic->ID == LW_MAGIC)
And then create a damaging sparkle weapon where the magic is located.

lweapon Sparkle = Screen->CreateLWeapon(LW_FIRESPARKLE);
Sparkle->X = Magic->X;
Sparkle->Y = Magic->Y;
Sparkle->Damage = 4;

Dimentio
05-13-2016, 08:42 AM
EDIT: Double posted for some reason.

Lelouche Vi Britannia
05-13-2016, 09:33 AM
-=SPOILER=-

Nevermind that, I looked it up. My real question is why global? Wouldn't an FCC be easier?

Dimentio
05-13-2016, 04:53 PM
FFC's are limited, and you might have a situation where the FFC just quits, like if it fails to detect magic. Globals are better for this kind of thing.

ZoriaRPG
06-15-2016, 11:10 PM
-=SPOILER=-

Nevermind that, I looked it up. My real question is why global? Wouldn't an FCC be easier?

In addition, a global component grants you control over Waitdraw() placement.

With an ffc, your sparkle will be created one frame after its parent weapon, and the sparkle will last for one frame after the parent weapon dies. This has the potential to lead to bugs, as your sparkles have a damaging effect, but it could also be a desirable result.

Lelouche Vi Britannia
09-09-2016, 01:09 PM
Just recently discovered that the damaging sparkles are a weapon type under "constants" meaning it can be scripted as an lweapon. This is what I get for asking questions before I read. I had no idea what the LW_FIRESPARKLE even was until now.