1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Travel to distant realms and encounter scenes unknown to the common folk. The Greatest of Adventures is upon us with the 8th Cinematic Contest. Join in on a fun ride.
    Dismiss Notice
  4. The 18th Icon Contest is ON! Choose any ingame unit and give him/her Hero abilities. Good luck to all.
    Dismiss Notice
  5. Contestants are to create a scene set in the Stone Age. Come and see what you can come up with. We wish you the best of luck!
    Dismiss Notice
  6. Colour outside the lines! Techtree Contest #13 is a go. The contest is optionally paired.
    Dismiss Notice
  7. Greetings cerebrates, our Swarm needs new spawners that will have numerous children. Join the HIVE's 31st Modeling Contest - Spawners and Spawned! The contest is optionally paired.
    Dismiss Notice
  8. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[Spell] speed spell MUI

Discussion in 'World Editor Help Zone' started by Roflan, May 12, 2019.

  1. Roflan

    Roflan

    Joined:
    Mar 10, 2018
    Messages:
    24
    Resources:
    0
    Resources:
    0
    My spell when activated gives the hero super speed, but I need to make it MUI, can you help?
    How I made it:

    1st trigger: just sets up some buffs and animations +turns on the 2nd trigger
    2nd trigger(turned off): Event - Issued order Unit->Point
    Action - Saves the issued unit and points to globals +turns on the 3rd trigger

    3rd trigger(turned off): Event - Every 0.03 seconds
    Action - moves the stored unit 20 meters forward the stored point (by Polar Offset) til the distance is covered.

    I wrote this in Jass to use locals but it won't work because of this 'Every 0.03 seconds' event which requires variables from other functions.
    How do I make this castable by many units at once?
     
  2. Roflan

    Roflan

    Joined:
    Mar 10, 2018
    Messages:
    24
    Resources:
    0
    Resources:
    0
    I can post the codes here but they are reaally messy to look at
     
  3. Sabe

    Sabe

    Joined:
    Jul 30, 2018
    Messages:
    244
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Use hashtables? They are pretty simple to make MUI as you can store information for each individual units.
     
  4. Pyrogasm

    Pyrogasm

    Joined:
    Feb 27, 2007
    Messages:
    2,688
    Resources:
    1
    Spells:
    1
    Resources:
    1
  5. Uncle

    Uncle

    Joined:
    Aug 10, 2018
    Messages:
    311
    Resources:
    0
    Resources:
    0
    Do you need to use local variables? Without them you could always use a Unit Group and a Unit Indexer.

    Store the units in a Unit Group whenever they cast the spell. Then store the points with the Unit Indexer.

    1st Trigger: A Unit starts the effect of an ability -> add triggering unit to "Super Speed Unit Group"

    2nd Trigger: A Unit is issued an order towards a point -> If ordered unit is in "Super Speed Unit Group" then set OrderPoint[Custom value of triggering unit] to the issued point.

    Then in your timer trigger do:
    Every 0.03 seconds

    Pick every unit in "Super Speed Unit Group" and do If picked unit has Speed Buff = true then move picked unit towards OrderPoint[custom value of picked unit], else, Remove picked unit from "Super Speed Unit Group".
     
    Last edited: May 15, 2019
  6. Roflan

    Roflan

    Joined:
    Mar 10, 2018
    Messages:
    24
    Resources:
    0
    Resources:
    0
    Thanks! That should work.

    Another question: what integer do I set as a 'custom value'? I need each caster to have its individual value so that they don't overwrite one another.
     
  7. Uncle

    Uncle

    Joined:
    Aug 10, 2018
    Messages:
    311
    Resources:
    0
    Resources:
    0
    So unit's by default have a Custom Value of 0. Custom Value isn't an Integer that you need to create, it's something you can already assign through the native Actions in the editor. When you click the Array of your OrderPoint variable search for "Unit - Custom value of unit". Just make sure you download a Unit Indexer (I use Bribe's Unit Indexer) and import it into your map, it will automatically assign each unit a unique custom value when they enter the map and upon map initialization. Then from that point on all of your units will have their own unique # assigned to them that can be easily referenced. Here's a simple example:

    We assign a special effect to a unit when it acquires an item and destroy that special effect when it loses an item. With this method you could have 100's of units each with their own flag and it will still create/destroy their respective special effect properly.
    • Acquire Flag
      • Events
        • Unit - A unit Acquires an item
      • Conditions
        • (Item-type of (Item being manipulated)) Equal to Human Flag
      • Actions
        • Special Effect - Create a special effect attached to the overhead of (Triggering unit) using Objects\InventoryItems\BattleStandard\BattleStandard.mdl
        • Set FlagSfx[(Custom value of (Triggering unit))] = (Last created special effect)


    • Lose Flag
      • Events
        • Unit - A unit Loses an item
      • Conditions
        • (Item-type of (Item being manipulated)) Equal to Human Flag
      • Actions
        • Special Effect - Destroy FlagSfx[(Custom value of (Triggering unit))]

    Another thing I like to do is create an Integer variable called "CV" or "Index" or whatever you want to name it. This just makes your life easier when you have to reference Custom Value a lot. Instead of "MyVariable(custom value of triggering unit)", you can do "MyVariable(CV)" and assign CV as the custom value of our desired unit beforehand.

    • Acquire Flag with Shortcut
      • Events
        • Unit - A unit Acquires an item
      • Conditions
        • (Item-type of (Item being manipulated)) Equal to Human Flag
      • Actions
        • Set CV = (Custom value of (Triggering unit))
        • Special Effect - Create a special effect attached to the overhead of (Triggering unit) using Objects\InventoryItems\BattleStandard\BattleStandard.mdl
        • Set FlagSfx[CV] = (Last created special effect)
     
    Last edited: May 16, 2019
  8. Roflan

    Roflan

    Joined:
    Mar 10, 2018
    Messages:
    24
    Resources:
    0
    Resources:
    0
    Thanks, that was helpful!