[Request] Fear System

warden13

New Member
Reaction score
32
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.
 

DonRoman

New Member
Reaction score
5
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 :)
 

Leazy

You can change this now in User CP.
Reaction score
50
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.
 

DonRoman

New Member
Reaction score
5
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: 153

Igor_Z

You can change this now in User CP.
Reaction score
61
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
 

DonRoman

New Member
Reaction score
5
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? :)
 

Leazy

You can change this now in User CP.
Reaction score
50
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.
 

Nexor

...
Reaction score
74
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
 

Leazy

You can change this now in User CP.
Reaction score
50
I can fix that later, first of all I would like to solve the current problem.
 

Nexor

...
Reaction score
74
Try to remove that timer thing in your trigger, I don't see any other changes that would cause your trigger not to work
 

Leazy

You can change this now in User CP.
Reaction score
50
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.
 

Nexor

...
Reaction score
74
I'm talking about that custom: Set Fear_TimeNoAction[(Integer A)] = (Fear_TimeNoAction[(Integer A)] + 0.03) thingie
 

Leazy

You can change this now in User CP.
Reaction score
50
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
 

roXplosive

New Member
Reaction score
15
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.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      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