• 🏆 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!

[Spell] Problems with this Omnislash spell.

Status
Not open for further replies.
Level 4
Joined
Nov 17, 2015
Messages
91
http://www.hiveworkshop.com/forums/spells-569/omnislash-v1-40-a-161947/?prev=search%3Domnislash%26d%3Dlist%26r%3D20

Hey, beeszbuzz again. Ran into a problem I can't figure out, the spell works perfectly, except after it is finished, my tint on the casting unit is removed. This is a major problem on my current project.

Can you tell me what the problem is, or fix it if possible? Thanks!

(Code of Omnislash below.)
  • Omnislash
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Omnislash
    • Actions
      • -------- Indexing Start --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MUI_1 Equal to 0
        • Then - Actions
          • -------- If there are currently no instances running, we turn on the loop. --------
          • Trigger - Turn on Omnislash Loop <gen>
        • Else - Actions
      • -------- Increase the indexes --------
      • Set MUI_1 = (MUI_1 + 1)
      • -------- End of Indexing --------
      • -------- Start of Dynamic Indexing --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MUI_1 Greater than Max_Index
        • Then - Actions
          • -------- Indexing ~~ --------
          • Set MUI_2[MUI_1] = MUI_1
          • Set Max_Index = MUI_1
        • Else - Actions
      • -------- End of Dynamic Indexing --------
      • -------- Makes it easier to read and cleaner. --------
      • Set Temp = MUI_2[MUI_1]
      • -------- The MUI boolean --------
      • -------- Setting The Caster --------
      • Set CL_Caster[Temp] = (Triggering unit)
      • -------- Setting the Player --------
      • Set CL_Player[Temp] = (Owner of (Triggering unit))
      • -------- Setting the Targeted unit --------
      • Set CL_Target[Temp] = (Target unit of ability being cast)
      • -------- Setting the ability level for the caster --------
      • Set CL_AbilityLevel[Temp] = (Level of Disappearing Jutsu for (Triggering unit))
      • -------- ***Here you can change the number of slashes*** --------
      • Set CL_Slashes[Temp] = (2 + (3 x CL_AbilityLevel[Temp]))
      • -------- ***Here you can change the damage dealt*** --------
      • Set CL_Damage[Temp] = (75 x CL_AbilityLevel[Temp])
      • -------- ***Here you can change the AOE in which the hero teleports*** --------
      • Set CL_AOE[Temp] = 800.00
      • -------- ***Here you can change the effect on the weapon of the hero*** --------
      • Special Effect - Create a special effect attached to the weapon of CL_Caster[Temp] using Abilities\Weapons\PhoenixMissile\Phoenix_Missile.mdl
      • -------- This is used to count the slashes --------
      • Set CL_Count[Temp] = 0
      • -------- *** Change this to "False" if you dont want the targeted unit to get slashed first, instead a random unit near him. --------
      • Set CL_FirstTarget[Temp] = True
      • -------- Storing the effect --------
      • Set CL_Special[Temp] = (Last created special effect)
      • -------- Pausing the Caster --------
      • Unit - Pause CL_Caster[Temp]
      • -------- Adding some vertex coloring and transparency (fade). --------
      • Animation - Change CL_Caster[Temp]'s vertex coloring to (40.00%, 40.00%, 40.00%) with 40.00% transparency
      • -------- Changes animation speed for smooth slashing. --------
      • Animation - Change CL_Caster[Temp]'s animation speed to 200.00% of its original speed
      • -------- --------------------------------------------------------- --------
  • Omnislash Loop
    • Events
      • Time - Every 0.30 seconds of game time
    • Conditions
    • Actions
      • For each (Integer MUI_3) from 1 to MUI_1, do (Actions)
        • Loop - Actions
          • -------- Makes it easier to read and cleaner. --------
          • Set Temp = MUI_2[MUI_3]
          • -------- Counting the number of slashes --------
          • Set CL_Count[Temp] = (CL_Count[Temp] + 1)
          • -------- Setting loc to prevent leak --------
          • Set CL_Loc[1] = (Position of CL_Target[Temp])
          • -------- Setting the group in which the hero warps --------
          • Set CL_Group[1] = (Units within CL_AOE[Temp] of CL_Loc[1] matching ((((Matching unit) is A flying unit) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of CL_Player[Temp]) Equal to True))))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • CL_FirstTarget[Temp] Equal to True
            • Then - Actions
              • -------- Moving hero to target --------
              • Unit - Move CL_Caster[Temp] instantly to CL_Loc[1]
              • -------- Making the hero face the target --------
              • Unit - Make CL_Caster[Temp] face CL_Loc[1] over 0.00 seconds
              • -------- Damaging the target --------
              • Unit - Cause CL_Caster[Temp] to damage CL_Target[Temp], dealing (Real(CL_Damage[Temp])) damage of attack type Normal and damage type Normal
              • -------- Attack animation for eye candy --------
              • Animation - Play CL_Caster[Temp]'s attack animation
              • -------- The "Blink" effect. You may change this. --------
              • Special Effect - Create a special effect attached to the origin of CL_Caster[Temp] using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
              • Special Effect - Destroy (Last created special effect)
              • -------- Setting the boolean to false else the target will get hit the whole time. --------
              • Set CL_FirstTarget[Temp] = False
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (CL_Caster[Temp] is alive) Equal to True
                  • CL_Count[Temp] Less than or equal to CL_Slashes[Temp]
                  • (Number of units in CL_Group[1]) Greater than 0
                • Then - Actions
                  • -------- Setting the next target of the hero --------
                  • Set CL_Victim[Temp] = (Random unit from CL_Group[1])
                  • -------- Setting the loc of the target to prevent leak --------
                  • Set CL_Loc[2] = (Position of CL_Victim[Temp])
                  • Set CL_Loc[3] = (CL_Loc[2] offset by 50.00 towards (Random angle) degrees)
                  • -------- Moving hero to target --------
                  • Unit - Move CL_Caster[Temp] instantly to CL_Loc[3]
                  • -------- Making the hero face the target --------
                  • Unit - Make CL_Caster[Temp] face CL_Loc[2] over 0.00 seconds
                  • -------- Damaging the target --------
                  • Unit - Cause CL_Caster[Temp] to damage CL_Victim[Temp], dealing (Real(CL_Damage[Temp])) damage of attack type Normal and damage type Normal
                  • -------- Attack animation for eye candy --------
                  • Animation - Play CL_Caster[Temp]'s attack animation
                  • -------- The "Blink" effect. You may change this. --------
                  • Special Effect - Create a special effect attached to the origin of CL_Caster[Temp] using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • -------- Removing Point Leaks --------
                  • Custom script: call RemoveLocation( udg_CL_Loc[2] )
                  • Custom script: call RemoveLocation( udg_CL_Loc[3] )
                • Else - Actions
                  • -------- Destroying his weapon effect --------
                  • Special Effect - Destroy CL_Special[Temp]
                  • -------- Unpausing the caster --------
                  • Unit - Unpause CL_Caster[Temp]
                  • -------- Resetting the casters animations --------
                  • Animation - Change CL_Caster[Temp]'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
                  • Animation - Reset CL_Caster[Temp]'s animation
                  • -------- Recycling all the indexes --------
                  • Set MUI_2[MUI_3] = MUI_2[MUI_1]
                  • Set MUI_2[MUI_1] = Temp
                  • Set MUI_1 = (MUI_1 - 1)
                  • Set MUI_3 = (MUI_3 - 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • MUI_1 Equal to 0
                    • Then - Actions
                      • -------- Turning off this trigger. Pointless to keep running --------
                      • Trigger - Turn off (This trigger)
                      • -------- --------------------------------------------------------- --------
                    • Else - Actions
          • -------- Removing Point Leaks --------
          • Custom script: call RemoveLocation( udg_CL_Loc[1] )
          • -------- Removing Group Leak --------
          • Custom script: call DestroyGroup( udg_CL_Group[1] )
 
Level 11
Joined
Jun 2, 2013
Messages
613
  • -------- Adding some vertex coloring and transparency (fade). --------
  • Animation - Change CL_Caster[Temp]'s vertex coloring to (40.00%, 40.00%, 40.00%) with 40.00% transparency
and

  • -------- Resetting the casters animations --------
  • Animation - Change CL_Caster[Temp]'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
 
@Legal_Ease, it is possible, but only with help of a system.
It sucks, because JASS does not provide functions to get the current vertex color of a unit.
So a system needs to keep track of the default vertex color + all changes that are applied,
and then it's possible to know the current vertex color of a unit.

I'm not sure if a approved system currenty exists that does this job exclusivly

this we have here on hive in graveyard, but someone could rewrite it probably:
http://www.hiveworkshop.com/forums/graveyard-418/snippet-getunitvertexcolor-212657/
 
It looks like he GYed it by himself, but he didn't state why.
But if I would probably rewrite it I would do it with similar approch like http://www.hiveworkshop.com/forums/jass-resources-412/snippet-getunitscale-262274/.

The user can manualy register unit types with default values in case vertex color was already modified in object editor.
Also there is a GetCurrent___Value(), and a GetDefault__Value(), which might be useful, too.
 
Status
Not open for further replies.
Top