• 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!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Spell] Sentinel (Naisha) problem....

Status
Not open for further replies.

FSB

FSB

Level 6
Joined
Jun 8, 2009
Messages
40
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?
 

FSB

FSB

Level 6
Joined
Jun 8, 2009
Messages
40
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
 
Level 42
Joined
Feb 27, 2007
Messages
5,328
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?
 
Level 13
Joined
May 10, 2009
Messages
868
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()
            • Else - Actions
          • Custom script: call RemoveLocation(udg_treepoint)
      • Custom script: call RemoveLocation(udg_tpoint)
      • -------- Reorder unit to cast sentinel --------
      • Custom script: call IssueTargetOrder(GetTriggerUnit(), "sentinel", bj_destRandomCurrentPick)
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".
 
Last edited:

FSB

FSB

Level 6
Joined
Jun 8, 2009
Messages
40
Thanks to everyone for the replies guys, awesome comunuty.

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()
            • Else - Actions
          • Custom script: call RemoveLocation(udg_treepoint)
      • Custom script: call RemoveLocation(udg_tpoint)
      • -------- Reorder unit to cast sentinel --------
      • Custom script: call IssueTargetOrder(GetTriggerUnit(), "sentinel", bj_destRandomCurrentPick)
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.
 
Status
Not open for further replies.
Top