• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[GUI] Basic GUI Class

I will be updating this thread as I learn more about GUI.

Requirements:
World Editor
Basic Object Editor Knowledge

Step 1:
Start World Editor and Open the object editor (Hot-key: F6)

Step 2:
We are going to make an ability that does nothing but showing a buff for 1 Sec, with a Cooldown of 10 Seconds.

Click on the abilities tab.

Find the Orc ability Berserk under Orc> Units> Berserk.

Right-Click on the abillity and a menu will pop up like the one in FIG 1, press copy ability.
Step 2 Figure 1
attachment.php

Paste the ability (Hot-key: Ctrl + V) and Click on the new created ability the appeared, you should get your object editor looking like Figure 2.
Step 2 Figure 2
attachment.php

Change the following values:
Data - Attack Speed Increase = 0.00
Data - Damage Taken Increase = 0.00
Data - Movement Speed Increase = 0.00
Stats - Buffs = Heal
Stats - Cooldown = (8-32) I set it to 12
Stats - Duration - Hero = 1.00
Stats - Duration - Normal = 1.00
Text - Name = Heal
text - Hotkey - Normal = H
Text - Tooltip - Normal = |cffffcc00H|real
Text - Tooltip - Normal - Extended = Cause the unit to heal damage lost in battle.

Step 3:
Close the Object Editor

Open the trigger editor (Hot-key: F4)

Event: Is what starts a trigger, without a event, the trigger won't start unless you start it with an action
Condition: Conditions stop trigger from starting if they were not true.
Example:[GUI](Triggering unit) Equal to (Picked unit)
[/GUI]
Action: Is what happens if the trigger started and conditions were true.

Create a new trigger called Heal Ability

Create an Event
  • Unit - A unit Starts the effect of an ability
Add a condition
  • (Ability being cast) Equal to Heal
And Finally Add the Action
  • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + "Amount of health increased")
Requirements:
Basic Knowledge in the trigger editor

Step 1:

Open Trigger Editor and Object Editor

Create a ability based on roar\howl of terror set the following values:
Art - Caster = None
Art - Icon - Normal = ReplaceableTextures\CommandButtons\BTNDisenchant.blp
Data - Damage Increase (%) = 0.00
Stats - Buffs = Flame strike
Stats - Duration - Normal = 1
Stats - Duration - Hero = 1
Stats - Mana Cost = 25-80 (I'll set it to 60)
Stats - Targets Allowed = Enemy, Ground, Self
Text - Hotkey - Normal = B
Text - Name = Burst
Text - Tooltip - Normal = |cffffcc00B|rurst
Text - Tooltip - Normal - Extended = Burst caster with flames, damaging him and units withing range.

Step 2:

Create 2 new triggers "burst setup" & "burst ability"

Click on the first trigger (Burst Setup)

Variable: a Variable is like a box of a shape, it can be empty or have an object that have to have the box's shape to be placed inside it, and there is many shapes of boxes, and there is many variable types, there is variables that hold strings, variables that hold integers, or reals or anything.

To edit the variables, go to Edit > Variables (Hot-key: Ctrl + B) a Window will pop.

Create a new variable (Hotkey: Ctrl + N) and a Window will pop like Figure 1
Step 2 Figure 1
attachment.php

Set Variable Name to "Something"_Ability
Set Variable Type to Ability
Click Enter\press OK
You should have the Window exactly like Figure 2
Step 2 Figure 2
attachment.php

Create the renaming Variables so you get something like Figure 3.
Step 2 Figure 3
attachment.php

Click ok.

Step 3:
Click on "Burst Setup" Ability and add the following:
  • Burst Setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Your_Ability = Burst
      • Set Your_Ability_Damage = 50.00
      • Set Your_Ability_SFX = Abilities\Spells\Items\AIfb\AIfbSpecialArt.mdx
Click on "Burst Ability" Trigger

Custom Script: is an action in the World Editor Trigger Editor which allows you to type one line of JASS script as opposed to using a template GUI script.

Jass: the scripting language used for scripting Maps and AI files in Blizzard Entertainment's Warcraft III game.

Add this to "Burst ability"

  • Burst Ability
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Your_Ability
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area) matching ((Matching unit) Equal to (Target unit of ability being cast))) and do (Actions)
        • Loop - Actions
          • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - Your_Ability_Damage)
Now the ability work but without any effects

to add effects, create a new variable and name it "Something"_Ability_Point and set the type to Point.

Then add the following lines to "burst ability"

  • Burst Ability
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Your_Ability
    • Actions
      • Set Your_Ability_Point = (Position of (Triggering unit))
      • Special Effect - Create a special effect at Your_Ability_Point using Your_Ability_SFX
      • Special Effect - Destroy (Last created special effect)
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area) matching ((Matching unit) Equal to (Target unit of ability being cast))) and do (Actions)
        • Loop - Actions
          • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - Your_Ability_Damage)
Now the ability function correctly.
 

Attachments

  • Step-2-FIG-1.jpg
    Step-2-FIG-1.jpg
    24.2 KB · Views: 569
  • Step-2-FIG-2.jpg
    Step-2-FIG-2.jpg
    214.4 KB · Views: 656
  • 2-Step-2-FIG-1.jpg
    2-Step-2-FIG-1.jpg
    14.7 KB · Views: 542
  • 2-Step-2-FIG-2.jpg
    2-Step-2-FIG-2.jpg
    27.9 KB · Views: 528
  • 2-Step-2-FIG-3.jpg
    2-Step-2-FIG-3.jpg
    33.1 KB · Views: 526
Last edited:
something is really wrong in the lesson 2. Matching unit equal to target. Then why the heck use a unit group if you filter out everyone but one unit o_O

Target of ability being cast are Unit in 500 range, because the ability is Roar

how about damage per second ability!

Next lesson.
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
i mean this.
  • Unit Group - Pick every unit in (Units in (Playable map area) matching ((Matching unit) Equal to (Target unit of ability being cast))) and do (Actions)
    • Loop - Actions
      • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - Your_Ability_Damage)
You are doing this unit group to do a different action to this one unit. I thought i saw other actions thats y i said separate actions.

It should be done simply like this.

  • Set tempUnit = (Target unit of ability being cast)
  • Unit - Set life of tempUnit to ((Life of tempUnit) - Your_Ability_Damage)
They should also be told to avoid the use of things like this unless necessary.
  • Unit Group - Pick every unit in (Units in (Playable map area)
 
Let me know if/when you deem this tutorial complete. However, I'm not 100% about the topic. It is kind of a vague topic, that could really be about anything. I tend to prefer targeted tutorials.

However, I suppose it wouldn't be harmful so long as the tutorial is good.

Am currently busy with alot of stuff in my life, i'll find a time for this sooner or later...
 
Top