• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Pristimatic Shift v1.4

Prestimatic%20Shift%20Cover%20Photo.jpg

Prestimatic Shift

Your chaotic energy teleports and stuns enemies away when they strike you.


Level 1 - 15% chance.
Level 2 - 20% chance
Level 3 - 25% chance
Level 4 - 30% chance

Trigger:
  • PR
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- CONFIGURING --------
      • Set PR_Ability = PristmaticRift
      • Set PR_Buff = Prismatic Rift
      • Set PR_SFX = Abilities\Spells\Human\StormBolt\StormBoltMissile.mdl
      • Set PR_Percentage[1] = 15.00
      • Set PR_Percentage[2] = 20.00
      • Set PR_Percentage[3] = 25.00
      • Set PR_Percentage[4] = 30.00
      • -------- CORE --------
      • Custom script: set udg_PR_Loop = 0.03125
      • Trigger - Add to Prismatic Rift Loop <gen> the event (Time - Every PR_Loop seconds of game time)
      • -------- REDUCE MEMORY LEAK --------
      • Custom script: call DestroyTrigger( GetTriggeringTrigger())
  • Prismatic Rift Cast
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Triggering unit) has buff PR_Buff) Equal to True
      • ((Triggering unit) is an illusion) Equal to False
      • ((Unit-type of (Attacking unit)) is A ranged attacker) Equal to False
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random percentage) Less than or equal to PR_Percentage[(Level of PR_Ability for (Triggering unit))]
        • Then - Actions
          • Set maxIndexKnockback = (maxIndexKnockback + 1)
          • Set tempPoint1 = (Position of (Triggering unit))
          • Set tempPoint2 = (Position of (Attacking unit))
          • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at tempPoint1 facing Default building facing degrees
          • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
          • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Attacking unit)
          • Set Knockback_Angle[maxIndexKnockback] = (Angle from tempPoint1 to tempPoint2)
          • Set Knockback_Distance[maxIndexKnockback] = 25
          • Set Knockback_UnitTarget[maxIndexKnockback] = (Attacking unit)
          • Special Effect - Create a special effect at tempPoint1 using PR_SFX
          • Special Effect - Destroy (Last created special effect)
          • Custom script: call RemoveLocation( udg_tempPoint1)
          • Custom script: call RemoveLocation( udg_tempPoint2)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • maxIndexKnockback Equal to 1
            • Then - Actions
              • Trigger - Turn on Prismatic Rift Loop <gen>
            • Else - Actions
        • Else - Actions
  • Prismatic Rift Loop
    • Events
    • Conditions
    • Actions
      • For each (Integer tempInt) from 1 to maxIndexKnockback, do (Actions)
        • Loop - Actions
          • Set tempPoint1 = (Position of Knockback_UnitTarget[tempInt])
          • Set tempPoint2 = (tempPoint1 offset by (Real(Knockback_Distance[tempInt])) towards Knockback_Angle[tempInt] degrees)
          • Unit - Move Knockback_UnitTarget[tempInt] instantly to tempPoint2
          • Custom script: call RemoveLocation( udg_tempPoint1)
          • Custom script: call RemoveLocation( udg_tempPoint2)
          • Set Knockback_Distance[tempInt] = (Knockback_Distance[tempInt] - 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Knockback_Distance[tempInt] Equal to 0
            • Then - Actions
              • Set Knockback_Angle[tempInt] = Knockback_Angle[maxIndexKnockback]
              • Set Knockback_Distance[tempInt] = Knockback_Distance[maxIndexKnockback]
              • Set Knockback_UnitTarget[tempInt] = Knockback_UnitTarget[maxIndexKnockback]
              • Set Knockback_UnitTarget[maxIndexKnockback] = No unit
              • Set maxIndexKnockback = (maxIndexKnockback - 1)
              • Set tempInt = (tempInt - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • maxIndexKnockback Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions



Changelog:
v1.1 :
Dummy - Hide Mini map Display has been set to true
Dummy - Has been set to Cant Raise, Does not Decay
Removed "And from the main condition"
v1.2
-De-Index Fixed
v1.2b
Changed Attacked unit to Triggering unit
v1.3
-100% Fixed De-Index by deathismyfriend
v1.4
-Dummy fixed,
-Added comments for triggering
-Remade special effects
-Improved triggering by AKA.GywGod133
Old Trigger:
  • Prismatic Rift Cast
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Triggering unit) has buff Prismatic Rift ) Equal to True
      • ((Triggering unit) is an illusion) Equal to False
      • ((Unit-type of (Attacking unit)) is A ranged attacker) Equal to False
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 100) Less than or equal to (10 + (5 x (Level of PristmaticRift for (Triggering unit))))
        • Then - Actions
          • Set maxIndexKnockback = (maxIndexKnockback + 1)
          • Set tempPoint1 = (Position of (Triggering unit))
          • Set tempPoint2 = (Position of (Attacking unit))
          • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at tempPoint1 facing Default building facing degrees
          • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
          • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Attacking unit)
          • Set Knockback_Angle[maxIndexKnockback] = (Angle from tempPoint1 to tempPoint2)
          • Custom script: call RemoveLocation( udg_tempPoint1)
          • Custom script: call RemoveLocation( udg_tempPoint2)
          • Set Knockback_Distance[maxIndexKnockback] = 25
          • Set Knockback_UnitTarget[maxIndexKnockback] = (Attacking unit)
          • Set effectKnockback = Abilities\Weapons\Bolt\BoltImpact.mdl
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • maxIndexKnockback Equal to 1
            • Then - Actions
              • Trigger - Turn on Prismatic Rift Loop <gen>
            • Else - Actions
        • Else - Actions
  • Prismatic Rift Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer tempInt) from 1 to maxIndexKnockback, do (Actions)
        • Loop - Actions
          • Set tempPoint1 = (Position of Knockback_UnitTarget[tempInt])
          • Set tempPoint2 = (tempPoint1 offset by (Real(Knockback_Distance[tempInt])) towards Knockback_Angle[tempInt] degrees)
          • Unit - Move Knockback_UnitTarget[tempInt] instantly to tempPoint2
          • Special Effect - Create a special effect at tempPoint2 using effectKnockback
          • Special Effect - Destroy (Last created special effect)
          • Custom script: call RemoveLocation( udg_tempPoint1)
          • Custom script: call RemoveLocation( udg_tempPoint2)
          • Set Knockback_Distance[tempInt] = (Knockback_Distance[tempInt] - 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Knockback_Distance[tempInt] Equal to 0
            • Then - Actions
              • Set Knockback_Angle[tempInt] = Knockback_Angle[maxIndexKnockback]
              • Set Knockback_Distance[tempInt] = Knockback_Distance[maxIndexKnockback]
              • Set Knockback_UnitTarget[tempInt] = Knockback_UnitTarget[maxIndexKnockback]
              • Set Knockback_UnitTarget[maxIndexKnockback] = No unit
              • Set maxIndexKnockback = (maxIndexKnockback - 1)
              • Set tempInt = (tempInt - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • maxIndexKnockback Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions



Credits:
Special Thanks to :

-AKA.GywGod133 for improving the triggers!
-deathismyfriend for fixing the de-index!
-xorkatoss for teaching me MUI!
-Torchlight II Idea



Keywords:
Counter,Anti Melee Hitter, Soft Armor Wizards,
Contents

Prismatic Shift (Map)

Reviews
Pristimatic Shift v1.3 | Reviewed by Maker | 28th May 2013 APPROVED The ability is MUI and leakless with good tooltip [tr] The dummy has build ability, uses upgrades and gives vision Use a knockback system or improve...

Moderator

M

Moderator


Pristimatic Shift v1.3 | Reviewed by Maker | 28th May 2013
APPROVED


126248-albums6177-picture66521.png


  • The ability is MUI and leakless with good tooltip
126248-albums6177-picture66523.png


  • The dummy has build ability, uses upgrades and gives vision
  • Use a knockback system or improve your knockback for smoother effect
  • Add importing instructions into the map
  • You spam special effects
[tr]
 
@xorkatoss: actually, he have some attacked unit used

  • ((Attacked unit) has buff Prismatic Rift ) Equal to True
  • ((Attacked unit) is an illusion) Equal to False
triggering unit is better, its faster and safer...

your deindexing isn't good yet... you need to learn how to do dynamic index recycling... because right now you would still loop thru the unused indexes (at least up to the boolean check at top)... with dynamic index recycling, you won't do that...

Also, three different variables are better than the array for MUI[1,2,3]... arrays take more memory and is slower than variables... since you only used three indexes for the MUI array, its better to just use three different variables...
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
its not used for anything atm look at how he does it. yes it reduces but he never de-indexes anything until all instances are over. He doesnt need it if he de-indexes the proper way. Also looping through all of the unused indexing is a waste of processing, and very inefficient. You should only need one integer to do ur indexing. The one u use in the loop should be a tempInt rather than making another unneeded variable.
 
Last edited:
Level 8
Joined
Jun 17, 2012
Messages
114
A Wise man once told me,

In theory
MUI2 = 0 is faster
cause if you do MUI2 = MUI1
first it looks for MUI1
finds that it's 0 and then does the MUI2 = 0
so MUI 2 = 0 is instant
MUI 2 = MUI 1 = Get MUI 1 Integer then MUI 2 = 0
probably not even 0.01 seconds faster
but it's faster!

So I believe him :D
 
Read deathismyfriends tutorial or try to find Hanky's Recycling Index template...

Using the Dynamic recycling indexing method makes your system more efficient because it avoids your system to loop thru already unused indexes, and allows already unused indexes to be reused right away...

Your current method still loops thru all indexes, checks if its used then performs actions. Then you only free up the indexes once the count reaches 0... These two makes the system not good...

Also, as I said, multiple variables are better to use than an array with just 2 or 3 used indexes because arrays are slower than single variables.
 
Level 20
Joined
Aug 13, 2013
Messages
1,696
Review


Pristimatic Shift v1.3
This spell had been reviewed by jakeZinc
http://www.hiveworkshop.com/forums/members/jakezinc/#visitor_messaging

Trigger Code
The triggering looks good and short.
  • Set tempPoint1 = (Position of (Triggering unit))
  • Set tempPoint2 = (Position of (Attacking unit))
Store triggering unit and attacking unit to a unit variable. Use TriggeringPlayer instead of GetOwningPlayer() in here:
  • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at tempPoint1 facing Default building facing degrees
.
  • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
  • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Attacking unit)
store the last created unit in the variable because you use it many times. Other than that none.
Documentation
There's no any documentation in the trigger :////
Configuration
There's no configuration, the user can harm the code, put the values in the another trigger "configuration".
Pros
It is MUI and leakless.
Cons
None.
Importing Instruction
There's no importing instruction
Special Effects
The special effects are spammed and it is lacking.
Usefulness
Useful knockbacking the attacking enemies.
Suggestions
The dummy unit must have 0.00 collision size and has a flying movement type. The dummy must have a low sight of radius because it gives high sight. The dummy unit must not have a locust ability and can't attack enemy units. Don't give ability to the dummy units, add it on the trigger. The dummy must not have a build ability.
Description Tooltip
Tooltip is very good!.

jakeZinc Score Board
Rejected: 1-10
Unacceptable : 11-30
Lacking : 31-49
Useful : 50-69
Recommended : 70-90
Highly Recommended : 91-100
Director Cut : 101-105
Scores
1) Triggering - 17/20
2) Documentation - 0/10
3) Importing Instruction - 0/10
4) Special Effects - 6/15
5) Usefulness - 16/20
6) Tooltip - 9/10
7) Configuration - 0/10
Ratings
Total Score - 48/105
jakeZinc Rating - 2.1/5
Status - Lacking
 
Top