How do you make special effects?

H

Hohan

Guest
I presume the circle spell animation for teleport is a special effect. If so, I would like to know how to use it.

Thanks.

Hohan
 

Rad

...
Reaction score
228
Dawww Iono... What you can do is go to the ability and get the art model files, apply to a unit you arent using and put him on the map. See what the model looks like untill you find the right one, also check buff/effect models. When you find it copy the path and reset the unit. Tadaaaa
 

Kershbob

New Member
Reaction score
30
Add this to your map:

Code:
Special Effect Destruction
    Events
    Conditions
    Actions
        Custom script:   local effect tempEffect
        Custom script:   set tempEffect = udg_SpecialFX
        Wait 7.00 game-time seconds
        Custom script:   set udg_SpecialFX = tempEffect
        Special Effect - Destroy SpecialFX

Then you can just add this to your triggers:

Code:
Special Effect - Create a special effect at <point> using <SFX>
Trigger - Run Special Effect Destruction <gen> (ignoring conditions)
 
H

Hohan

Guest
hmm....... like when you use a scroll of town portal or that tele to structure item. Thanks for the idea.
 
H

Hohan

Guest
wow you posted while i was typing kershbob. That would be my first specific custom trigger from another person :D . i'll try it.
 

Kershbob

New Member
Reaction score
30
That's the one blizzard uses for cleaning up SFX. Other people use other ones though but the idea is the same.
 

emjlr3

Change can be a good thing
Reaction score
395
what would it be corrected then, i would like to know....
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,494
Special Effect - Create a special effect at <point> using <SFX>
Set SpecialFX = (Last created special effect)
Trigger - Run Special Effect Destruction <gen> (ignoring conditions)

or

Custom script: local effect tempEffect = (Last created special effect) (*)
Wait 7.00 game-time seconds
Custom script: set udg_SpecialFX = tempEffect
Special Effect - Destroy SpecialFX



(*) sorry, I never remember those GetLastSomething() in JASS :)
 

emjlr3

Change can be a good thing
Reaction score
395
so your destrcution trigger would only need like


Code:
Wait 7.00 game-time seconds
Special Effect - Destroy SpecialFX
set SpecialFX = null


?
 

xPheRe

New Member
Reaction score
43
emjlr3 said:
so your destrcution trigger would only need like
Code:
Wait 7.00 game-time seconds
Special Effect - Destroy SpecialFX
set SpecialFX = null
?
Nop, you still need the entire code.
As SpecialFX is a global, its value may change during the 7.00 seconds of duration.
So storing it in a local variable and then removing is your best bet.

BTW, with GUI created Special Effects I suggest you to use AceHart's way.
Code:
[b]Special Effect Destruction[/b]
Actions
    Custom script: local effect tempEffect = [u]GetLastCreatedEffectBJ( )[/u]
    Wait 7.00 game-time seconds
    Custom script:   set udg_SpecialFX = tempEffect
    Custom script:   [i]set tempEffect = null[/i]
    Special Effect - Destroy SpecialFX
Underlined is what AceHart can't remember. You can also use bj_lastCreatedEffect
Also always remember to nullify your locals if they point to any handle (Added in italics)

BTW, a good improvement can be to be able to modify the time the special effect remains alive.
Code:
[b]Special Effect Destruction[/b]
Events
Conditions
Actions
    Custom script: local effect ef = bj_lastCreatedEffect
    Custom script: local real lifetime = udg_SFX_LifeTime
    Set SFX_LifeTime = SFX_LifeTime_Default
    Custom script: call TriggerSleepAction( lifetime )
    Custom script: call DestroyEffect( ef )
    Custom script: set ef = null

[b]Map Initialization[/b]
Events
    Map Initialization
Actions
    ...
    Set SFX_LifeTime_Default = 7.00
    Set SFX_LifeTime = SFX_LifeTime_Default
So in your code you can do something like
Code:
...
Create a special effect at (point) using (SFX)
Run Special Effect Destruction

Create a special effect at (point) using (SFX2)
Set SFX_LifeTime = 15.00
Run Special Effect Destruction

Create a special effect at (point) using (SFX3)
Run Special Effect Destruction
The first special effect remains alive 7 seconds (the default behaviour that can be changed at map initialization)
The second one remains in screen 15 seconds
Third also dies after 7 seconds because the trigger restores lifetime value to default.

I hope this clarifies (maybe not) and helps a bit.
 
H

Hohan

Guest
Actually, this is the one of the few times i actually seen any custom scripts :confused: . Anyways I got this:

Code:
function Trig_Foot_Switch_to_Teleport_Actions takes nothing returns nothing
    call ForGroupBJ( GetUnitsInRectAll(gg_rct_Region_006), function Trig_Foot_Switch_to_Teleport_Func005002 )
    [B]local effect tempEffect = GetLastCreatedEffectBJ( )[/B]
    call PolledWait( 7.00 )
    [B]set udg_SpecialFX = tempEffect[/B]
    [B]set tempEffect = null[/B]
    [B]Destroy SpecialFX
[/B]

The lines that are in bold have some kind of error or something. Sorry about all this trouble I'm causing :banghead: .
 
H

Hohan

Guest
by the way, this is what i got so far....... im sooo lost :( im such a newbie.

Code:
Events:
Unit - A unit enters Region 010 <gen>
Unit - A unit enters Region 009 <gen>

Conditions:
((Owner of (Triggering unit)) controller) Equal to (Player 1 (Red) controller)
((Foot Switch 0068 <gen> is dead) Equal to True) and ((Foot Switch 0069 <gen> is dead) Equal to True)

Actions
Unit Group - Pick every unit in (Units in Region 006 <gen>) and do (Unit - Move (Picked unit) instantly to (Center of Region 008 <gen>))
Custom script:   local effect tempEffect = GetLastCreatedEffectBJ( )
Wait 7.00 game-time seconds
Custom script:   set udg_SpecialFX = tempEffect
Custom script:   set tempEffect = null
Custom script:   Destroy SpecialFX

Tell me if ive done anything wrong. :confused:
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,494
> ((Owner of (Triggering unit)) controller) Equal to (Player 1 (Red) controller)

Replace this with a "player" comparison, not "player controller".

And, that trigger doesn't create any special effects.
Remove all that effect handling...
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,494
Your last trigger posted here has a couple "custom script" lines dealing with Special Effects.
Your trigger, however, doesn't create any.
So, why do you have those lines?
 

xPheRe

New Member
Reaction score
43
I hope this simple example map clarifies some things...
 

Attachments

  • special effect.w3x
    16 KB · Views: 158
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top