1. Melee Mapping contest #3 - Poll is up! Vote for the best 4v4 melee maps!
    Dismiss Notice
  2. The 30th edition of the Modeling Contest is finally up! The Portable Buildings need your attention, so come along and have a blast!
    Dismiss Notice
  3. We have a new contest going on right now! Join the 11th Music Contest! You are to make a Cinematic modern sound-track for this contest, so come and compete with other people for fun.
    Dismiss Notice

[vJASS] Particle

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

  1. Almia

    Almia

    Joined:
    Apr 24, 2012
    Messages:
    4,839
    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:
    5,821
    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,839
    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:
    621
    Resources:
    2
    Maps:
    2
    Resources:
    2
    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,839
    Resources:
    35
    Spells:
    30
    Tutorials:
    4
    JASS:
    1
    Resources:
    35
    absolute and relative in what context?
     
  6. Wareditor

    Wareditor

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

    Almia

    Joined:
    Apr 24, 2012
    Messages:
    4,839
    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:
    621
    Resources:
    2
    Maps:
    2
    Resources:
    2
    Try the script maybe?
     
  9. Almia

    Almia

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