| 12-08-2006, 03:47 AM | #1 |
In the GUI trigger editor of the normal WC3 editor, I think to myself, "Boy, it would be great to make an aura that's has a percent chance every second to hurt undead units..." And so, I make my "dummy" spell and I go in the trigger editor. I make a "If real = to blah blah or less then, do this blah blah" trigger. So far so good. I finish my events. Now, to do the event and conditions, I think to myself. As I look for an "Any unit" condition, I think back to StarCraft's trigger editor. Why? 'Cause I can't find "Any unit" as a condition!!! RAWR! WTH! And so now, I come to WC3C to find an answer: is there anyway at all to have a sort of "Any unit" condition as in, "Any unit has specific buff: Aura of Holy Fury." Is there anyway to achieve this? And I mean, ANY way. Different editors, or what? Triggers? JASS? HELP!!! IT'S RUINING ALL MY COOL SPELLS! |
| 12-08-2006, 04:05 AM | #2 |
... Learn JASS. -Av3n |
| 12-08-2006, 04:12 AM | #3 |
You could make your own 'any unit condition', but it would be worthless for this application, as it is simpler and far more efficient to iterate over the units with the buff and damage them appropriately. The simplest way is probably 'get all units with filter buff' followed by 'for all units in group, ...' |
| 12-08-2006, 05:53 AM | #4 |
How about this trigger: Trigger: ![]() Conditions
![]() Actions
![]() ![]() Unit group - Pick every unit in (Units in Playable Map Area) matching ((Matching Unit) Has buff (Your Buff) equal to True) and do (Actions)
![]() ![]() ![]() Loop - Actions
![]() ![]() ![]() ![]() Set Damage_Chance = Random number between 1 and 100
![]() ![]() ![]() ![]() If (All Conditions are True) then do Actions, Else do Actions
![]() ![]() ![]() ![]() If - Conditions
![]() ![]() ![]() ![]() ![]() Damage_Chance is less than or equal to 55 (or whatever your percentage is) Then do actions, else do actions
For future reference, you can trick WE into turning unit-specific actions into generic unit actions with these simple triggers: This is demonstrated in Freakazoid's Floating Text damage with GUI system, which can be found here. |
| 12-08-2006, 11:49 AM | #5 |
Pyrogasm, that's a heavy work for Warcraft. I mean it will be a bit leaky. |
| 12-08-2006, 07:19 PM | #6 | |
You're saying the trigger I posted for him to try is leaky, or the trigger for turning unit-specific commands into any unit commands leaks? I may not have copied it over correctly, but the only thing that leaks on Freakazoid's Floating Text using GUI map is that when the units are added to the trigger it allocates some memory for that. Quote:
So, what's wrong with it then if you don't use it for maybe 1 or 2 spells in a map? |
| 12-08-2006, 07:32 PM | #7 |
it's leaky because you don't store the unit-group into a var an destroy the group afterwards and it's a periodic event. Group Leak + Periodic = Enormous Lagg after some time depending on the intervall. Best way to solve this, learn JASS. |
| 12-08-2006, 08:53 PM | #8 |
Not sure why everyone is telling you to learn JASS, this is an incredibly simple task. Of course you'll want to clean up leaks, which JASS might be better for, but it can easily be done in GUI. Just use something similar to what Pyrogasm posted, using this action: Trigger: Unit group - Pick every unit in (Units in Playable Map Area) matching ((Matching Unit) Has buff (Your Buff) equal to True) and do (Actions) |
| 12-09-2006, 05:14 PM | #10 |
Yes, that would cleanup the leak. |
| 12-09-2006, 08:27 PM | #12 |
Hmmm. I really don't understand anything but the most elementary JASS (the first half of Vex's tutorial is all I've read), but I think I understand what you're saying. If I had multiple groups, would I need only that one line, or would I have to CnP it before every Unit group function? |
| 12-09-2006, 10:45 PM | #13 |
You would have to copy it before every Pick-every-unit-and-do-actions action, since the ForGroupBJ function sets the boolean back to false when it runs. |
