PDA

View Full Version : » Tutorial: Special Effects Tracking


Sid
05-27-2006, 1:46 AM
Special Effect Tracking Tutorial

by ...Sid...


=> What is this?
Demonstrates how to track effects, Create, record and destroy them periodically without any problem.

=> Requirements
This requires the Frozen Throne Expansion, At least ver.1.07. This will not work with RoC as it involves Custom Scripts functions.
=> Main
To start off, You'll need a variable,
Fx (Special Effect Variable)
Now, Create a trigger as follows..

...
Trigger HandleFx
Events :
- None
Conditions :
- None
Actions :
- Custom Script : Local Effect Eff
- Custom Script : set Eff = udg_Fx
- Wait 5.00 seconds.
- Custom Script : set udg_Fx = Eff
- Special Effect : Destroy Special Effect Fx
...

Now How to Implement that?
Now you have your Effect Handle, You can implement it!
Use it this way...

...
- Special Effect : Create Special Effect : <Whatever Path of Effect>
- Set Fx = Last Created Special Effect
- Trigger : Run HandleFx (Ignoring Conditions)
...

Hooray! You've made your own Special Effect Tracker!
=> Customization
You can customize this further, Like setting up Delay to 10.00 seconds rather than 5.00 seconds.. It won't hurt, You can safely create whatever effects you want...


=> Advanced Customization
I've found how to enhance it further according to your needs, Cause normaly, making a Triggered spell, you need to always adjust the values for how much time you'll need to display the effects.

=> How to start?
Let's again look at the old effect tracker we made...
here it is...

...
Trigger HandleFx
Events :
- None
Conditions :
- None
Actions :
- Custom Script : Local Effect Eff
- Custom Script : set Eff = udg_Fx
- Wait 5.00 seconds.
- Custom Script : set udg_Fx = Eff
- Special Effect : Destroy Special Effect : Fx
...

You found that you've plainly used the 5.00 seconds constant delay... Now the question comes, how to customize it for each effect?
You'll need another variable,
FxDur ...Real Variable.
Now, convert the HandleFx into Custom script and modify it's Action functions like this..

...
function Trig_HandleFx_Actions takes nothing returns nothing
local effect Eff
local real EffDur
set Eff = udg_Fx
set EffDur = udg_FxDur
call TriggerSleepAction( EffDur )
set udg_Fx = Eff
call DestroyEffectBJ( udg_Fx )
endfunction
...

Now, your entire trigger looks like this...

...
function Trig_HandleFx_Actions takes nothing returns nothing
local effect Eff
local real EffDur
set Eff = udg_Fx
set EffDur = udg_FxDur
call TriggerSleepAction( EffDur )
set udg_Fx = Eff
call DestroyEffectBJ( udg_Fx )
endfunction

function InitTrig_HandleFx takes nothing returns nothing
set gg_trg_HandleFx = CreateTrigger( )
call TriggerAddAction( gg_trg_HandleFx, function Trig_HandleFx_Actions )
endfunction
...

=> How to Implement this now?
Same way we did before, but now one more variable to set before running this trigger!
like this..

...
- Special Effect : Create Special Effect : <Whatever Path of Effect>
- Set Fx = Last Created Special Effect
- Set FxDur = 6.00
- Trigger : Run HandleFx (Ignoring Conditions)
...

Now sit back and relax, this newly customized Effect Handler does the perfect handling that all you need!

...Sid...

Bah, the Code tags look really wierd, So I'm not using those... Can Admins please fix it to something else that looks nice?