[Request] Fear System

Wander make units flee when attacked, they turn to slow, no ward classification and you can order them to do other things. That does pretty much nothing of what I want.

If only you were as experienced as me...

I repeat:
Add Wander,
Set Movement Speed to 522,
Add ward classification,
In object editor change Wander ability settings.
Add some sfx.

Thats all.
 
hm you can try this, works fine for me:

3 triggers, first one adds target to a group:

Trigger:
  • Cast Fear
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Slow
    • Actions
      • Unit Group - Add (Target unit of ability being cast) to FearUnits


Second one issues move order every few seconds it also checks if the unit has a specific buff, if not it will be removed from the group.

Trigger:
  • Fear
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in FearUnits and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Slow) Equal to True
            • Then - Actions
              • Set TempLoc = (Position of (Picked unit))
              • Set TempLoc2 = (TempLoc offset by 500.00 towards (Random real number between 0.00 and 360.00) degrees)
              • Trigger - Turn off Fear Orders <gen>
              • Unit - Order (Picked unit) to Move To TempLoc2
              • Trigger - Turn on Fear Orders <gen>
              • Custom script: call RemoveLocation(udg_TempLoc)
              • Custom script: call RemoveLocation(udg_TempLoc2)
            • Else - Actions
              • Unit Group - Remove (Picked unit) from FearUnits


3. whenever theres an order given which is not ordered by the trigger above give a new move order (intercepts all things the owner wants to do, making the unit uncontrollable):

Trigger:
  • Fear Orders
    • Events
      • Unit - A unit Is issued an order targeting an object
      • Unit - A unit Is issued an order targeting a point
      • Unit - A unit Is issued an order with no target
    • Conditions
      • ((Triggering unit) is in FearUnits) Equal to True
    • Actions
      • Set TempLoc = (Position of (Triggering unit))
      • Set TempLoc2 = (TempLoc offset by 500.00 towards (Random real number between 0.00 and 360.00) degrees)
      • Trigger - Turn off (This trigger)
      • Unit - Order (Triggering unit) to Move To TempLoc2
      • Trigger - Turn on (This trigger)
      • Custom script: call RemoveLocation(udg_TempLoc)
      • Custom script: call RemoveLocation(udg_TempLoc2)


think you can add ward calssification by yourself (coz i dont know how in gui [and neither in jass atm] :p). If you want the demo map tell me :)
 
warden13: What fucking changes would I do with wander? There aren't any obvious values you can change. And even if I add wander, how can I stop player control? You can still order smart with ward classified units...

DonRoman: Their good triggers, but with them you can decide where to travel with fear by simply spamming order moves when the feared unit runs toward a point you dont want it to run to.
 
alright then for the complicated way. :/

1st trigger stores the unit and a random location in an array.

Trigger:
  • Cast Fear Co
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Slow
    • Actions
      • Set FearCount = (FearCount + 1)
      • Set FearUnit[FearCount] = (Target unit of ability being cast)
      • Set TempLoc = (Position of (Target unit of ability being cast))
      • Set FearLocation[FearCount] = (TempLoc offset by 500.00 towards (Random real number between 0.00 and 360.00) degrees)
      • Unit - Order (Target unit of ability being cast) to Move To FearLocation[FearCount]
      • Custom script: call RemoveLocation(udg_TempLoc)


2. trigger periodically loops through all arrays and checks if the unit has reached the target, then it will be ordered to a new target. If the buff is gone if so its array will be receycled.

Trigger:
  • Cast Fear Complicated
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to FearCount, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (FearUnit[(Integer A)] has buff Slow) Equal to True
            • Then - Actions
              • Set TempLoc = (Position of FearUnit[(Integer A)])
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Distance between TempLoc and FearLocation[(Integer A)]) Less than or equal to 100.00
                • Then - Actions
                  • Set FearLocation[(Integer A)] = (TempLoc offset by 500.00 towards (Random real number between 0.00 and 360.00) degrees)
                • Else - Actions
              • Unit - Order FearUnit[(Integer A)] to Move To FearLocation[(Integer A)]
              • Custom script: call RemoveLocation(udg_TempLoc)
            • Else - Actions
              • Set FearUnit[(Integer A)] = FearUnit[FearCount]
              • Custom script: call RemoveLocation(udg_FearLocation[bj_forLoopAIndex])
              • Set FearLocation[(Integer A)] = FearLocation[FearCount]
              • Set FearCount = (FearCount - 1)
              • Custom script: set bj_forLoopAIndex = bj_forLoopAIndex - 1


theres not much more i can think of. again i can send you the demo map which contains both triggers.
 

Attachments

  • Demo Map Fear System.w3x
    18.5 KB · Views: 155
Well isn't that trigger the same as Taunt? Taunt does the same thing but not need for complicated triggers. I dunno whats the problem
 
Well isn't that trigger the same as Taunt? Taunt does the same thing but not need for complicated triggers. I dunno whats the problem

No.

Taunt:
1. AoE effect, how would you make it for each unit individually and MUI?
2. you need a dummy to cast it (has to be visible and vulnerable i think but not sure).
3. you can control taunted units if you give them a new order.

I cant imagine a way for taunt to work here, can you explain it to me? :)
 
Good way to do it, DonRoman. I wouldn't have thought of that, +rep!

Edit: I changed it to fit my needs, and this is how it turned out:

Trigger:
  • A Fear
    • Events
    • Conditions
    • Actions
      • Set Fear_Count = (Fear_Count + 1)
      • Set A_Point[1] = (Position of Target)
      • Set Fear_Unit[Fear_Count] = Target
      • Set Fear_Point[Fear_Count] = (A_Point[1] offset by (Random real number between 150.00 and 500.00) towards (Random real number between 0.00 and 360.00) degrees)
      • Unit - Order Target to Move To Fear_Point[Fear_Count]


Trigger:
  • A Fear Periodically Movement
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to Fear_Count, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Fear_Unit[(Integer A)] has buff Physic Scream ) Equal to True
            • Then - Actions
              • Set A_Point[1] = (Position of Fear_Unit[(Integer A)])
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Distance between A_Point[1] and Fear_Point[(Integer A)]) Less than or equal to 100.00
                • Then - Actions
                  • Custom script: call RemoveLocation(udg_Fear_Point[bj_forLoopAIndex])
                  • Set Fear_Point[(Integer A)] = (A_Point[1] offset by (Random real number between 150.00 and 500.00) towards (Random real number between 0.00 and 360.00) degrees)
                • Else - Actions
                  • Set Fear_TimeNoAction[(Integer A)] = (Fear_TimeNoAction[(Integer A)] + 0.03)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Fear_TimeNoAction[(Integer A)] Equal to (Random real number between 2.00 and 3.00)
                    • Then - Actions
                      • Custom script: call RemoveLocation(udg_Fear_Point[bj_forLoopAIndex])
                      • Set Fear_Point[(Integer A)] = (A_Point[1] offset by (Random real number between 150.00 and 500.00) towards (Random real number between 0.00 and 360.00) degrees)
                    • Else - Actions
              • Unit - Order Fear_Unit[(Integer A)] to Move To Fear_Point[(Integer A)]
              • Custom script: call RemoveLocation(udg_A_Point[1])
            • Else - Actions
              • Unit - Order Fear_Unit[(Integer A)] to Stop
              • Set Fear_Unit[(Integer A)] = Fear_Unit[Fear_Count]
              • Custom script: call RemoveLocation(udg_Fear_Point[bj_forLoopAIndex])
              • Set Fear_Point[(Integer A)] = Fear_Point[Fear_Count]
              • Set Fear_Count = (Fear_Count - 1)
              • Custom script: set bj_forLoopAIndex = bj_forLoopAIndex - 1


Example on how I use it:
Trigger:
  • Physic Scream
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Physic Scream
    • Actions
      • Set A_Point[1] = (Position of (Triggering unit))
      • Set A_Unitgroup[1] = (Units within 500.00 of A_Point[1] matching ((((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True) and (((Matching unit) is alive) Equal to True)))
      • Set A_Unitgroup[2] = (Random 3 units from A_Unitgroup[1])
      • Unit Group - Pick every unit in A_Unitgroup[2] and do (Actions)
        • Loop - Actions
          • Unit - Create 1 Dummy Unit for (Owner of (Triggering unit)) at A_Point[1] facing Default building facing degrees
          • Unit - Add [Dummy] Physic Scream (Priest) to (Last created unit)
          • Unit - Order (Last created unit) to Undead Necromancer - Cripple (Picked unit)
          • Set Target = (Picked unit)
          • Trigger - Run A Fear <gen> (checking conditions)
      • Custom script: call RemoveLocation (udg_A_Point[1])
      • Custom script: call DestroyGroup(udg_A_Unitgroup[1])
      • Custom script: call DestroyGroup(udg_A_Unitgroup[2])


Now, is there any reason why this would only work once? Because the units only get feared from the first cast.
 
in the demo map it works good, but I think making a trigger with the events: An unit is issued an order is needed to do this thing, you can simply spam stop or hold pos to slow down your unit
 
I can fix that later, first of all I would like to solve the current problem.
 
Try to remove that timer thing in your trigger, I don't see any other changes that would cause your trigger not to work
 
Why should I remove the timer? Then units wont get new destination locations. If I change the event to issued order events, the units will only get new locations when you order them somewhere.
 
I'm talking about that custom: Set Fear_TimeNoAction[(Integer A)] = (Fear_TimeNoAction[(Integer A)] + 0.03) thingie
 
Owe, good idea, i'll check that :)

Edit: Wasn't that, I fixed it myself though. New trigger:

Trigger:
  • A Fear
    • Events
    • Conditions
    • Actions
      • Set A_Point[1] = (Position of Target)
      • Set Fear_Count = (Fear_Count + 1)
      • Set Fear_Unit[Fear_Count] = Target
      • Set Fear_TimeNoAction[Fear_Count] = 0.00
      • Set Fear_Point[Fear_Count] = (A_Point[1] offset by (Random real number between 150.00 and 500.00) towards (Random real number between 0.00 and 360.00) degrees)
      • Unit - Order Target to Move To Fear_Point[Fear_Count]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Fear_Count Equal to 20
        • Then - Actions
          • Set Fear_Count = 1
        • Else - Actions


Trigger:
  • A Fear Periodically Movement
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 20, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Fear_Unit[(Integer A)] Not equal to No unit
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (Fear_Unit[(Integer A)] has buff Physic Scream ) Equal to True
                • Then - Actions
                  • Set A_Point[1] = (Position of Fear_Unit[(Integer A)])
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Distance between A_Point[1] and Fear_Point[(Integer A)]) Less than or equal to 100.00
                    • Then - Actions
                      • Custom script: call RemoveLocation(udg_Fear_Point[bj_forLoopAIndex])
                      • Set Fear_Point[(Integer A)] = (A_Point[1] offset by (Random real number between 150.00 and 500.00) towards (Random real number between 0.00 and 360.00) degrees)
                    • Else - Actions
                      • Set Fear_TimeNoAction[(Integer A)] = (Fear_TimeNoAction[(Integer A)] + 0.03)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Fear_TimeNoAction[(Integer A)] Equal to (Random real number between 2.00 and 3.00)
                        • Then - Actions
                          • Custom script: call RemoveLocation(udg_Fear_Point[bj_forLoopAIndex])
                          • Set Fear_Point[(Integer A)] = (A_Point[1] offset by (Random real number between 150.00 and 500.00) towards (Random real number between 0.00 and 360.00) degrees)
                        • Else - Actions
                  • Unit - Order Fear_Unit[(Integer A)] to Move To Fear_Point[(Integer A)]
                  • Custom script: call RemoveLocation(udg_A_Point[1])
                • Else - Actions
                  • Unit - Order Fear_Unit[(Integer A)] to Stop
                  • Set Fear_Unit[(Integer A)] = No unit
                  • Custom script: call RemoveLocation(udg_Fear_Point[bj_forLoopAIndex])
            • Else - Actions
 
Why don't you ask Gex , the creator of CF ? I wonder if he could show you a template or give an unprotected CF for testing purposes .
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • 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 The Helper:
    I would like to see it again like Ghan had it the first time with pagination though - without the pagination that view will not work but with pagination it just might...
  • The Helper The Helper:
    This drink recipe I have had more than a few times back in the day! Mind Eraser https://www.thehelper.net/threads/cocktail-mind-eraser.194720/

      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