• 🏆 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!

[JASS] Fear Request

Status
Not open for further replies.
Level 4
Joined
Jun 19, 2007
Messages
53
Hello.

If its no toruble, I would like to ask that someone makes me a spell that causes units to run around for a few seconds(It doesnt have to level up, just make 'um run around for like 4-5 seconds)(oh, AOE is 300). I know a little bit of Jass but definatly not enough for something of this magitude. Thanks in advance.

Side Note: If anyone knows of any AOS AI tutorials could you link them to me?
 
Level 16
Joined
Feb 22, 2006
Messages
960
this is a fear spell i made some time ago, it's not jass so maybe u undestand it better :)

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]
              • Custom script: call RemoveLocation(udg_fearpoint[TempInt])
            • Else -Actions
      • Custom script: call DestroyGroup(udg_fear_group)
3. Trigger Controls the selection of a 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
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
This works.
But it can be improved, a lot ;)
I will later post.
But for now, in second trigger, remove that if inside the Loop- Actions
Instead change Set fear_group = (Units in (Playable map area))
to Set fear_group = (Units in (Playable map area) matching condition (Matching unit has Buff Fear equal to true) )
(that is a boolean comparison(Tip: always look at the end of comparisons to see what they are)).
This way the stress on the computer will be greatly reduced.
 
Status
Not open for further replies.
Top