• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

How to detected order unit player

Status
Not open for further replies.
Level 2
Joined
Nov 6, 2012
Messages
15
How to detected unit ordering player

How can i detect the unit ordering player form unit share by another player that mean that order unit is not own by the order player
Need help thank because it use to spell ability for sold item to player

Question like this for example situation:
Player 2 share unit with full control with player 1 (By using Trigger)
Player 1 Order player 2 unit to cast a spell
--How can I detect the player 1 when player 2 unit is order cast spell by player 1

or any suggestion that can use the GUI or jass to detect order unit player

Need Help for this thank
 
Last edited:
Level 12
Joined
Oct 16, 2010
Messages
680
try this

  • Events
    • Unit - a unit is issued an order
    • Unit - a unit is issued a point order
    • Unit - a unit is issued a target order
  • Conditions
  • Actions
    • Custom script: call BJDebugMsg(GetPlayerName(GetTriggerPlayer()))
if it shows your name, then u can refer to the player who had given the order with (Triggering Player)
I would test it if I were at home:D
 
Level 2
Joined
Nov 6, 2012
Messages
15
try this

  • Events
    • Unit - a unit is issued an order
    • Unit - a unit is issued a point order
    • Unit - a unit is issued a target order
  • Conditions
  • Actions
    • Custom script: call BJDebugMsg(GetPlayerName(GetTriggerPlayer()))
if it shows your name, then u can refer to the player who had given the order with (Triggering Player)
I would test it if I were at home:D

sorry about that not work for detecting the unit ordering player
 
No JASS code is able truely to detect it. You have to find a work around.

There exists a (maybe small) chance, that you can evaluate the player by checking a conditon for each player: "Is <YourUnit> selected by Player X".
If the condition is true for only one player, you can see it as the "OrderingPlayer".

You can add an extra condition, to ensure that the checked player does have control over <YourUnit>. Because even if one player has a unit selected, if he has no control, he is unable to order it. So this could increase your chance as well.

How ever, I don't think it makes much sense to implement this if you want a working system.... it's more like random.
 
Level 2
Joined
Nov 6, 2012
Messages
15
No JASS code is able truely to detect it. You have to find a work around.

There exists a (maybe small) chance, that you can evaluate the player by checking a conditon for each player: "Is <YourUnit> selected by Player X".
If the condition is true for only one player, you can see it as the "OrderingPlayer".

You can add an extra condition, to ensure that the checked player does have control over <YourUnit>. Because even if one player has a unit selected, if he has no control, he is unable to order it. So this could increase your chance as well.

How ever, I don't think it makes much sense to implement this if you want a working system.... it's more like random.

reply solution mean only can detect one share unit player only. Actually that condition and situation may happen if more than one player share unit if may fail for detecting.

thank for request but finally i know how to work actually thank. Thank for request no change for detecting unit ordering player. That only have noob way for my spell item purchase for detecting by create 5 dummy unit for each player and player call dummy active spell for purchase item.
 
Status
Not open for further replies.
Top