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!
Sentinel needs to have vision of the target tree, its a problem because caster just walk in front of the tree and then cast sentinel instead of do the same at 1000 range (cast range of the custom Sentinel). Any way to solution this?
You could make a custom ability based on Channel that is a point target ability. Then trigger it so that a dummy will cast sentinel on the closest tree to the target location.
You could make a custom ability based on Channel that is a point target ability. Then trigger it so that a dummy will cast sentinel on the closest tree to the target location.
Thanks for the reply, nice idea but i need the real ability can target trees, the only viable solution i found is use the GetOrderPointX/Y functions to pick a nearby tree. Thats because sentinel order don't work fine is the tree is out of vision range
See if War Club (mountain giant ability) can target trees you don't have vision of or if it has the same behavior as Sentinel. My guess is that it's a limitation of the game engine just like a unit can't start casting a unit targeted spell if you don't have vision of the target unit.
If War Club works you can just use that with a dummy unit casting the actual sentinel. Why are you opposed to Flux's method?
When a unit casts sentinel at a tree which is not revealed, it actually fires the event "Unit - A unit Is issued an order targeting a point". You can take advantage of that.
[...]and reveal a small area around the tree, so your unit will eventually cast sentinel successfully.
Example:
Reveal tree
Events
Unit - A unit Is issued an order targeting a point
Conditions
(Issued order) Equal to (Order(sentinel))
Actions
Custom script: local fogmodifier fog
Set tpoint = (Target point of issued order)
Custom script: set fog = CreateFogModifierRadiusLoc(GetOwningPlayer(GetTriggerUnit()), FOG_OF_WAR_VISIBLE, udg_tpoint, 200., true, false)
Custom script: call FogModifierStart(fog)
Custom script: call RemoveLocation(udg_tpoint)
Wait 1.00 seconds
Custom script: call DestroyFogModifier(fog)
Custom script: set fog = null
EDIT: Also, the revelation is not instant, and that means your unit will walk a little bit towards the tree. You could work around that by adding some more code above the wait action:
- Disable the trigger
- Detect the closest tree
- Order the unit to stop
- Enable the trigger
- Modify said wait to half of a second
- Disable trigger
- Re-order the unit to cast sentinel at tree
- Enable trigger again
- Wait for another half of a second
- Destroy last created fog modifier
But the down side is that your unit will be interrupting orders every 0.5 second after casting sentinel, which could be annoying for players - hehehe. You can check if the unit current order is "stop", then proceed to recast sentinel.
EDIT 2: Forget EVERYTHING that I've said. This is bullshit - You don't need vision at all. All you have to do is reorder the unit to cast sentinel.
Sentinel ignores fog
Events
Unit - A unit Is issued an order targeting a point
Conditions
(Issued order) Equal to (Order(sentinel))
Actions
-------- Look for the closest tree --------
Set tpoint = (Target point of issued order)
Set maxDistance = 9999.00
Custom script: set bj_destRandomCurrentPick = null
Destructible - Pick every destructible within 200.00 of tpoint and do (Actions)
Loop - Actions
Set treepoint = (Position of (Picked destructible))
Set currentDistance = (Distance between tpoint and treepoint)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
currentDistance Less than maxDistance
Then - Actions
Set maxDistance = currentDistance
Custom script: set bj_destRandomCurrentPick = GetEnumDestructable()
Now if you're afraid of getting a destructable that is not a tree, you can use a dummy (a hidden peasant is enough), and order it to harvest the destructables in the area and check if its current order is "harvest".
When a unit casts sentinel at a tree which is not revealed, it actually fires the event "Unit - A unit Is issued an order targeting a point". You can take advantage of that.
[...]and reveal a small area around the tree, so your unit will eventually cast sentinel successfully.
Example:
Reveal tree
Events
Unit - A unit Is issued an order targeting a point
Conditions
(Issued order) Equal to (Order(sentinel))
Actions
Custom script: local fogmodifier fog
Set tpoint = (Target point of issued order)
Custom script: set fog = CreateFogModifierRadiusLoc(GetOwningPlayer(GetTriggerUnit()), FOG_OF_WAR_VISIBLE, udg_tpoint, 200., true, false)
Custom script: call FogModifierStart(fog)
Custom script: call RemoveLocation(udg_tpoint)
Wait 1.00 seconds
Custom script: call DestroyFogModifier(fog)
Custom script: set fog = null
EDIT: Also, the revelation is not instant, and that means your unit will walk a little bit towards the tree. You could work around that by adding some more code above the wait action:
- Disable the trigger
- Detect the closest tree
- Order the unit to stop
- Enable the trigger
- Modify said wait to half of a second
- Disable trigger
- Re-order the unit to cast sentinel at tree
- Enable trigger again
- Wait for another half of a second
- Destroy last created fog modifier
But the down side is that your unit will be interrupting orders every 0.5 second after casting sentinel, which could be annoying for players - hehehe. You can check if the unit current order is "stop", then proceed to recast sentinel.
EDIT 2: Forget EVERYTHING that I've said. This is bullshit - You don't need vision at all. All you have to do is reorder the unit to cast sentinel.
Sentinel ignores fog
Events
Unit - A unit Is issued an order targeting a point
Conditions
(Issued order) Equal to (Order(sentinel))
Actions
-------- Look for the closest tree --------
Set tpoint = (Target point of issued order)
Set maxDistance = 9999.00
Custom script: set bj_destRandomCurrentPick = null
Destructible - Pick every destructible within 200.00 of tpoint and do (Actions)
Loop - Actions
Set treepoint = (Position of (Picked destructible))
Set currentDistance = (Distance between tpoint and treepoint)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
currentDistance Less than maxDistance
Then - Actions
Set maxDistance = currentDistance
Custom script: set bj_destRandomCurrentPick = GetEnumDestructable()
Now if you're afraid of getting a destructable that is not a tree, you can use a dummy (a hidden peasant is enough), and order it to harvest the destructables in the area and check if its current order is "harvest".
I will try, currently i am using the GetOrderPointX/Y of the point event triggered by sentinel, find the nearest tree and select that tree for my actual trigger.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.