• 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.

What do you think of my fear spell?

Status
Not open for further replies.
Level 16
Joined
Feb 22, 2006
Messages
960
So i tried to built a wow like fear spell.
It has 3 triggers .

1. trigger to start the ability (first fear)
  • fear
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Fear
    • Actions
      • Unit - Remove Psychic Scream buff from (Target unit of ability being cast)
      • Unit - Remove Intimidating Shout buff from (Target unit of ability being cast)
      • Set TempInt = (Player number of (Owner of (Target unit of ability being cast)))
      • Set fearpoint[TempInt] = ((Position of (Target unit of ability being cast)) offset by 150.00 towards (Random real number between 0.00 and 360.00) degrees)
      • Selection - Clear selection for (Owner of (Target unit of ability being cast))
      • Unit - Order (Target unit of ability being cast) to move to fearpoint[TempInt]
2. Trigger is the main trigger which controls the movement during the fear
  • fear duration
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Set fear_group = (Units in (Playable map area))
      • Unit Group - Pick every unit in fear_group and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If -Conditions
              • ((Picked unit) has buff Fear ) Equal to True
            • Then -Actions
              • Set TempInt = (Player number of (Owner of (Picked unit)))
              • Set fearpoint[TempInt] = ((Position of (Picked unit)) offset by 150.00 towards (Random real number between 0.00 and 360.00) degrees)
              • Selection - Remove (Picked unit) from selection for (Owner of (Picked unit))
              • Unit - Order (Picked unit) to move to fearpoint[TempInt]
            • Else -Actions
      • Custom script: call DestroyGroup(udg_fear_group)
3. Trigger Controls the selection of a the player
  • fear selection
    • Events
      • Player - Player 1 selects a unit
      • Player - Player 2 selects a unit
      • Player - Player 3 selects a unit
      • Player - Player 4 selects a unit
      • Player - Player 5 selects a unit
      • Player - Player 6 selects a unit
      • Player - Player 7 selects a unit
      • Player - Player 8 selects a unit
      • Player - Player 9 selects a unit
      • Player - Player 10selects a unit
    • Conditions
      • ((Triggering unit) has buff Fear ) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Triggering unit)) Equal to (Triggering player)
        • Then - Actions
          • Selection - Remove (Triggering unit) from selection for (Triggering player)
        • Else - Actions
Please coment it =)
 
Level 16
Joined
Feb 22, 2006
Messages
960
re

maybe u know the wow warlock ability fear, this works a little bit like this, the owner of the feared unit cant move his unit, because its runing away, also every 0.5 seconds, the trigger sets a random point where the unit runs next

and the player cant move the unit because he cant select it.
and if the fear is over the unit will stop runing :)
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
I see... Well the idea is good I think, but you still have some leaks to take care of.

->
  • Set fearpoint[TempInt] = ((Position of (Target unit of ability being cast)) offset by 150.00 towards (Random real number between 0.00 and 360.00) degrees)
leaks since you actually have two points in that code, which one is "sub-used"
The fix could be:
  • Set TempPoint = ((Position of (Target unit of ability being cast))
  • Set fearpoint[TempInt] = TemPoint offset by 150.00...
-> The same goes for the second trigger, which is fixed just like above.

-> Also you usually nullify the variables after they're used in the trigger.
(Regarding handle objects such as points, units, players, playergroups, unitgroups...)
(note, integers and reals and values of that kind doesnt need to be nulled)
you could as example nullify your unit group by writing this custom script below, at the end of the trigger:
  • Custom script: set udg_fear_group = null
Otherwise you have fixed the things you can fix in gui...
/Regards

Ps: Read about "things that leak", if you havent done it already.
http://www.hiveworkshop.com/forums/showthread.php?t=35124
 
Status
Not open for further replies.
Top