Tutorial Making MUI spells in GUI

ah, cohadar, you and your caveman planes :S

before you say "omg go learn jass" and all the rest (as you do), the tutorial is for people who are either a) too lazy or b) dont have the time to learn JASS, not so much for my own usage (would be pretty dumb to write a whole tutorial so i could do something i already knew).

well, unless anyone has a suggestion on something that should be added to the tutorial, its pretty much complete i think.
 
Yeh people like me =]
Ill re read the tutorial tommorow or something and see if anything could be added or changed although i think you pretty much got everything done.
 
Very usefull and well written. Also organised and good for selective reading. I easily extracted what I needed from the text.

++Rep to Flare :)
 
lovely now i get what making a spell mui means i would +rep u but im in debt with rep so lol


this post helped me understand how to make my spellls all mui and no waits


so thx again flare


~Dbd~
 
THNXS ALOT, ive been trying to make a spell mui for days, trouble is i didnt know where to start and its made it pretty wierd (50) instances of it end up running >.> but now i should be able to fix it.
+rep
 
a quick question do i have to make a new custom value for every spell like for the first one use custom value then customvalue2 for the next spell ect?
 
You can use the same variable if you want, but it does limit the maximum number of instances for each spell, even though you can just increase the limit here
Code:
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                CV2 Less than [B]1000[/B]
            Then - Actions
                Set CV2 = (CV2 + 1)
            Else - Actions
                Set CV2 = 1
(change the 1000, and you've changed the maximum instance limit)

1000 is, in my opinion, perfectly safe for a bundle of spells (you could get 10 spells, assuming they weren't going to be spammed) - it's very unlikely to get 1000 spell casts with 10 spells, unless you had 100 units per spell OR the spells lasted for a lengthy duration
 
Why don't you change the Big If/Then/Else with this

Code:
If (MUIFix Less than 1000) then do (Set MUIFix = (MUIFix + 1)) else do (Set MUIFix = 0)

Saves a bit of space
 
(1) I have no reason to do so, it's the same effect in the end
(2) I prefer having it like that (it's more readable than placing everything into a single line)
(3) If you don't like using the If (Multiple Conditions), then just use the single line If, there isn't anything stopping you...
(4) Your casting trigger is either going to be relatively short (setting variables, adding dummy to group) or relatively long (doing something other than setting variables), and saving a bit of space won't change that
 
Why not adding a "Cleaning Up Leaks" part in this tut?
My question is:
Should i use
Code:
custom script: call DestroyGroup (udg_DummyGroup)
somewhere in the code or it isn't necessary? Talking about the unit group that has all dummy units.
 
First - This is AWESOME! Thanks so much for sharing this I will get a TON of use out of it. :thup:

I didn't read through all of the replys so I'm sorry if this has been said before. In the first example, can you eliminate having to use the variables that have to do with the duration of the spell (CurrentDuration & MaxDuration) by adding an expiration timer to the dummy unit?
 
Excellent tutorial. I've only learned MPI and all but MUI is nice to learn. Though, I don't think I'll need MUI on a project I'm working on, but thanks for the tutorial anyway.

It's a bit hard to read sometimes because there are gargantuan blocks of text in some parts of the tutorial. Indentation could be nice and maybe some more Bold text and Underlined text. But I've learned a lot from this anyway even w/o that. +rep to you. :D
 
Great job, Flare! This tutorial and the technique you came up with are quite impressive.

That being said, I don't understand it 100%, and I'm struggling with applying it to my first-ever custom ability (quite new to the scene.)

Now I have the ability "working" in single-player mode, but due to the Wait's I designed it with, it's not MUI. I say "working" because when I realized I had to start re-working the spell to be MUI, the single-player-friendly version would "randomly" lock-up at the end of the cast.

Anyway, here's the Trigger as it exists currently:

Code:
Phoenix Storm Level 1
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Unknown (A000)
        (Level of Unknown (A000) for (Triggering unit)) Equal to 1
    Actions
        -------- Storm Begins --------
        Set CastingUnit = (Casting unit)
        -------- ** Pause CasterUnit ** Give CasterUnit Crow Form ** Turn CasterUnit ** Shake Camera ** Lift CasterUnit ** Slow CasterUnit Animation to 85% ** --------
        Unit - Add Crow Form to CastingUnit
        Unit - Make CastingUnit face 250.00 over 0.50 seconds
        [b]Wait 0.50 seconds[/b]
        Camera - Shake the camera for Player 1 (Red) with magnitude 4.00
        Animation - Change CastingUnit flying height to 250.00 at 375.00
        Animation - Change CastingUnit's animation speed to 85.00% of its original speed
        -------- Summon 5 Phoenix every (Index x 72) Degrees --------
        For each (Integer A) from 1 to 5, do (Actions)
            Loop - Actions
                Set PhSummonIndex = (Real((Integer A)))
                Animation - Play CastingUnit's death animation
                [b]Wait 0.30 seconds[/b]
                Unit - Create 1 PhoenixRain for Player 1 (Red) at ((Position of CastingUnit) offset by 325.00 towards ((PhSummonIndex - 1.00) x 72.00) degrees) facing Default building facing degrees
        -------- Order the 5 summoned Phoenix to move to the caster and explode --------
        Animation - Play CastingUnit's stand animation
        Unit Group - Pick every unit in (Units of type PhoenixRain) and do (Unit Group - Order (Units of type PhoenixRain) to Move To (Position of CastingUnit))
        [b]Wait 0.40 seconds[/b]
        Unit Group - Pick every unit in (Units owned by Player 1 (Red) of type PhoenixRain) and do (Unit - Explode (Picked unit))
        -------- Cause Damage - Create 5 Flamestrikes where the Phoenix exploded --------
        For each (Integer A) from 1 to 5, do (Actions)
            Loop - Actions
                Set PhStormIndex = (Real((Integer A)))
                Special Effect - Create a special effect at ((Position of CastingUnit) offset by 155.00 towards ((PhStormIndex - 1.00) x 72.00) degrees) using Abilities\Spells\Human\FlameStrike\FlameStrike1.mdl
                Unit Group - Pick every unit in (Units within 300.00 of (Position of CastingUnit) matching (((Matching unit) belongs to an enemy of (Owner of CastingUnit)) Equal to True)) and do (Unit - Cause CastingUnit to damage (Picked unit), dealing 60.00 damage of attack type Spells and damage type Fire)
        [b]Wait 1.00 seconds[/b]
        -------- Undo all changes to CasterUnit --------
        Animation - Change CastingUnit's animation speed to 100.00% of its original speed
        Animation - Change CastingUnit flying height to 0.00 at 420.00
        Unit - Remove Crow Form from CastingUnit
        Unit - Set CastingUnit movement speed to (Default movement speed of CastingUnit)
        Camera - Stop swaying/shaking the camera for Player 1 (Red)
        -------- Storm Ends --------

If anyone would be willing to give me a hand engineering the conversion, I'd greatly appreciate it. In the meantime, I'm going to continue picking this tutorial apart and try to construct the logic/pseudo-code for how to apply the system to my spell and update my progress here. (not looking to have my hand held)

Obstacles atm:

* I have four different waits in the spell, one of which is inside a loop. The waits were "necessary" in the original design to allow for animations like the caster turning, interrupting the caster's dying animation to catch that sweet lightning ripple, etc.

In the example AoE spell, the two "waits" are the Impact Delay and Spawn Interval. Will I need four different Real arrays for each wait?

* The spell is designed to summon the Phoenix in a pentagon around the caster using 72 degree angles. I was creating these angles by using the index of the loop they were in which went up to 5. Am I going to have to create another integer array with max size 5 and use TempIntegers to keep track of which element I'm in?

Thanks,

- Sungazer
 
Well I got so frustrated with this thing I decided to go ahead and start teaching myself some JASS to see if I could make any sense of it, and I realize why I was getting so confused.

Here you have:

Code:
Unit Group - Pick every unit in DummyGroup and do (Actions)
    Loop - Actions
        ...

I was getting hung up on this Loop because I couldn't figure out when it ended. Then I looked at this section of code in JASS, and it comes out like this:

JASS:
call ForGroupBJ( udg_DummyGroup, function Trig_Meteor_Shower_Periodic_Func002A )


So it's a For loop that runs until there are no more units to process in DummyGroup right? That's what I thought originally, but what's confusing me now, is why does this spell keep going after only a single cast?

The "Meteor Shower Cast" Trigger only adds 1 Dummy Unit to DummyGroup once the effect of the ability begins. So in my mind it goes like this:

When CV1 = 0
* User hits "Meteor Shower"
* Set CV1 = 1
* Caster[1] = Triggering Unit, CasterLoc[1] = Pos. of Trigg. Unit
* DummyUnit created
* DummyUnit added to DummyGroup (# of units in DummyGroup = 1)

Now comes "Meteor Shower Periodic":

* For every unit in DummyGroup (1), do actions

Now unless I'm mistaken, there is only ONE DummyUnit in DummyGroup, but this spell goes off TWENTY-SIX times! Where the hell is the 26 coming from?

Then I thought about it a little longer and realized that if you don't interrupt the spell by moving (can't be turned off?), it stays in "cast mode" so it would fire "Meteor Shower Cast" repeatedly until interrupted, right? But that's not the case either! It always stops at the "seemingly random" 26!

What gives? Is this an infinite loop that the World Editor cuts off after 26 iterations? Why doesn't it do this for other infinite loops?

+Rep to anyone who can clear this up for me.


EDIT: LOL, I just saw this while reading over one of Vexorian's awesome JASS tutorials:

An if may have as many elseif as you want, I think there is a limit but it was something like 26.

There's no way that's a coincidence. 26 elseif 's, eh? But I don't see any elseif 's anywhere in the code, in the GUI or JASS version. Does that rule extend to more than just elseif 's? And if this is somehow the answer to where the 26 is coming from, how then would you make this loop infinitely?
 
The group thing is only needed for GUI because it helps to make something MUI (not in all cases, but possible for all cases...depending on how you do it). Using JASS wouldn't require you to utilise the unit group. It's more direct and less complicated.

For your wait thing, you just need localise an integer and implement Flare's tutorial.
Code:
Example
Event
Condition
Actions
 Custom script:  local integer udg_LocalInteger
 If Integer < 1000 then
   Set Integer = Integer +1
 Else
   Set Integer = 0
 Set Local_Integer = Integer
 ---------------------------------------------------
 Set Unit[Local_Integer] = YourUnit
 ---other actions---
 Wait 4.00 seconds
 ---other actions---
 Wait 4.00 seconds
 ---other actions---
 Unit - Kill Unit[Local_Integer]

The above is MUI.
 
Hmm, I apologize, but I realized I don't understand your example. You declared:

"udg_LocalInteger" and then Set a different variable called "Local_Integer" using a GUI Action that only works on Global variables in the first place.

Still confused about that darn 26 that popped up in Flare's Meteor example too ;\
 
All global variables declared in the Variable Editor are prefixed with udg_ (you just never see it in GUI actions). vypur's method is just taking advantage of the fact that local integers take precedence over global variables of the same name, so if you declare a global variable called "MyString", and then declare a local variable called "udg_MyString", any actions within that trigger that use MyString (unless in a separate function, like unit group loops, or If conditions) will use the local variable, allowing the variable to maintain it's value past waits (unlike globals, which are liable to be overwritten).

In effect - if you declare a local variable in a trigger with the same name as a global variable (without forgetting the udg_ prefix for the local), any actions that aren't part of If conditions, or Unit Group loops, will use the local variable if they try to reference the global e.g.
Trigger:
  • Actions:
    • Custom script: local integer udg_MyIntVar
    • Set MyIntVar = Random integer between 1 and 100
    • Display to All Players the text: &quot;Before wait - &quot; + Int2String (MyIntVar)
    • Wait 15.00 seconds
    • Display to All Players the text &quot;After wait - &quot; + Int2String (MyIntVar)


If you fire that trigger multiple times, you will see corresponding values in the messages i.e. if the first "Before wait" message displays 72, the first "After wait" message will also display 72. If you didn't use a local variable, the numbers wouldn't correspond to each other

And what 26 in my Meteor example?
 
When use Meteor Shower, 26 "meteors" fall before the loop ends. To me, the loop should only go once (1 Dummy Unit), or infinitely because the Dummy Unit is added repeatedly.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top