1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. The long-awaited results for Concept Art Contest #11 have finally been released!
    Dismiss Notice
  3. Join Texturing Contest #30 now in a legendary battle of mythological creatures!
    Dismiss Notice
  4. The Aftermath has been revealed for the 19th Terraining Contest! Be sure to check out the Results and see what came out of it.
    Dismiss Notice
  5. Melee Mapping Contest #3 - Results are out! Congratulate the winners and check plenty of new 4v4 melee maps designed for this competition!
    Dismiss Notice
  6. The winners of our cinematic soundtrack competition have been decided! Step by the Music Contest #11 - Results to check the entries and congratulate the winners!
    Dismiss Notice
  7. Check out the Staff job openings thread.
    Dismiss Notice

Illusion Editor v1.5c [vJass + GUI Support]

Submitted by AGD
This bundle is marked as approved. It works and satisfies the submission rules.
Illusion Editor v1.5c




This system provides users with helpful utilities with regards to creation of illusions as well as the manipulation of their stats dynamically.
With this system, you can now create illusions of any type as easily as creating units.
Read the code documentation for more details.


System features:
- Specific illusion type creation
- Unit based illusion creation
- Dynamic illusion timed life
- Dynamic illusion damage dealt/received factor
- Dynamic illusion death special effect
- + A GUI Support


Credits:
- Looking_For_Help (DamageEvent)
- Vexorian [TimerUtils]
- Bribe ([Table)
- Flux (DummyRecycler)
- Nestharus (Alloc)


Click the "Preview Triggers" button below to preview the system and the sample spells' codes.


Changelogs
v1.5c
- Fixed a bug regarding the value returned by the illusions' duration and elapsed time
- Added a new method/function for retrieving the dying illusion inside an illusion death event
- Added 2 additional demo spells using this system namely Soul Drain & Replicate
- Updated the required libraries
- Optimized some parts of the code
- Other changes

v1.5b
- Fixed a bug regarding permanent illusions' elapsed time returning 0
- Fixed a bug regarding building illusions playing its birth animation
- Removed optional library AllocFast
- Other changes

v1.5
- Recoded the entire system
- Now uses struct
- Updated the dependencies
- Updated the documentation and the GUI Support
- Removed some features from the previous versions like the ability to set an illusion's level
- Other changes

v1.4
- Dummycaster is now given the illusion ability directly instead of an item with the same ability
- Made Table an optional requirement
- Fixed an error in the function SetIllusionLevel()
- Fixed an error on triggerregistration when RegisterPlayerUnitEvent is not found
- Other changes

v1.3c
- Updated the GUI IllusionEditor Documentation
- Updated the IllusionEditor GUI Support to include the functionalities of the GetIllusionBaseUnit(), GetIllusionElapsedTime(), and the IllusionDeathEvent
- Restructured the Operate() function of the IllusionEditor GUI Support for an even execution speed by replacing the long elseif chains with a separate trigger for each operation.
- Fixed a bug on the previous version where the targetorders to the illusions are not cached properly due to unitindex key of the hash not being flushed during
- Fixed the error regarding an illusion death event firing during illusion replacement
- Other changes

v1.3b
- Fixed the errors on the functions that gets the illusions' duration aspects
- Added a new API GetIllusionBaseUnit() for getting the unit origin of the product illusions of CopyUnit()
- Removed the hook for DoNothing(), instead, the GUI Support now uses [Trigger - Run <trig> ignoring conditions]
- replaced breaks with exitwhen true for vexorian jasshelper compatibility
- Some other changes

v1.3
- Added a new API GetIllusionElapsedTime() for getting the elapsed time of an illusion
- Shortened the function AdjustTimedLife
- Removed the unnecessary return values when in debug mode in the public functions
- Other changes

v1.2c
- Updated some documentations
- Added some optional library requirements including TimerUtils, GroupUtils, PlayerUtils
- Simplified some script sections
- Added the API for registering an illusion death event
- Fixed a bug in the previous version where illusions' death effect visibility are not properly managed
- Updated the demo spell
- Some other code restructuring and some other fixes

v1.2b
- Not Uploaded

v1.2
- Added a GUI support together with its guide and documentation
- Fixed the bug regarding GetLastIllusion returning the replacement illusion in cases where an illusions time needs to be extended
- Now uses a module initializer instead of a struct initializer
- Simplified many of the nested if statements by using the conjunction and on their condition
- Other fixes and changes

v1.1c
- Fixed the bug regarding the dummy item being created at the map center on map Init
- Small changes

v1.1b
- Placed the system initializer inside a struct initializer instead of a library initializer
- Replaced Bribe's Damage Engine with PDDS by Looking_For_Help
- Replaced Bribe's Unit Indexer with TriggerHappy's UnitDex
- Only uses 1 dummy caster for the system instead of 1 per illusion creation
- Only uses 1 item instead of 1 per illusion creation
- Added Table to the library requirement
- Changed the API naming
- Some minor code restructuring
- Small fixes
- Other changes

v1.1
- Added debug messages for debug mode
- Made some of the API functions to return boolean value depending on the success of the operation
- Added UnitIndexerGUI library to the requirement
- Added an API for users to put the functions they want to run when the system initializes, like creating an illusion at system initialization for example.
- Other minor changes

v1.0c
- Some fixes
- Some code restructuring
- Added more function/APIs

v1.0b
- Not uploaded

v1.0
- First Upload
Contents

Illusion Editor v1.5c (Map)

Reviews
KILLCIDE
I was a little hesitant to approve this given there was a similar one in the JASS section, but I guess its nice to have both. An advantage this one has is the GUI-friendly interface you implemented. The available configurability you added for each...
  1. Flux

    Flux

    Joined:
    Feb 6, 2014
    Messages:
    2,334
    Resources:
    28
    Maps:
    1
    Spells:
    19
    Tutorials:
    2
    JASS:
    6
    Resources:
    28
  2. AGD

    AGD

    JASS Reviewer

    Joined:
    Mar 29, 2016
    Messages:
    396
    Resources:
    13
    Spells:
    7
    Tutorials:
    1
    JASS:
    5
    Resources:
    13
    Well, this one includes some things not included in the snippet.
    Aside from making an illusion based on an existing unit on the map, his system allows you to create an illusion where you only have to specify the unit type of the illusion you're going to create.
    This system also allows you to create permanent illusions by setting the duration to 0. And of course theres more. They are written at the start of the main script.

    EDIT: So i missed your question :D, well the concept of the two are different.
     
    Last edited: Jul 15, 2016
  3. KILLCIDE

    KILLCIDE

    Administrator

    Joined:
    Jul 22, 2015
    Messages:
    3,479
    Resources:
    20
    Models:
    2
    Icons:
    10
    Spells:
    7
    Tutorials:
    1
    Resources:
    20
    I fail to see any difference from your system and Flux's other than you allow the use of unittype creation. I'm hoping another mod / reviewer can do this one for me since I'm not really in the mood to compare two systems against one another. I do recommend taking a look at Bribe's vJass plugin for his Unit Indexer. It will reduce a nice amount of the local declarations you have in some functions. Have you also maybe considered looking into structs?
     
  4. AGD

    AGD

    JASS Reviewer

    Joined:
    Mar 29, 2016
    Messages:
    396
    Resources:
    13
    Spells:
    7
    Tutorials:
    1
    JASS:
    5
    Resources:
    13
    I'm not yet confident in using structs, I will use it for public releases when I see that I can already handle it properly.

    EDIT:
    Bump
    Updated to version 1.1b
    Code (Text):

    - Placed the system initializer inside a struct initializer instead of a library initializer
    - Replaced Bribe's Damage Engine with PDDS by Looking_For_Help
    - Replaced Bribe's Unit Indexer with TriggerHappy's UnitDex
    - Only uses 1 dummy caster for the system instead of 1 per illusion creation
    - Only uses 1 item instead of 1 per illusion creation
    - Added Table to the library requirement
    - Changed the API naming
    - Some minor code restructuring
    - Small fixes
    - Other changes
     

    EDIT:
    Updated to version 1.2
    Code (Text):

    - Added a GUI support together with its guide and documentation
    - Fixed the bug regarding GetLastIllusion returning the replacement illusion in cases where an illusions time needs to be extended
    - Now uses a module initializer instead of a struct initializer
    - Simplified many of the nested if statements by using the conjunction "and" on their condition
    - Other fixes and changes
     
    Bump?
     
    Last edited: Sep 9, 2016
  5. jakeZinc

    jakeZinc

    Joined:
    Aug 13, 2013
    Messages:
    1,366
    Resources:
    20
    Spells:
    20
    Resources:
    20
    Code (vJASS):

    call KillUnit( u )
    call RemoveUnit( u )
     

    ^ Why you need to merge the two?
    I think you only need one of them or just remove the kill func.

    I didnt test the demo map yet, but still based on the features of this system I can say that it is nice to interact with the system and very useful from customizing or manipulating artificial illusions. It also has a GUI support which makes the usage a plus factor.
     
  6. Flux

    Flux

    Joined:
    Feb 6, 2014
    Messages:
    2,334
    Resources:
    28
    Maps:
    1
    Spells:
    19
    Tutorials:
    2
    JASS:
    6
    Resources:
    28
  7. AGD

    AGD

    JASS Reviewer

    Joined:
    Mar 29, 2016
    Messages:
    396
    Resources:
    13
    Spells:
    7
    Tutorials:
    1
    JASS:
    5
    Resources:
    13
    Right. I will remove that next update

    Honestly I don't know that there is that already. Anyway, it's also good for users to have more utilities for illusions that isn't included there ^.

    Updated to v1.2c
    Code (Text):
    - Updated some documentations
    - Added some optional library requirements including TimerUtils, GroupUtils, PlayerUtils
    - Simplified some script sections
    - Added the API for registering an illusion death event
    - Fixed a bug in the previous version where illusions' death effect visibility are not properly managed
    - Updated the demo spell
    - Some other code restructuring and some other fixes
    Updated to v1.3
    Code (Text):

    - Added a new API GetIllusionElapsedTime() for getting the elapsed time of an illusion
    - Shortened the function AdjustTimedLife
    - Removed the unnecessary return values when in debug mode in the public functions
    - Other changes
     
    It's been almost two months and still no reviews :(
     
    Last edited: Sep 9, 2016
  8. IcemanBo

    IcemanBo

    Joined:
    Sep 6, 2013
    Messages:
    5,993
    Resources:
    22
    Maps:
    3
    Spells:
    11
    Template:
    1
    Tutorials:
    4
    JASS:
    3
    Resources:
    22
    It seems visualy counter intuitive to use constant duration loops that do not actually display the remaining duration of an illusion.
    I know that blizzard doesn't provide proper natives, but maybe it should just not be supported then, to have dynamic durations.

    Nice that alatering the death effect is supported.

    Cohader's
    break
    is used, but the script should be compileable on Vexorian's JassHelper.

    Don't do this:

    hook DoNothing Operate


    Run a registration trigger for example, it also can be achieved easily with GUI.

    structs could be a win in this case I believe, but I read your reply on it above. So maybe it's okay for now.

    Code (vJASS):

    */function IllusionDeathEvent takes code c returns nothing/*
            - Adds a code to run when an illusion created from this system dies

    ^Does the user has access to the original unit of which the illusion was made in this death function?
    Maybe there can be a "GetIllusionOrigin" function or so which returns the original unit of the illusion.
    User might use it always, but also onDeath function it was useful.

    I am not sure if there needs to be two seperate functions, CreateIllusion and Copy.
    An illusion makes only sense if it also mimics everything else, like health/items/...
    So using an Illusion which has full HP makes no sense if the original unit has only half of the HP, for example.
    I suggest to make just an original unit as a requirement, instead of using only a general "base id" in CreateIllusion.

    Idk if I did something wrong or changed something accidently, but this:
    call CreateIllusion(Player(0), 'Hpal', 2, 0, 0, 0, 0, 0)
    does not create the illusion for player red for me. ;o Could you test this maybe? Also the duration seemed wrong.


    Goot attempt so far!
     
  9. AGD

    AGD

    JASS Reviewer

    Joined:
    Mar 29, 2016
    Messages:
    396
    Resources:
    13
    Spells:
    7
    Tutorials:
    1
    JASS:
    5
    Resources:
    13
    I don't understand yet, could you elaborate =)

    I didn't know it isn't compileable with Vex's, will change that.

    Will change it

    No, hmm useful feature so I'll add it.

    It just came to my thought that some might make a map/game only composed of illusions :D. Anyway, I think its also useful to have this option and I can also imagine it being used in a spell.

    I just tested it and it works fine, it created an illusion for me for 2 seconds.


    Maybe Ill update this tomorrow =)
     
  10. IcemanBo

    IcemanBo

    Joined:
    Sep 6, 2013
    Messages:
    5,993
    Resources:
    22
    Maps:
    3
    Spells:
    11
    Template:
    1
    Tutorials:
    4
    JASS:
    3
    Resources:
    22
    The time indiction of timed life displays like always wrong values is what I mean, plus, user can set time dynamicly which will not affect it.
     
  11. AGD

    AGD

    JASS Reviewer

    Joined:
    Mar 29, 2016
    Messages:
    396
    Resources:
    13
    Spells:
    7
    Tutorials:
    1
    JASS:
    5
    Resources:
    13
    I see, that's a big defect. Will update this soon.

    Updated to v1.3b:
    - Fixed the errors on the functions that gets the illusions' duration aspects
    - Added a new API GetIllusionBaseUnit() for getting the unit origin of the product illusions of CopyUnit()
    - Removed the hook for DoNothing(), insteadthe GUI Support now uses [Trigger - Run <trig> ignoring conditions]
    - replaced breaks with exitwhen true for vexorian jasshelper compatibility
    - Some other changes

    Updated to v1.3c:
    - Updated the GUI IllusionEditor Documentation
    - Updated the IllusionEditor GUI Support to include the functionalities of the GetIllusionBaseUnit(), GetIllusionElapsedTime(), and the IllusionDeathEvent
    - Restructured the Operate() function of the IllusionEditor GUI Support for an even execution speed by replacing the long elseif chains with a separate trigger for each operation.
    - Fixed a bug on the previous version where the targetorders to the illusions are not cahced properly due to unitindex key of the hash not being flushed during
    - Fixed the error regarding an illusion death event firing during illusion replacement
    - Other changes
     
    Last edited: Sep 12, 2016
  12. AGD

    AGD

    JASS Reviewer

    Joined:
    Mar 29, 2016
    Messages:
    396
    Resources:
    13
    Spells:
    7
    Tutorials:
    1
    JASS:
    5
    Resources:
    13
    @IcemanBo
    Updated to v1.4
    - Dummycaster is now given the illusion ability directly instead of an item with the same ability
    - Made Table an optional requirement
    - Fixed an error in the function SetIllusionLevel()
    - Fixed an error on triggerregistration when RegisterPlayerUnitEvent is not found
    - Other changes
     
    Last edited: Sep 13, 2016
  13. AGD

    AGD

    JASS Reviewer

    Joined:
    Mar 29, 2016
    Messages:
    396
    Resources:
    13
    Spells:
    7
    Tutorials:
    1
    JASS:
    5
    Resources:
    13
    UPDATED to v1.5

    - Recoded the entire system
    - Now uses struct
    - Updated the dependencies
    - Updated the documentation and the GUI Support
    - Removed some features from the previous versions like the ability to set an illusion's level
    - Other changes
     
  14. Trigger.edge

    Trigger.edge

    Joined:
    Jun 21, 2012
    Messages:
    424
    Resources:
    0
    Resources:
    0
    What about if I use
    IsUnitIllusion()
    with this system?
     
  15. AGD

    AGD

    JASS Reviewer

    Joined:
    Mar 29, 2016
    Messages:
    396
    Resources:
    13
    Spells:
    7
    Tutorials:
    1
    JASS:
    5
    Resources:
    13
    It will return true
     
  16. AGD

    AGD

    JASS Reviewer

    Joined:
    Mar 29, 2016
    Messages:
    396
    Resources:
    13
    Spells:
    7
    Tutorials:
    1
    JASS:
    5
    Resources:
    13
    UPDATED to v1.5b

    - Fixed a bug regarding permanent illusions' elapsed time returning 0
    - Fixed a bug regarding building illusions playing its birth animation
    - Removed optional library AllocFast
    - Other changes
     
  17. KILLCIDE

    KILLCIDE

    Administrator

    Joined:
    Jul 22, 2015
    Messages:
    3,479
    Resources:
    20
    Models:
    2
    Icons:
    10
    Spells:
    7
    Tutorials:
    1
    Resources:
    20
    I was a little hesitant to approve this given there was a similar one in the JASS section, but I guess its nice to have both. An advantage this one has is the GUI-friendly interface you implemented. The available configurability you added for each illusion instance is great, and I couldn't find any issues when playing around with the API.

    Needs Fixed

    • Nothing

    Suggestions

    • Nothing

    Status


    Approved
     
  18. Iph

    Iph

    Joined:
    Jul 31, 2016
    Messages:
    38
    Resources:
    0
    Resources:
    0
    Would you consider adding a function to count the illusions the unit has generated and its illusions have generated? I tried adopting the function in the demo but it returned unreliable results to me. Would be nice to distinguish between the original unit's illusion count, its illusions' illusion count, and the total sum of the two.
     
  19. AGD

    AGD

    JASS Reviewer

    Joined:
    Mar 29, 2016
    Messages:
    396
    Resources:
    13
    Spells:
    7
    Tutorials:
    1
    JASS:
    5
    Resources:
    13
    The functionality that you want is a bit very specific, I don't think I would implement that directly in my system. However I can give you a little snippet that do just that if you tell me what it is that you're hoping to achieve.

    EDIT:
    Btw, if you adopted my method in my demo spell correctly, it should work.