1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  3. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  4. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  5. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  6. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  7. The results are out! Check them out.
    Dismiss Notice
  8. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  9. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  10. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Simple Timed SFX System v1.3 [GUI]

Submitted by defskull
This bundle is marked as substandard. It may contain bugs, not perform optimally or otherwise be in violation of the submission rules.
INTRODUCTIONS
- This system will let the user to spawn your SFX with a timed duration.
- You don't need to do the hardwork, it will do it for you.
- You can spawn SFX either on a Unit or on Ground.
- It's in GUI.


HOW TO USE
Internal Instructions
- If you want to use this system, you would have to only follow these lines;
Point SFX
  • Actions
    • -------- SFX_Duration sets the duration of the SFX --------
    • -------- SFX_StringPath sets the path for the SFX --------
    • -------- SFX_Loc sets where does the SFX spawns --------
    • Set SFX_Duration = 5.00
    • Set SFX_StringPath = Abilities\Spells\Other\AcidBomb\BottleImpact.mdl
    • Set SFX_Loc = (Target point of ability being cast)
    • Trigger - Run SfxPoint <gen> (ignoring conditions)


OR

Unit SFX
  • Actions
    • -------- SFX_Duration sets the duration of the SFX --------
    • -------- SFX_StringPath sets the path for the SFX --------
    • -------- SFX_AttachmentPoint sets which point does the SFX affect on the unit --------
    • -------- SFX_Unit sets which unit has to take the SFX --------
    • Set SFX_Duration = 5.00
    • Set SFX_StringPath = Abilities\Spells\Other\AcidBomb\BottleImpact.mdl
    • Set SFX_AttachmentPoint = overhead
    • Set SFX_Unit = (Target unit of ability being cast)
    • Trigger - Run SfxUnit <gen> (ignoring conditions)


- So, before you call those function, you must set your variable first before calling them.

- If you are want to spawn SFX on unit, you must use this action after you have set the desired variables for SFX Unit
  • Trigger - Run SfxUnit <gen> (ignoring conditions)


For example;
  • Actions
    • Set SFX_Duration = 5.00
    • Set SFX_StringPath = Abilities\Spells\Other\AcidBomb\BottleImpact.mdl
    • Set SFX_AttachmentPoint = overhead
    • Set SFX_Unit = (Target unit of ability being cast)
    • Trigger - Run SfxUnit <gen> (ignoring conditions)


For Point, just do this: Trigger - Run SfxPoint <gen> (ignoring conditions)

External Instructions
- Open World Editor -> File > Preferences... > General Tab > Tick the Automatically create unknown variables while pasting trigger data
- Copy the Simple Timed SFX System folder and paste it in your map (Trigger Editor)


TRIGGERS
  • SFX Setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- This hashtable is for checking unit is dead or not, if dead, properly destroys its own SFX --------
      • Custom script: set udg_SFX_Hashtable = InitHashtable()
      • Set SFX_Dummy = Dummy (SFX)


  • SfxUnit
    • Events
    • Conditions
    • Actions
      • Set SFX_Loc = (Position of SFX_Unit)
      • Special Effect - Create a special effect attached to the SFX_AttachmentPoint of SFX_Unit using SFX_StringPath
      • Unit - Create 1 SFX_Dummy for (Triggering player) at SFX_Loc facing Default building facing degrees
      • Set SFX_Unit = (Last created unit)
      • Unit - Add a SFX_Duration second Generic expiration timer to SFX_Unit
      • Set SFX = (Last created special effect)
      • Custom script: set udg_SFX_Key = GetHandleId(udg_SFX_Unit)
      • Hashtable - Save Handle OfSFX as 0 of SFX_Key in SFX_Hashtable
      • Unit Group - Add SFX_Unit to SFX_Group
      • Custom script: call RemoveLocation(udg_SFX_Loc)
      • Trigger - Turn on SFX Clear <gen>


  • SfxPoint
    • Events
    • Conditions
    • Actions
      • Special Effect - Create a special effect at SFX_Loc using SFX_StringPath
      • Unit - Create 1 SFX_Dummy for (Triggering player) at SFX_Loc facing Default building facing degrees
      • Set SFX_Unit = (Last created unit)
      • Unit - Add a SFX_Duration second Generic expiration timer to SFX_Unit
      • Set SFX = (Last created special effect)
      • Custom script: set udg_SFX_Key = GetHandleId(udg_SFX_Unit)
      • Hashtable - Save Handle OfSFX as 0 of SFX_Key in SFX_Hashtable
      • Unit Group - Add SFX_Unit to SFX_Group
      • Custom script: call RemoveLocation(udg_SFX_Loc)
      • Trigger - Turn on SFX Clear <gen>


  • SFX Clear
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to SFX_Dummy
    • Actions
      • Set SFX_Unit = (Triggering unit)
      • Custom script: set udg_SFX_Key = GetHandleId(udg_SFX_Unit)
      • Set SFX = (Load 0 of SFX_Key in SFX_Hashtable)
      • Special Effect - Destroy SFX
      • Hashtable - Clear all child hashtables of child SFX_Key in SFX_Hashtable
      • Unit Group - Remove SFX_Unit from SFX_Group
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (SFX_Group is empty) Equal to True
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions


CREDITS
- Magtheridon96 > Hashtable SFX destroy
- KnnO > Global variable to Local Variable
- mckill2009 > RemoveLocation() placing


CHANGELOGS
v1.0
- Initial release

v1.1
- Optimized the trigger a bit.

v1.2
- Changed the function name to a proper ones (instead camel-casing).
- call RemoveLocation() is now in correct location.

v1.3
- Removed JASS function
- Uses Hashtable instead TriggerSleepAction
- New instructions


Keywords:
timed, sfx, special effect, defskull, system, duration, ground, unit, magtheridon96.
Contents

Just another Warcraft III map (Map)

Reviews
Moderator
12th Dec 2015 IcemanBo: Too long as NeedsFix. Rejected. 12:28, 17th Jul 2012 Magtheridon96: I see what you did there. The dummy unit method is still not a good idea. :/ Timers bro, timers. <;
  1. 12th Dec 2015
    IcemanBo: Too long as NeedsFix. Rejected.

    12:28, 17th Jul 2012
    Magtheridon96: I see what you did there.
    The dummy unit method is still not a good idea. :/
    Timers bro, timers. <;
     
  2. KnnO

    KnnO

    Joined:
    Sep 18, 2011
    Messages:
    156
    Resources:
    3
    Icons:
    1
    Maps:
    1
    Spells:
    1
    Resources:
    3
    Nice, simple and useful system.

    local effect udg_SFX
    ?
    local and udg (user-defined global) ?
    [​IMG]
    Suggestions:
    • Make the functions' prefix letter uppercased: (sfxGround -> SfxGround)
    • Or even make the name EffectGround (because it comes in mind first to users)
    • Make alternate function names such as:
      Code (vJASS):

      function SpecialEffectGround takes nothing returns nothing
      call sfxGround()
      endfunction

      function EffectGround takes nothing returns nothing
      call sfxGround()
      endfunction
       
     
  3. defskull

    defskull

    Joined:
    Mar 27, 2008
    Messages:
    7,978
    Resources:
    17
    Spells:
    17
    Resources:
    17
    Thanks :)

    Yes, you can turn a global variable into local variable
    Actually, in the start, I'm planning to make my work easier by making global variable into local, I can still use GUI function to refer to that SFX variable, but since I'm using scripting all the way, I forgot to change it pure local variable, I had uploaded a new version, fixed that.

    I used a camel-casing, it's one of the style of writing in programming language, don't know for you, for me, it's easy to read.

    sfxGround and sfxUnit is pretty understandable to me :)
    Will consider of changing the functions' name to a more appropriate one :)
     
  4. KnnO

    KnnO

    Joined:
    Sep 18, 2011
    Messages:
    156
    Resources:
    3
    Icons:
    1
    Maps:
    1
    Spells:
    1
    Resources:
    3
    Oh, I was testing that, yes until if you used it in GUI, so that is why I though why not use another var name.
    It doesn't matter, but just to be the same style for Jass writing.
    Yes for me too :p but it is used in Jass as effect, however adding alternatives is enough.
     
  5. coolyoshi1

    coolyoshi1

    Joined:
    Dec 6, 2009
    Messages:
    170
    Resources:
    2
    Maps:
    1
    Spells:
    1
    Resources:
    2
    This is a great idea but I think you should also add option of changing size of the sfx
     
  6. defskull

    defskull

    Joined:
    Mar 27, 2008
    Messages:
    7,978
    Resources:
    17
    Spells:
    17
    Resources:
    17
    SFX size can't be changed, people use Units to act as "SFX", because basically unit's size can be changed either in Object Editor or via triggers.
     
  7. Magtheridon96

    Magtheridon96

    Joined:
    Dec 12, 2008
    Messages:
    6,006
    Resources:
    26
    Maps:
    1
    Spells:
    8
    Tutorials:
    7
    JASS:
    10
    Resources:
    26
    Camel-case should be used for variables names and struct members only. (There could be some other cases that I'm forgetting)

    FunctionNamesShouldBeWrittenLikeThis :3
     
  8. KnnO

    KnnO

    Joined:
    Sep 18, 2011
    Messages:
    156
    Resources:
    3
    Icons:
    1
    Maps:
    1
    Spells:
    1
    Resources:
    3
    :thumbs_up:
    Exactly, that is how you do it. besides GUIers would use

    DestroyGroup ()
    DestroyForce ()
    RemoveLocation ()
    and then...
    sfxGround :eekani:
     
  9. zv27

    zv27

    Joined:
    Aug 21, 2010
    Messages:
    295
    Resources:
    0
    Resources:
    0
    1.
    I do not understand why do you use TriggerSleppAction and not a timer.

    2. The most important thing:
    This system does not support stacking,non-stacking effect.
     
  10. mckill2009

    mckill2009

    Joined:
    Mar 10, 2009
    Messages:
    4,696
    Resources:
    34
    Maps:
    5
    Spells:
    27
    JASS:
    2
    Resources:
    34
    Since you're using jass, better is;
    Code (vJASS):

    function sfxGround takes string sfx, location loc, real dur returns nothing
       local effect SFX = AddSpecialEffectLoc(sfx, loc)
       call TriggerSleepAction(dur)
       call DestroyEffect(SFX)
       call RemoveLocation(loc)
       set SFX = null
    endfunction

    function sfxUnit takes string sfx, unit u, string ap, real dur returns nothing
       local effect SFX = AddSpecialEffectTarget(sfx, u, ap)
       call TriggerSleepAction(dur)
       call DestroyEffect(SFX)
       set SFX = null
    endfunction
     


    How to call?
    • Custom script: call sfxGround(What SFX would you like ?, Where do you want to spawn ?, How long you want it ?)


    Why so many arguments?
    - Coz some users would preffer direct creation than storing it to a global/locals first...

    your call RemoveLocation(udg_SFX_Loc) should be in the sfxGround btw...
     
  11. defskull

    defskull

    Joined:
    Mar 27, 2008
    Messages:
    7,978
    Resources:
    17
    Spells:
    17
    Resources:
    17
    @Mag and KnnO
    Alright, alright I change the function name :(
    [​IMG]

    It is MUI enough to me, also, I'm not used to JASS and stuffs, I'll try to learn to use timers in later future.

    What do you mean it does not support stacking ?
    Try cast it multiple times on a single unit, all those SFX gets removed with their own duration.

    Are you telling me that some user prefer to use local variable instead, creating a global variable ?
    That would make his variable list, not grows ?
    Yes I agree with that, but that will make it harder for those people who don't know to call native function such GetSpellTargetLoc() or even GetTriggerUnit().

    Plus, it will make the user's job easier by setting the variable via GUI function (this system is in favor of GUI user since I used some kind of unefficient method of JASS)

    But I will take your consideration, I'll try to put a list for all native function they should call in the documentations.

    Haha fixed that :)

    New version uploaded with some minor changes.
     
  12. mckill2009

    mckill2009

    Joined:
    Mar 10, 2009
    Messages:
    4,696
    Resources:
    34
    Maps:
    5
    Spells:
    27
    JASS:
    2
    Resources:
    34
    no, I said direct creation such as;
    • Custom script: call sfxGround("string", Loc, "5.0")

    OR
    • Set udg_SFX_String = What SFX would you like ?
    • Set udg_SFX_Duration = How long you want it ?
    • Set udg_SFX_Loc = Where do you want to spawn ?
    • Custom script: call sfxGround(udg_SFX_String,udg_SFX_Loc, udg_SFX_Duration)

    so the option for them not to create those globals/locals...

    I forgot to tell you but correct me if Im wrong that TriggerSleepAction doesnt stop if Game is paused
    so your SFX may end prematurely coz of that...better to use a Timer...
     
  13. defskull

    defskull

    Joined:
    Mar 27, 2008
    Messages:
    7,978
    Resources:
    17
    Spells:
    17
    Resources:
    17
    That's why I said the user must know native function in order to call either Location or Unit.
    You see, the Loc is definitely a local variable, right ? Since it has no prefix of udg_.
    Okay now, where does Loc comes from ?
    Surely we must set it first, right ?
    In GUI, it's easy just;
    • Set udg_Loc = (Target point of ability being cast)


    But everything in JASS is different (the user must memorize the syntax);
    • Custom script: local location Loc = GetSpellTargetLoc()


    You see ?
    The user has to memorize the GetSpellTargetLoc and many other native function.
    It's both same thing but the execution to set the variable is totally different, I just make it easy for GUI user (just because they have to memorize the syntax, it's hard for them)

    But then again, I might have change this to local variable and will include a full list of all possible native functions that they want to call.

    Btw;
    Haha duration is not string dude >.>" (I know you must have mistyped it)

    I have tested it in LAN game where you have the ability to Pause a game;
    1. I casted in on Ground
    2. Directly pause the game (for 10 seconds)
    3. Unpause the game and SFX seems not to be destroyed and wait for another 5 seconds (SFX_Duration) to destroy

    TriggerSleepAction does obey the Game Pause.
     
  14. KnnO

    KnnO

    Joined:
    Sep 18, 2011
    Messages:
    156
    Resources:
    3
    Icons:
    1
    Maps:
    1
    Spells:
    1
    Resources:
    3
    Ok, so best solution is to make more alternative functions for advanced users :D
    EffectGroundExt ( string , loc , duration )

    (Ext = Extended)
     
  15. mckill2009

    mckill2009

    Joined:
    Mar 10, 2009
    Messages:
    4,696
    Resources:
    34
    Maps:
    5
    Spells:
    27
    JASS:
    2
    Resources:
    34
    from this "Set udg_Loc = (Target point of ability being cast)"...I forgot the udg_ as well :)...
    anyway its just my suggestion to make your function more dynamic...

    @KnnO
    that will confuse the new user even more so no need for that...
     
  16. defskull

    defskull

    Joined:
    Mar 27, 2008
    Messages:
    7,978
    Resources:
    17
    Spells:
    17
    Resources:
    17
    You see;
    My Way
    • Actions
      • Set SFX_String = Abilities\Spells\Other\AcidBomb\BottleImpact.mdl
      • Set SFX_Loc = (Target point of ability being cast)
      • Set SFX_Duration = 5.00
      • Custom script: call SfxGround()


    Code (vJASS):
    function SfxGround takes nothing returns nothing
       local effect SFX = AddSpecialEffectLoc(udg_SFX_String, udg_SFX_Loc)
       call RemoveLocation(udg_SFX_Loc)
       call TriggerSleepAction(udg_SFX_Duration)
       call DestroyEffect(SFX)
       set SFX = null
    endfunction


    Your Way
    • Actions
      • Set SFX_String = Abilities\Spells\Other\AcidBomb\BottleImpact.mdl
      • Set SFX_Loc = (Target point of ability being cast)
      • Set SFX_Duration = 5.00
      • Custom script: call SfxGround(udg_SFX_String, udg_SFX_Loc, udg_SFX_Duration)


    Code (vJASS):
    function SfxGround takes string whichString, location whichLocation, real whichDuration returns nothing
       local effect SFX = AddSpecialEffectLoc(udg_SFX_String, udg_SFX_Loc)
       call RemoveLocation(udg_SFX_Loc)
       call TriggerSleepAction(udg_SFX_Duration)
       call DestroyEffect(SFX)
       set SFX = null
    endfunction


    Both of these method works the same, even if you don't include the parameters inside the function, it still execute the right action because all the action is considered inside the function itself, not depends on parameters.

    Because, the value in the custom function will refer to global/local variable that we have set, so basically, adding/removing parameter(s) to a custom function does not really affect anything.

    But then again, this will reduce the amount of global variable ?
    But then again (one more time...), will be hard for new user, that's why he propose to make an advance function but I think I'll stick to this my current method first.
     
  17. Magtheridon96

    Magtheridon96

    Joined:
    Dec 12, 2008
    Messages:
    6,006
    Resources:
    26
    Maps:
    1
    Spells:
    8
    Tutorials:
    7
    JASS:
    10
    Resources:
    26
    You know you're awesome when people start using your username as a Keyword :D
     
  18. defskull

    defskull

    Joined:
    Mar 27, 2008
    Messages:
    7,978
    Resources:
    17
    Spells:
    17
    Resources:
    17
    I've put my name there because some people, wants to just find out what resources that I have created so that when they go to Spells Section, they just type out my name and there you go, list of my resources.
    Also, I've usually put others' username in keywords/tags for credits.
     
  19. Magtheridon96

    Magtheridon96

    Joined:
    Dec 12, 2008
    Messages:
    6,006
    Resources:
    26
    Maps:
    1
    Spells:
    8
    Tutorials:
    7
    JASS:
    10
    Resources:
    26
    I usually just put Nestharus and Bribe's names in there so I could get more downloads :p