| 07-06-2006, 01:37 PM | #1 |
Is there a way to make yellow error messages as they're in the standard game? I mean something like "You must select a unit with mana" if you're trying to use Mana Burn on a footman? Something that happens "before you click", but actually you mantain your click? Thanks |
| 07-06-2006, 01:42 PM | #2 |
The closest and easiest way to do it is with SimError. However, this way you lose the click. If you were hugely adamant about maintaining the click, you could try forcing the caster's player to "Force press UI buttom" corresponding to the hotkey of the spell after SimError takes place. To be fair, I've never played with it. I think it's totally within professional bounds to use SimError as is without maintaining the click, and I'm sure most people would agree with me there. |
| 07-06-2006, 01:42 PM | #3 |
Error messages can be replicated. Vex made one that doesn't leak, think it is at wc3jass. |
| 07-06-2006, 01:45 PM | #4 |
*Points to the link in his former post* |
| 07-06-2006, 01:47 PM | #5 |
I don't know if I understood you right, but there exist no event before you click, otherwise how would the event know, when you click next? You mean a selection event? Trigger: Events
![]() Player - Player 1 (Red) Selects a unitEDIT: oh, yes, I got it wrong ![]() |
| 07-06-2006, 01:50 PM | #6 |
Basically, if you really wanted to keep the 'click' up... You could try detecting the "Unit begins casting an ability" event, check if it passes the SimError stuff, if it does not, pause-stop-pause and then force the player to reselect the hero in question and force a UI key corresponding to the spells hotkey. I can't guarantee it will work, but it sounds like it might. Just take note that it really isn't necessary. :P |
| 07-06-2006, 01:53 PM | #7 |
Thank you all, but I'm trying to make an ability which has "dinamic" conditions. It's a spell that can be casted only if the caster has certain requirements and, if he has not, then an error message is shown but, just like in the standard game, the click is unchanged (you can click infinite times getting the error message until the requirements are met), an event which happens just before the click is registered and "stops" the click, doesn't change the mouse pointer shape, doesn't change caster's current orders ecc... Is it possible? Thanks. EDIT: i was posting this before seeing the last Rising Dusk's message, I will try it, but what about changing the unit's current orders? |
| 07-06-2006, 01:57 PM | #8 | |
Dont make this harder than it needs to be. Quote:
Not to mention the only click event is a selection event or the hero abilities button is clicked event. So no, the 'when a mouse is clicked' will not work. You simply need to simulate it and hope it's fast enough. See the quoted stuff above. :P |
| 07-06-2006, 01:58 PM | #9 |
The code has been tested, see the script: http://www.wc3jass.com/viewtopic.php?p=6719. |
| 07-06-2006, 03:31 PM | #10 |
I guess I'll take this opportunity to point out that you are leaking the timer that forces the UI key in that script. |
| 07-06-2006, 04:54 PM | #11 |
Thanks, fixed. |
