Creating a Successful Spell

Note: This is a tutorial for GUI users because I am hopeless at JASS.

Creating a Successful Spell:

This tutorial will be focusing on creating a successful spell. Generally the first
thing a person would like to know about your spell is:​

  • Is it MUI?
  • Does it leak?
  • Are the special effects good?
  • Is the triggering good in general?
  • Are there already a million of these on Hive?
  • Does it support multiple levels?

In this tutorial, you will learn about all these topics and how to present your spell for it to answer everything necessary.

Contents:
  • Looping
  • MUI
  • Leaks
  • Presentation
  • Tips

Looping:

Q: What is looping?

A: Looping is to perform actions multiple times until a condition is met. Usually, the condition is when the loop has looped a specific amount of times. Once the condition is met, the loop will end and it will perform the actions from then on.​

Q: Why is it useful?

A: The sole purpose of looping is so that the people using something like one of your systems will use up less of their time. They make your life much easier, and are much easier to look at.​

For the people who don't know what a loop is, I'll try and help you understand.

Examples:

  • Bad way
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to itemtype[1]
        • Then - Actions
          • Player - Set (Player(1)) Current gold to 750
          • Unit - Hide (Hero manipulating item)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to itemtype[2]
        • Then - Actions
          • Player - Set (Player(2)) Current gold to 750
          • Unit - Hide (Hero manipulating item)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to itemtype[3]
        • Then - Actions
          • Player - Set (Player(2)) Current gold to 750
          • Unit - Hide (Hero manipulating item)
        • Else - Actions
This trigger is hideous and has to have several blocks just to properly perform.

  • Good way
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to itemtype[(Integer A)]
        • Then - Actions
          • Player - Set (Player(Integer A)) Current gold to 750
          • Unit - Hide (Hero manipulating item)
        • Else - Actions
This loop optimizes what you need to do, and makes it much easier to look at or modify. Instead of having to copy and paste several times, and make minor changes, you can use a simple loop and return back to it if you need to fix anything. The number of times it will loop is determined by the "For Each (Integer A) from X to Y" part. X is where the integer will start at, and it will proceed to increase for each whole number until it reaches Y. For example, 1 to 3 will loop first at 1, then to 2, and finally to 3. This results in a looping of 3-times.

During each loop, the number of times it had been looped at that instance is referenced to as (Integer A). So if you are currently on your second loop, (Integer A) will equal 2. (unless you use something other than 1 as the start of the loop)​

Tip 1: Give your spell as much settings as you can if you want it to be classified as more "unique" or "special", in case there has been another upload of the same kind of spell on Hive.


MUI:

Q: What is MUI?

A: MUI stands for multiple-unit instanceability. Generally, what MUI does is it allows spells with a duration to function properly while they are occurring with more than one instance. Basically, if the spell is cast by two or more units at the same time, it should execute properly. There are many ways to make your spell MUI, such as through hashtables or the MUI template provided. (which uses arrays to be the most efficient)​

MUI links: http://www.hiveworkshop.com/forums/...ing-template-144325/?prev=d=list&r=20&u=hanky, http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/dynamic-values-storage-121558/, http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/hashtables-mui-133407/


(I will insert an MUI template document at the bottom of the page that you can fiddle around with and use for your spells. No credit needed as this same template is used on millions of other spells I have seen on Hive. I cannot find the person who first created this template, otherwise I would give credit.)

Note: I'm sorry I couldn't give an explanation of the MUI system, but it is pretty difficult to explain it in words. But you don't need to know how it functions anyway. You only need to copy-paste this MUI template at
the bottom into your map. It also contains loops as I showed you earlier.

Examples:
  • MUI example
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MUI_index[0] Equal to 0
        • Then - Actions
          • Trigger - Turn on MUI example 2 <gen>
        • Else - Actions
      • Set MUI_index[0] = (MUI_index[0] + 1)
      • Set MUI_index[1] = (MUI_index[1] + 1)
      • Set MUI_time[MUI_index[1]] = 0.00
      • Set MUt_duration[MUI_index[1]] = 2.00
  • MUI example 2
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • For each (Integer MUI_index[2]) from 1 to MUI_index[1], do (Actions)
        • Loop - Actions
          • -------- I have set the duration as 2 seconds, and every 0.04 seconds of gametime --------
          • -------- it adds 0.04 to the time variable and once it has reached 2 seconds, the trigger --------
          • -------- turns itself off and is turned back on again once it is needed --------
          • Set MUI_time[MUI_index[2]] = (MUI_time[MUI_index[2]] + 0.04)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • MUI_time[MUI_index[2]] Equal to MUt_duration[MUI_index[2]]
            • Then - Actions
              • Set MUI_index[0] = (MUI_index[0] - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • MUI_index[0] Equal to 0
                • Then - Actions
                  • Set MUI_index[0] = 0
                  • Set MUI_index[1] = 0
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
Tip 2: Did you know your WE can automatically create variables for triggers you have copy-pasted? Don't know how? Go to preferences and tick the box that says 'automatically create unknown variables while pasting trigger data'.



Leaks:

Q: What are leaks?

A: Leaks are unneeded stored memory that can cause lag, or even server splits (disconnections) in some cases. Always make sure that you remove all the leaks you can find, otherwise your map may be running a bit slower.​

This is one of the most important things you need to know, because if your spell has leaks, then it will definitely need fixes. Most object types leak, and the more common ones in GUI are:​

  1. Locations
  2. Strings (unfortunately, irremovable, but they are minimal leaks from data being stored in a string table)
  3. Unit Groups
  4. Player Groups (unless (all players) is picked)
  5. Sounds
  6. Special Effects
  7. Regions (except for playable map area)

Locations, special effects, and unit groups are the most common leaks encountered in GUI. To make the most efficient spells, make sure you read up on how to fix those leaks.​

How to remove them:


Note: There are a kajillion tutorials that explain this extremely thoroughly so I don't think I need to explain this. Here are 2 helpful links:

Busterkomo's: http://www.hiveworkshop.com/forums/general-mapping-tutorials-278/complete-list-things-leak-126761/ (explains JASS leaks also)
Ralle's: http://www.hiveworkshop.com/forums/triggers-scripts-269/things-leak-35124/

Tip 3: Before uploading a spell/system, make sure that it isn't too simple, and think about if it would actually be useful to other people to use.

Presentation:

Whenever someone sees your spell, they would like to have an explanation of the spell either in the spell test-map or in the description of the post. Having a description that explains it is optional, but we would all appreciate one as it would tell us what we would like to know. Do not say something only like "this r my spell iss gud,". Just tell us about the actual spell and also post the triggers it uses. Give an account of something such as the damage and the duration for each individual level of the spell. You don't need to make the spell description all fancy like map descriptions. I'll give a decent example. It's short, but it tells me what I would like to know:​

Note: Please don't use words like 'ur' or 'u' because it makes people think you are 8.

http://www.hiveworkshop.com/forums/spells-569/maul-smash-179886/?prev=r=20&page=2

This is my first spell so I'm not sure if its good enough.
A powerful combination of slam and dagger that creates a crack on its position dealing damage to and slowing the movement speed and attack rate of nearby enemy land units.

Level 1 - 60 initial damage and 60 on the next move damage, -50% movement, -50% attack rate.
Level 2|r - 100 initial damage and 100 on the next move damage, -50% movement, -50% attack rate.
Level 3|r - 140 initial damage and 140 on the next move damage, -50% movement, -50% attack rate.
Level 4|r - 180 initial damage and 180 on the next move damage, -50% movement, -50% attack rate.


And there are some descriptions that can even be this short but I still find decent:​

http://www.hiveworkshop.com/forums/...0-02-a-106705/?prev=of=rating&order=DESC&r=20

A simple system to make an inventory with 12 slots. This system keep cooldowns and bonus.

Here is another one that is... not so good.​

I DON;T HAVE A PICt sry hey give me credit for this sweet spell!

I especially lol'd at this one, but I don't want to give the link because it might offend him. However, the real message I am trying to convey to you is that it does not need to be long or fancy, but it should have a brief explanation of the spell.

You also should have a decent in-game tooltip. What any tooltip should have is:​

  1. An account of the damage, range, etc. in the "learn" tooltip, as well as a mini explanation of the spell in all of the tooltips.
  2. A hotkey.
  3. Color codes (optional).

So, in other words, just make it have a tooltip description like the normal Blizzard abilities and if you want, put some fancy color codes to make it more attractive.

Here are some tips on the presentation:​

  1. Always provide an in-game screenshot of the spell so we can have a glimpse of it in action.
  2. I recommend you terrain your test map so it looks pretty (for example, it would be good to make the map have icy trees and an icy ground for an icy spellpack). An example of what I mean is in the test map attached at the bottom of this post.
  3. Post the triggers. This makes reviewing the spell a lot easier for people.
  4. Change the name from 'Another Warcraft 3 Map' to anything but that.
  5. Don't import any files into your map, aside from the necessities such as a dummy model or a special effect if you want it, because otherwise it is pointless and a waste of bandwidth.
  6. If you've used any resources not made by you, credit them.

Tip 4: Wanting to give your spell/system a cool icon, a cool test unit, and cool special effects without making the test-map file size too big? Go here. (Contains hidden resources) http://www.hiveworkshop.com/forums/...s-278/hidden-resources-we-screenshots-116845/
 

Attachments

  • Spell tutorial.w3x
    19.4 KB · Views: 3,458
Last edited:
Level 22
Joined
Nov 14, 2008
Messages
3,256
multiple unit instancible

I think it is instanceable.

Else.

-This is good I guess, would teach some about upload some proper stuff.

-Something I would add is "If you've used any resources not made by you, credit them".

-There are other ways of making a spell MUI, lots of other ways, also your example isn't the best, I would recommend indexing like this Link or like this Link 2

-You can also mention about hashtables.

-Add that regions leaks except for "playable area" as it's predefined as "All players"
 
Top