1. 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
  2. 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
  3. Travel to distant realms and encounter scenes unknown to the common folk. The Greatest of Adventures is upon us with the 8th Cinematic Contest. Join in on a fun ride.
    Dismiss Notice
  4. The 18th Icon Contest is ON! Choose any ingame unit and give him/her Hero abilities. Good luck to all.
    Dismiss Notice
  5. The Secrets of Warcraft 3 have revealed interesting works. The RESULTS for Abelhawk's Mini-Mapping Contest #15 have come out!
    Dismiss Notice
  6. Contestants are to create a scene set in the Stone Age. Come and see what you can come up with. We wish you the best of luck!
    Dismiss Notice
  7. Colour outside the lines! Techtree Contest #13 is a go. The contest is optionally paired.
    Dismiss Notice
  8. Night Rider gained several songs for his journey. The poll for the 12th Music Contest has started. Check it out!
    Dismiss Notice
  9. Greetings cerebrates, our Swarm needs new spawners that will have numerous children. Join the HIVE's 31st Modeling Contest - Spawners and Spawned! The contest is optionally paired.
    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.

[vJASS] Particle

Discussion in 'Graveyard' started by Almia, Mar 5, 2016.

  1. Almia

    Almia

    Joined:
    Apr 24, 2012
    Messages:
    4,860
    Resources:
    35
    Spells:
    30
    Tutorials:
    4
    JASS:
    1
    Resources:
    35
    Updated.

    Now uses DummyRecycler as a primary dummy source.

    If it the library doesn't exist, the MissleRecycler is used.
     
  2. IcemanBo

    IcemanBo

    Joined:
    Sep 6, 2013
    Messages:
    6,154
    Resources:
    22
    Maps:
    3
    Spells:
    11
    Template:
    1
    Tutorials:
    4
    JASS:
    3
    Resources:
    22
    How about the name "UnitEffect" or so, "Particle" confused me actually a bit and I thought of something like missles or actually had no idea.
    Because it seems that's actually exactly what it is. There are functions to attach an effect to your unit and functions to handle it's apperance.

    Using DummyUnit seems useful. Maybe you might also think of using a unit appearance system. :)
    ____________________

    Was the one by Nestharus approved? How did it work?
    When I think about it and read the code it's all syntax sugar, but the user can do like everything easily by his own if he has access to the dummy unit.
    Wrappers for setting x/y, angle etc are not what should make the system. Though the pitch is certainly good, and auto destroying effects is also nice, but well...

    Could you defend the code's purpose a bit so we can discuss it to make a decission easier? :)

    DummyRecycler is a requirement (not optional) -> no static ifs to execute code.
     
    Last edited: Aug 19, 2016
  3. Almia

    Almia

    Joined:
    Apr 24, 2012
    Messages:
    4,860
    Resources:
    35
    Spells:
    30
    Tutorials:
    4
    JASS:
    1
    Resources:
    35
    Bump

    With the introduction of the new Effect API in 1.29, I have to write a Particle library for my map and decided to share it here and replace the old one that uses MissileRecycler

    May I request someone to send this back to the Submissions Section?
     
  4. Wareditor

    Wareditor

    Joined:
    Jan 16, 2009
    Messages:
    681
    Resources:
    3
    Maps:
    3
    Resources:
    3
    This doesn't work correctly:
    Code (vJASS):
    scope Demo
        private struct Demo extends array
            static Particle effect
            static real r
            static method u takes nothing returns nothing
                set r = r + (bj_PI/4)*0.03125
                if(r > bj_PI*2) then
                    set r = 0.
                endif
                set effect.pitch = r
            endmethod
            static method onInit takes nothing returns nothing
                set effect = Particle.create("units\\human\\Knight\\Knight.mdl", 0, 0, 64.)
                set effect.scale = 5
                set effect.roll = - bj_PI/4
                set r = 0
                call TimerStart(CreateTimer(), 0.03125, true, function thistype.u)
            endmethod
        endstruct
    endscope

    The effect rotations aren't relative like you assumed but absolute.
     
  5. Almia

    Almia

    Joined:
    Apr 24, 2012
    Messages:
    4,860
    Resources:
    35
    Spells:
    30
    Tutorials:
    4
    JASS:
    1
    Resources:
    35
    absolute and relative in what context?
     
  6. Wareditor

    Wareditor

    Joined:
    Jan 16, 2009
    Messages:
    681
    Resources:
    3
    Maps:
    3
    Resources:
    3
    @Almia
    Relative to the model current orientation.
    Absolute to the axis (X,Y,Z).
     
  7. Almia

    Almia

    Joined:
    Apr 24, 2012
    Messages:
    4,860
    Resources:
    35
    Spells:
    30
    Tutorials:
    4
    JASS:
    1
    Resources:
    35
    I still don't see the point where it doesn't work correctly. Regardless of whether it uses object coordinate space or world space.
     
  8. Wareditor

    Wareditor

    Joined:
    Jan 16, 2009
    Messages:
    681
    Resources:
    3
    Maps:
    3
    Resources:
    3
    Try the script maybe?
     
  9. Almia

    Almia

    Joined:
    Apr 24, 2012
    Messages:
    4,860
    Resources:
    35
    Spells:
    30
    Tutorials:
    4
    JASS:
    1
    Resources:
    35
    I'll check it on my spare time, thanks!