• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

How to detect Messages

Status
Not open for further replies.
Level 13
Joined
Mar 24, 2010
Messages
950
is there a way to trigger or detect when the game says "Unable to target Heroes" it says that in the game interface. I dont want to trigger it i just want to be able to detect in a trigger when the game interface sets that off to display that message to me.
 
Level 13
Joined
Mar 24, 2010
Messages
950
eh i guess i dont necessarily care to know when the game displays that message.

I want to be able to trigger when im "Unable to target that hero" the same time the game knows it and displays that message to me.
like no event triggers the same time i click on a hero with a spell i cant use on that hero, becuz the spell stops me before triggering it. Yet the message still goes off. Thats what i want..

Is there a way to trigger when i cant use a spell on a hero?
The spell wont cast on the hero because the spell wont let it so i need a different way to detect that happening.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
Maker's idea is the only way and it will introduce latency and targeting loss. The message is generated asynchronously based on local client input and as such no other players are aware that a player has even tried to cast an ability on an invalid target. Triggers can only run synchronously unless they are just making interface changes otherwise the game will fall out of synchronization so a asynchronous to synchronous synchronization would be required which would add at least twice lag latency.
 
Level 13
Joined
Mar 24, 2010
Messages
950
I think i see what Maker is trying to do here, make a checker of the units the spell is not allowed to cast on. but in the hard coded object editor data for the spell set it to allow the spell to actually cast on that unit, then stop it if i dont want to allow it.

I cant really do that for this instance. So i guess it cant be done :/
See when a spell is not allowed to cast on a hero it doesnt cast so there is no event. So i cant do anything that can detect that eh?
I was only using that message as an example.
I dont care to get into that really, i just want to be alerted by trigger with an event when a player goes to target a hero with a spell but is denied becuz that spell can not target heros.

I assume there is no way for that? becuz its hard coded in wc to stop it and that message then is displayed. So that leaves no room for any available event to trigger? plz tell me there is some magical way.. lol
 
I don't see the issue with Maker's solution. Just loop around hardcoded problems otherwise a different editor for another game might be more suitable because Wc3 TFT/RoC has a lot of hardcoded issues you'll come across if you continue. Just make the strings in interface one blank/space then trigger/code it by floating text or using simerror or game messages.

EDIT: By the way I think you meant "sigh :("*

EDIT2: You can use getlocalplayer functions to make it for one player only having the text to show too.
 
Level 13
Joined
Mar 24, 2010
Messages
950
lol yea i ment sigh.. i typed that like 630am my time was pretty tired.

also its more so about the purpose of the function not so much the message. i wanted to do something with what i needed. without it working the way i needed i cant do what i planned.
 
Status
Not open for further replies.
Top