| 07-14-2004, 08:06 PM | #1 |
Okay. I've been given the task to create this hero for a Map. He is supposed to be able to summon gigant bears that will have an 'aura' that makes units that come within range be stunned for 15 secnods. (The map is hosted on a different site, and I wouldn't want to get into... trouble... by posting the link.) I don't know if you can check if a unit comes under the effect of an aura. If that is possible, then this mess I've made here will have been made needlessly. Anyways; the Hero is able to summon two bears who will both have this aura. Annoying part is you can't actually create a <unit comes within (range) of (unit)> even where the (unit)-part can be a variable. It has to be a already created unit. Now I'm jsut making the map, and the units are supposed to be killable, resummonable,, give XP, and stuff like that so I'm not gonna open the box of worms that involve already placing them in the map. Instead I created this horrible messy serie of triggers to try to get it done. Code:
Fearsome Presence Randomize
Events
Time - Elapsed game time is 1.00 seconds
Conditions
Actions
Set FearfulPresence_Variable = (Random integer number between 1 and 10)Code:
Fearful Presence Beorings I
Events
Unit - A unit enters (Entire map)
Conditions
And - All (Conditions) are true
Conditions
(Unit-type of (Entering unit)) Equal to Beorning (Level 4)
(Unit-type of (Entering unit)) Equal to Beorning (Level 5)
Actions
Trigger - Add to Fearsome Presence Cast I <gen> the event (Unit - A unit comes within 600.00 of FearfulPresence_Beoring_I)
Set FearfulPresence_Beoring_I = (Last created unit)
Trigger - Turn off (This trigger)
Trigger - Turn on Fearful Presence Beorings II <gen>Code:
Fearful Presence Beorings II
Events
Unit - A unit enters (Entire map)
Conditions
And - All (Conditions) are true
Conditions
(Unit-type of (Entering unit)) Equal to Beorning (Level 4)
(Unit-type of (Entering unit)) Equal to Beorning (Level 5)
Actions
Trigger - Add to Fearsome Presence Cast II <gen> the event (Unit - A unit comes within 600.00 of FearfulPresence_Beoring_II)
Set FearfulPresence_Beoring_II = (Last created unit)
Trigger - Turn off (This trigger)
Trigger - Turn on Fearful Presence Beorings I<gen>Code:
Fearful Presence Beorings I x2
Events
Unit - A unit enters (Entire map)
Conditions
And - All (Conditions) are true
Conditions
(Unit-type of (Entering unit)) Equal to Beorning (Level 4)
(Unit-type of (Entering unit)) Equal to Beorning (Level 5)
Actions
Set FearfulPresence_Beoring_I = (Last created unit)
Trigger - Turn off (This trigger)
Trigger - Turn on Fearful Presence Beorings II x2 <gen>Code:
Fearful Presence Beorings II x2
Events
Unit - A unit enters (Entire map)
Conditions
And - All (Conditions) are true
Conditions
(Unit-type of (Entering unit)) Equal to Beorning (Level 4)
(Unit-type of (Entering unit)) Equal to Beorning (Level 5)
Actions
Set FearfulPresence_Beoring_II = (Last created unit)
Trigger - Turn off (This trigger)
Trigger - Turn on Fearful Presence Beorings I x2 <gen>Code:
Fearsome Presence Cast I
Events
Conditions
((Triggering unit) belongs to an enemy of (Owner of FearfulPresence_Beoring_I)) Equal to True
Actions
Set FearfulPresence_EnteringUnit = (Entering unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
((Unit-type of (Triggering unit)) is A flying unit) Equal to True
((Unit-type of (Triggering unit)) is Mechanical) Equal to True
((Unit-type of (Triggering unit)) is An Ancient) Equal to True
((Unit-type of (Triggering unit)) is A town-hall-type unit) Equal to True
((Unit-type of (Triggering unit)) is A sapper) Equal to True
((Unit-type of (Triggering unit)) is A structure) Equal to True
Then - Actions
Do nothing
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
FearfulPresence_Variable Equal to 1
Then - Actions
Unit - Order FearfulPresence_Beoring_I to Human Mountain King - Storm Bolt FearfulPresence_EnteringUnit
Set FearfulPresence_Variable = (Random integer number between 1 and 10)
Else - Actions
Set FearfulPresence_Variable = (Random integer number between 1 and 10)Code:
Fearsome Presence Cast II
Events
Conditions
((Triggering unit) belongs to an enemy of (Owner of FearfulPresence_Beoring_I)) Equal to True
Actions
Set FearfulPresence_EnteringUnit = (Entering unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
((Unit-type of (Triggering unit)) is A flying unit) Equal to True
((Unit-type of (Triggering unit)) is Mechanical) Equal to True
((Unit-type of (Triggering unit)) is An Ancient) Equal to True
((Unit-type of (Triggering unit)) is A town-hall-type unit) Equal to True
((Unit-type of (Triggering unit)) is A sapper) Equal to True
((Unit-type of (Triggering unit)) is A structure) Equal to True
Then - Actions
Do nothing
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
FearfulPresence_Variable Equal to 1
Then - Actions
Unit - Order FearfulPresence_Beoring_II to Human Mountain King - Storm Bolt FearfulPresence_EnteringUnit
Set FearfulPresence_Variable = (Random integer number between 1 and 10)
Else - Actions
Set FearfulPresence_Variable = (Random integer number between 1 and 10)Yeah. So I gave the summons an ability based of Orb of Lightning (new), so that they have the 'storm bolt'-based ability, but can't actually use it. I get confused easily... and I've managed to confuse myself with this trigger. It should be working, but it doesn't seem to do anything at all, other than lag for 0.1 second when the units are summoned... Anybody who are capable of telling me how much smarter they are then me, by explaining to me what on Earth I've done worn, I will thank from the bottom of my... body... whatever. I will thank them. |
| 07-15-2004, 03:38 PM | #2 |
Well, buff detection is REALLY sloppy , but you can give it a shot. Every .5 seconds, you need to pick every unit on the map with your custom buff, and then if they don't ALREADY have the stun buff, stun them. I wouldn't suggest using this method, as it is really sloppy. :/ |
| 07-15-2004, 03:52 PM | #3 | |
Quote:
Unit group - for each unit in (units in region(region centered on (bear) with size (size of aura)) if (picked unit) not equal to (bear) then Unit - Order (bear) to Human Mountain King - Storm Bolt (picked unit) end if Seems easy enough, and unless I have made a horrible mistake that should work. Edit: You might want to set units in region(region centered on (bear) with size (size of aura) to a unit group variable, and to unit group - for each unit in (unitgroup) And then at the end destroy the group. |
| 07-15-2004, 05:57 PM | #4 |
I think your mistake lies in the fact that you think that after creating a specific unit event with a variable, the event points to that variable. Now, i've seen others do this, so I can't really be sure that it isn't right, but to my understanding, a specific unit event is a specific unit event. It will point to a specific unit. So, when you create a specific unit event with a variable, it will still be specific, it will point to the unit that was at that moment in the variable, even if the variable changes. This would mean that for every bear that is summoned, you need to add a new event to the trigger. But on the other hand, specific unit events are, well, very specific, and as such require low system resources. That means that creating a new event for every bear made could still be bearable (get it, bearable :) ) as far as lag and memory usage are concerned. Of course, having no practical experience here, I can't say for certain, lag issues should be cleared with those who know the workings of the warcraft 3 event engine better. If you did things this way, you would require only two triggers: one without events that stuns units that come in range and the other that adds events to the first trigger whenever a bear is summoned (use generic unit event "a unit spawns a summoned unit" rather than "a unit enters map"; in this case, use the event response "summoned unit"). An alternative way of writing the triggers would be a periodic trigger that checks all the units that are in range and compares that with a list of units that were previously in range; then it removes from the later unit group those units that were previously in range, but aren't now, and adds to the group those units, that weren't on the list before, but are in range now. It also applies stun to these new units (and, of course, it doesn't apply stun to those units that are in range now, but were already in range before too, unless they got out of range in the meantime). You would need a unit group variable for every bear, and an additional temp unit group variable to check for units currently in range.... tell you what, if you decide to go with this solution, I'll write you the triggers. And another thing about stuning; you are doing it wrong, it's not done with the orb ability, well, it could be done, but not the way you're doing it. Orbs are used to add spells to attacks. Here, you want the spell to be cast under special triggered circumstances, not on an attack, so the proper way of doing this is with dummy casters. |
| 07-16-2004, 08:11 AM | #5 |
I know that dummy casters is the way to go, but when I did that the map would lag whenever a unit got stunned by the aura (when I tested it with a spesific unit). Thank you all or your advice. Now to see if I can get it to work. ![]() |
