- Joined
- Oct 9, 2015
- Messages
- 721
How can I make aquisition range ignore units behind? I want to make so that a unit that is lurking behind doesn't get caught or seen by the aquisition range.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Stealth Debug

Events


Unit - A unit enters (Playable map area)

Conditions

Actions


Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)



Loop - Actions




Trigger - Add to Stealth 1 <gen> the event (Unit - (Picked unit) Acquires a target)
Stealth 1

Events

Conditions

Actions


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




((Facing of (Triggering unit)) + 120.00) Greater than or equal to (Facing of (Targeted unit))




((Facing of (Triggering unit)) - 120.00) Less than or equal to (Facing of (Targeted unit))



Then - Actions




Unit - Order (Triggering unit) to Hold Position



Else - Actions
Stealth 1 has incorrect angle test logic? Where is the angle between triggering and targeted unit computed? I do not think it handles angular wrap around correctly.I have come up with the following triggers:
It does not factor in angular wrap around and uses the facing of the targeted unit instead of the angle between triggering unit and target unit.It is set to 120 so the unit can't also see from it's sides, only in front.
Technically you can set vision range to 0 and give to all units the dummy with vision range. The dummy unit would moved to a front of the unit.How can I make aquisition range ignore units behind? I want to make so that a unit that is lurking behind doesn't get caught or seen by the aquisition range.
((Cos((Angle from (Position of (Triggering unit)) to (Position of (Targeted unit))))) - (Facing of (Triggering unit))) Less than or equal to (Cos(120.00))
I mean set vision range to 0. and create dummy with vision range which get moved on front of the each unit.Fruit Forest: If I set the Sight Radius stat to 0 the unit still attacks because of it's aquisition range, if the acquisition range is set to 0, then the unit won't attack neither units in front or in the back
You need to create visible modifier then enable it.I tried to deactivate blackmask and fog of war for 1 player only with GetLocalPlayer but had no success.
The vision range can't be regulated with triggers, but you may use item bonus which increases vision sight. Create more such abilities and add it to dummy unit according to their acquistion range.It works now, who would dare to say it was such a easy sulution. Now the only problem is: How I will set the dummy unit vision (sight radius) to be equal to the unit's acquisition range?
Goblin scope item ability is the right ability. (Find Goblin scope in the item list and determine its item ability) It doesn't leveled so you have to create more abilities with various values of vision sight.you know which ability has that? I look for goblin scope and found nothing.
It is "Cos(angle - angle)" not "Cos(angle) - angle". The angle difference has to be fed into the cosine function for it to make any sense.Dr Super Good condition returns true either if the unit is behind or front, maybe I did something wrong:
Stealth Debug

Events


Time - Elapsed game time is 1.00 seconds

Conditions

Actions


Player Group - Pick every player in (All players controlled by a User player) and do (Actions)



Loop - Actions




Visibility - Create an initially Enabled visibility modifier for (Picked Player) emitting Visibility across (Playable map area)
Stealth Periodic

Events


Time - Every 0.50 seconds of game time

Conditions

Actions


Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)



Loop - Actions




If (All Conditions are True) then do (Then Actions) else do (Else Actions)





If - Conditions






DummyVision[(Custom value of (Picked unit))] Equal to No unit





Then - Actions






Set Loc1 = ((Position of (Picked unit)) offset by (Current acquisition range of (Picked unit)) towards (Facing of (Picked unit)) degrees)






Unit - Create 1 Dummy Unit for (Owner of (Picked unit)) at Loc1 facing Default building facing degrees






Set DummyVision[(Custom value of (Picked unit))] = (Last created unit)






Custom script: call RemoveLocation(udg_Loc1)





Else - Actions






If (All Conditions are True) then do (Then Actions) else do (Else Actions)







If - Conditions








VisionAdjust[(Custom value of DummyVision[(Custom value of (Picked unit))])] Equal to False







Then - Actions








Set Loc1 = ((Position of (Picked unit)) offset by (Current acquisition range of (Picked unit)) towards (Facing of (Picked unit)) degrees)








Unit - Move DummyVision[(Custom value of (Picked unit))] instantly to Loc1








Set VisionInteger = (Integer((Current acquisition range of (Picked unit))))








Set Some_Unit = DummyVision[(Custom value of (Picked unit))]








Trigger - Run Stealth Vision <gen> (ignoring conditions)








Custom script: call RemoveLocation(udg_Loc1)







Else - Actions
Stealth Vision

Events

Conditions

Actions


Set VisionInteger = (VisionInteger - (Integer((Current acquisition range of Some_Unit))))


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




VisionInteger Greater than 0



Then - Actions




Set Loop_Integer = ((VisionInteger - (VisionInteger mod 100)) / 100)




For each (Integer A) from 1 to Loop_Integer, do (Actions)





Loop - Actions






Unit - Add Vision to Some_Unit






Unit - Set level of Vision for Some_Unit to 4






Unit - Remove Vision from Some_Unit




Set VisionInteger = (VisionInteger mod 100)




Set Loop_Integer = ((VisionInteger - (VisionInteger mod 10)) / 10)




For each (Integer A) from 1 to Loop_Integer, do (Actions)





Loop - Actions






Unit - Add Vision to Some_Unit






Unit - Set level of Vision for Some_Unit to 3






Unit - Remove Vision from Some_Unit




Set VisionInteger = (VisionInteger mod 10)




For each (Integer A) from 1 to Max_Hp, do (Actions)





Loop - Actions






Unit - Add Vision to Some_Unit






Unit - Set level of Vision for Some_Unit to 2






Unit - Remove Vision from Some_Unit



Else - Actions




Set VisionInteger = (0 - VisionInteger)




Set Loop_Integer = ((VisionInteger - (VisionInteger mod 100)) / 100)




For each (Integer A) from 1 to Loop_Integer, do (Actions)





Loop - Actions






Unit - Add Vision to Some_Unit






Unit - Set level of Vision for Some_Unit to 7






Unit - Remove Vision from Some_Unit




Set VisionInteger = (VisionInteger mod 100)




Set Loop_Integer = ((VisionInteger - (VisionInteger mod 10)) / 10)




For each (Integer A) from 1 to Loop_Integer, do (Actions)





Loop - Actions






Unit - Add Vision to Some_Unit






Unit - Set level of Vision for Some_Unit to 6






Unit - Remove Vision from Some_Unit




Set VisionInteger = (VisionInteger mod 10)




For each (Integer A) from 1 to Max_Hp, do (Actions)





Loop - Actions






Unit - Add Vision to Some_Unit






Unit - Set level of Vision for Some_Unit to 5






Unit - Remove Vision from Some_Unit


Set VisionAdjust[(Custom value of Some_Unit)] = True