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,495
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,495
> ((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,495
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: 161
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top