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

How Would I make this MUI?

Status
Not open for further replies.
Level 11
Joined
Aug 6, 2009
Messages
697
Be very descriptive on how to make this MUI please,I attempted to make a chidori MUI spell but it failed and im not sure what to do,I attempted making this using the dynamic indexing system.

  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Chidori
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • Index Equal to 0
      • Then - Actions
        • Trigger - Turn on SpellLoop <gen>
      • Else - Actions
    • Set Index = (Index + 1)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • Index Greater than IndexMax
      • Then - Actions
        • Set IndexReg[Index] = Index
        • Set IndexMax = Index
      • Else - Actions
    • Set IndexTemp = Index
    • Set Caster[IndexTemp] = (Triggering unit)
    • Set Victim[IndexTemp] = (Target unit of ability being cast)
    • Set ChidoriPoint = (Position of (Triggering unit))
    • Set ChidoriPoint2 = (Position of (Target unit of ability being cast))
    • Set ChidoriAngle[IndexTemp] = (Angle from ChidoriPoint to ChidoriPoint2)
    • Set ChidoriCharge[IndexTemp] = 30.00
    • Unit - Turn collision for Caster[IndexTemp] Off
    • Custom script: call RemoveLocation(udg_ChidoriPoint)
    • Custom script: call RemoveLocation(udg_ChidoriPoint2)
Trigger Loop:
  • Events
    • Time - Every 0.03 seconds of game time
  • Actions
    • For each (Integer ALoop) from 1 to Index, do (Actions)
      • Loop - Actions
        • Set IndexTemp = IndexReg[ALoop]
        • Set ChidoriPoint = (Position of Caster[IndexTemp])
        • Set ChidoriPoint2 = (Position of Victim[IndexTemp])
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Distance between ChidoriPoint and ChidoriPoint2) Greater than or equal to 195.00
          • Then - Actions
            • Unit - Move Caster[IndexTemp] instantly to (ChidoriPoint offset by ChidoriCharge[IndexTemp] towards ChidoriAngle[IndexTemp] degrees)
            • Special Effect - Create a special effect attached to the right hand of Caster[IndexTemp] using Abilities\Spells\Human\StormBolt\StormBoltMissile.mdl
            • Special Effect - Destroy (Last created special effect)
            • Special Effect - Create a special effect attached to the right hand of Caster[IndexTemp] using Abilities\Spells\Orc\LightningBolt\LightningBoltMissile.mdl
            • Special Effect - Destroy (Last created special effect)
            • Custom script: call RemoveLocation(udg_ChidoriPoint)
            • Custom script: call RemoveLocation(udg_ChidoriPoint2)
          • Else - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Distance between ChidoriPoint and ChidoriPoint2) Less than or equal to 195.00
              • Then - Actions
                • Animation - Play Caster[IndexTemp]'s attack animation
                • -------- Edit Damage Here --------
                • Unit - Cause Caster[IndexTemp] to damage Victim[IndexTemp], dealing (5.00 x (Real((Agility of Caster[IndexTemp] (Include bonuses))))) damage of attack type Spells and damage type Normal
                • Special Effect - Create a special effect attached to the origin of Victim[IndexTemp] using Abilities\Spells\Human\StormBolt\StormBoltMissile.mdl
                • Special Effect - Destroy (Last created special effect)
                • Special Effect - Create a special effect attached to the right hand of Victim[IndexTemp] using Abilities\Spells\Orc\LightningBolt\LightningBoltMissile.mdl
                • Special Effect - Destroy (Last created special effect)
                • Custom script: call RemoveLocation(udg_ChidoriPoint)
                • Custom script: call RemoveLocation(udg_ChidoriPoint2)
              • Else - Actions
            • Set IndexReg[ALoop] = IndexReg[Index]
            • Set IndexReg[Index] = IndexTemp
            • Set Index = (Index - 1)
            • Set ALoop = (ALoop - 1)
            • Unit - Turn collision for Caster[IndexTemp] On
            • Set Caster[IndexTemp] = No unit
            • Set Victim[IndexTemp] = No unit
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • Index Equal to 0
      • Then - Actions
        • Trigger - Turn off (This trigger)
      • Else - Actions
 
Level 26
Joined
Mar 19, 2008
Messages
3,140
For the first time dynamic indexing? :p
That makes your spell non MUI:
  • Set IndexTemp = Index
It should be:
  • Set IndexTemp = IndexReg[Index]
Also, better add this part in loop after reducing the size of Intex.
  • Set Index = (Index - 1)
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Index Equal to 0
    • Then - Actions
      • Trigger - Turn off (This trigger)
    • Else - Actions
Also, don't remove leaks this way:
  • Set ChidoriPoint = (Position of Caster[IndexTemp])
  • Set ChidoriPoint2 = (Position of Victim[IndexTemp])
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Distance between ChidoriPoint and ChidoriPoint2) Greater than or equal to 195.00
    • Then - Actions
      • <stuff here>
      • Custom script: call RemoveLocation(udg_ChidoriPoint)
      • Custom script: call RemoveLocation(udg_ChidoriPoint2)
    • Else - Actions
      • <stuff here>
      • Custom script: call RemoveLocation(udg_ChidoriPoint)
      • Custom script: call RemoveLocation(udg_ChidoriPoint2)
It's anaccurate, use:
  • Set ChidoriPoint = (Position of Caster[IndexTemp])
  • Set ChidoriPoint2 = (Position of Victim[IndexTemp])
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Distance between ChidoriPoint and ChidoriPoint2) Greater than or equal to 195.00
    • Then - Actions
      • <stuff here>
    • Else - Actions
      • <stuff here>
  • Custom script: call RemoveLocation(udg_ChidoriPoint)
  • Custom script: call RemoveLocation(udg_ChidoriPoint2)
It'd would recomened only when you want to minimalize amount of variables using them multiple times but as I can see you don't do such thing nor require it.
 
Level 29
Joined
Mar 10, 2009
Messages
5,016
index system requires at least 3 integer variable...

remove this...
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • Index Greater than IndexMax
  • Then - Actions
  • Set IndexReg[Index] = Index
  • Set IndexMax = Index
then...
Set Index = (Index + 1)
Set Index2 = (Index2 + 1)
Set Caster[Index2] = (Triggering unit)
ALL VARIABLES, must be referenced as index2

in the loop...
For each (Integer ALoop) from 1 to Index2, do (Actions)
then ALL must be referenced as "ALoop"

Distance between points should be saved as real first...
  • Set ChidoriPoint = (Position of Caster[ALoop])
  • Set ChidoriPoint2 = (Position of Victim[ALoop])
  • Set Distence = (Distance between ChidoriPoint and ChidoriPoint2)
    • if Distance Greater than or equal to 195.00
 
Level 26
Joined
Mar 19, 2008
Messages
3,140
There are about 3 differend indexing systems being used by GUI users in current state and at first you have to recognize which one is used before actually trying to fix the whole spell/system.
mckill2009 I didn't know you haven't been using dynamic indexing in GUI.

He should not remove:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Index Greater than IndexMax
    • Then - Actions
      • Set IndexReg[Index] = Index
      • Set IndexMax = Index
    • Else - Actions
But change the TempInt part:
  • Set IndexTemp = Index
So whore indexing hook looks like:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Index Greater than IndexMax
    • Then - Actions
      • Set IndexReg[Index] = Index
      • Set IndexMax = Index
    • Else - Actions
  • Set IndexTemp = IndexReg[Index]
mckill2009 said:
then...
Set Index = (Index + 1)
Set Index2 = (Index2 + 1)
Set Caster[Index2] = (Triggering unit)
ALL VARIABLES, must be referenced as index2

in the loop...
For each (Integer ALoop) from 1 to Index2, do (Actions)
then ALL must be referenced as "ALoop"
Wrong. You are talking about inefficient, old Paladons Indexing system. Nowadays GUI users should use either Hanky's dynamic indexing or Bride's Unit Indexer and there is no doubt about that.

I was the one who told Assasin-Greed to learn that indexing because it's far more efficient and enables you to recycle instances immidiately by:
  • Set IndexReg[ALoop] = IndexReg[Index]
  • Set IndexReg[Index] = IndexTemp
  • Set Index = (Index - 1)
  • Set ALoop = (ALoop - 1)
What you can not do in standard indexing which uses 3 integers: instance, current instance, loop index.
mckill2009 said:
Distance between points should be saved as real first...
  • Set ChidoriPoint = (Position of Caster[ALoop])
  • Set ChidoriPoint2 = (Position of Victim[ALoop])
  • Set Distence = (Distance between ChidoriPoint and ChidoriPoint2)
    • If Distance Greater than or equal to 195.00
Good point here. It's more efficient to save distance as real in main/cast trigger and later only refer to that real value, reducing it with each loop.
 
Level 26
Joined
Mar 19, 2008
Messages
3,140
It's still usable, I still like it and was using for years but since everything develop it's nice to use systems that reduce lagg and makes spells smoother. In Paladon's you have to wait untill all instances are finished to actually recycle them. Template.

Afterall, Hanky's uses one index more, the fifth one is just to make users like easier, since we do not have to write: 'TempInt = Index[IndexSize]' or 'TempInt = Index[Loop]' since we can write it manually: instead of Caster[TempInt], Caster[Index[IndexSize]] but it sucks to click so many times - twice per one array.
 
Level 29
Joined
Mar 10, 2009
Messages
5,016
In Paladon's you have to wait untill all instances are finished to actually recycle them.

Wrong. When the spell is finished, then it's recycled (Im talking of INDEX1)...

Anyway, which is better to read...

  • StartMissile2
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Test-It
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • INDEX1 Equal to 0
        • Then - Actions
          • Trigger - Turn on MissileLoop2 <gen>
        • Else - Actions
      • Set INDEX1 = (INDEX1 + 1)
      • Set INDEX2 = (INDEX2 + 1)
      • Set TempLoc = (Position of (Triggering unit))
      • Set TempLoc2 = (Target point of ability being cast)
      • Set SPELL_CASTER[INDEX2] = (Triggering unit)
      • Unit - Create 1 Peasant for Neutral Passive at TempLoc facing (Angle from TempLoc to TempLoc2) degrees
      • Unit - Turn collision for (Last created unit) Off
      • Unit - Move (Last created unit) instantly to TempLoc
      • Set SPELL_MISSILE[INDEX2] = (Last created unit)
      • Set BOOLEANCHK[INDEX2] = False
      • Set SPELL_ANGLE[INDEX2] = (Angle from TempLoc to TempLoc2)
      • Set SPELL_SPEED[INDEX2] = 5.00
      • Set SPELL_DUR[INDEX2] = 10.00
      • Custom script: call RemoveLocation(udg_TempLoc)
      • Custom script: call RemoveLocation(udg_TempLoc2)
Compare to;
  • StartMissile
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Test-It
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SPELL_Index_Size Equal to 0
        • Then - Actions
          • Trigger - Turn on MissileLoop <gen>
        • Else - Actions
      • -------- Increase the index size --------
      • Set SPELL_Index_Size = (SPELL_Index_Size + 1)
      • -------- Dynamic Index --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SPELL_Index_Size Greater than SPELL_Index_maxSize
        • Then - Actions
          • Set SPELL_Index[SPELL_Index_Size] = SPELL_Index_Size
          • Set SPELL_Index_maxSize = SPELL_Index_Size
        • Else - Actions
      • -------- Dynamic Index End --------
      • Set TempInt = SPELL_Index[SPELL_Index_Size]
      • -------- Setup those arrays --------
      • Set TempLoc = (Position of (Triggering unit))
      • Set TempLoc2 = (Target point of ability being cast)
      • Set SPELL_CASTER[TempInt] = (Triggering unit)
      • Unit - Create 1 Peasant for Neutral Passive at TempLoc facing (Angle from TempLoc to TempLoc2) degrees
      • Unit - Turn collision for (Last created unit) Off
      • Unit - Move (Last created unit) instantly to TempLoc
      • Set SPELL_MISSILE[TempInt] = (Last created unit)
      • Set SPELL_ANGLE[TempInt] = (Angle from TempLoc to TempLoc2)
      • Set SPELL_SPEED[TempInt] = 5.00
      • Set SPELL_DUR[TempInt] = 10.00
      • Custom script: call RemoveLocation(udg_TempLoc)
      • Custom script: call RemoveLocation(udg_TempLoc2)
 
Level 26
Joined
Mar 19, 2008
Messages
3,140
mckill2009 Index1 is recycled great, but loop trigger still runs through LoopIndex to Index2 meaning that even if there are proper conditions which prevent from executing finished instance function still has to check them. Dynamic indexing provides way to eliminate all used instances and thats what really count here as a comparison.

Ye, there is no doubt that Paladon's is cleaner ;)
Thats why most users start with that one.
 
Status
Not open for further replies.
Top