• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Creating a simple boss, using abilities.

Status
Not open for further replies.
Level 8
Joined
Aug 21, 2009
Messages
408
Im trying to make a simple boss. He has two abilities, ensnare, and wind walk.

First, he would ensnare one (or all) heros around him, and then wind walk to a random enemy (nobody knows who specifically) and hit them. Heres the trigger i have, but it doesnt seem to work, or it is VERY inconsistant.

  • NetInvis
    • Events
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units within 1000.00 of (Position of Banditboss)) and do (Actions)
        • Loop - Actions
          • Unit - Order Banditboss to Orc Raider - Ensnare (Picked unit)
          • Wait 2.00 seconds
      • Wait 2.00 seconds
      • Unit - Order Banditboss to Orc Blademaster - Wind Walk
      • Wait 1.00 seconds
      • Unit - Order Banditboss to Attack (Random unit from (Units within 1000.00 of (Position of Banditboss) matching (((Picked unit) is in Heros) Equal to True)))
The trigger is activated by another.

The wait (i assume) is needed to allow the spell to cast before moving on the the next. All abilities take 0 mana, have 0 cooldown, and are available abilities to the hero. Both are based off of the basic windwalk and ensnare abilities.

Final note, all heros playing the game have been added to the heros list, as well as Banditboss being set to the boss unit.

If theres some tutorial i could use to help me out? Or a reason he doesnt ensnare/attack? Windwalk is the only consistant ability :(
 
Level 37
Joined
Mar 6, 2006
Messages
9,243

  • Untitled Trigger 037
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Set boss = Paladin 0020 <gen>
      • Set point = (Position of boss)
      • Set group = (Units within 512.00 of point matching ((Owner of (Matching unit)) Not equal to (Owner of boss)))
      • Custom script: call RemoveLocation(udg_point)
      • Trigger - Run Untitled Trigger 043 <gen> (ignoring conditions)
  • Untitled Trigger 043
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in group) Greater than 0
        • Then - Actions
          • Set unit = (Random unit from group)
          • Set point = (Position of boss)
          • Set point2 = (Position of unit)
          • Unit Group - Remove unit from group
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (unit is alive) Equal to True
              • (Distance between point and point2) Less than 550.00
            • Then - Actions
              • Unit - Order boss to Human Paladin - Holy Light unit
              • Custom script: call RemoveLocation(udg_point)
              • Custom script: call RemoveLocation(udg_point2)
              • Wait 2.00 seconds
              • -------- Here you can do the wind walk thing also --------
              • Trigger - Run (This trigger) (ignoring conditions)
            • Else - Actions
              • Custom script: call RemoveLocation(udg_point)
              • Custom script: call RemoveLocation(udg_point2)
              • Trigger - Run (This trigger) (ignoring conditions)
        • Else - Actions
          • Custom script: call DestroyGroup(udg_group)
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
@UndeadImmortal
It works, but not recommended.

If you put a wait inside the loop, you will notice it will do action per wait.

Example;
  • For each (Integer A) from 1 to 10, do (Actions)
    • Loop - Actions
      • Special Effect - Create a special effect at (Center of (Playable map area)) using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
      • Wait 1.00 seconds
This trigger will spawn that effect per second.

But it is not recommended to use same integer variable per loop.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
Wait or "TriggerSleepAction" does work inside loops. GUI, however, incorrectly labels group iterators as a "loop". Wait does not work inside group iterators.

Thus defskull's example will work as that uses the proper jass loop structures.
JASS:
loop
...
exitwhen boolean // can have many
...
endloop

Superz_Ze_Man's loop is a group iteration which passes a function reference to a function call.
JASS:
function iterate takes nothing returns nothing
...
endfunction

...
call ForGroup(somegroup, function iterate)

As you can see, they are completly different.
 
Status
Not open for further replies.
Top