| 12-01-2004, 02:52 AM | #1 |
Hi, I am making a map that has many things in it that will give any near by unit evasion at a short distance, can this be done without getting into triggers? And if so, how do I do it if there are a LOT of things on the map(many will be the same type though). The specific example is this. I have a building with a whole bunch of rooms with desks etc, and I want the players to be able to get Partial Cover (Evasion) from being close enough to it so that they get a certain % chance of having a bullet from an opponent miss. How do I do this? If I have to use triggers, so be it, but It would make it much easier to have a neutral player own the desks as units, and give off the aura to any friendly unit within range. So... any ideas? |
| 12-01-2004, 07:00 AM | #2 |
Could do an evasion aura. First base it off some other aura with no propertys just neccasary art. Then make a trigger, that detects when a unit is under the effect ur aura.... then make an evasiion ability with no icon, simply add the ability to each unit under effect and then take it away when there outa range. |
| 12-01-2004, 03:34 PM | #3 |
Guest | i am not sure it can be done even WITH triggers! but anyway give it a shot-nothing to lose there... but if it can be done i offer you to use the "big bad voodo" spell base...he is the most close from all things... |
| 12-01-2004, 04:11 PM | #4 |
Seriouslly, if you don't know what the hell you're on about, please don't say anything at all. It can be done, but it may be a bit laggy. Make these: Dummy ability for the aura, with custom buff and no effect except buff. Evasion ability (if based off of item might not show up). EvasionAuraGroupRun unit group variable. EvasionAuraGroupSave unit group variable. Ok, first of all, use a timer/periodic variable for the event (make it about every second), or add a wait at the end and then run the trigger again (run it at start up if you do this to set it off, then don't run it again). Empty EvasionAuraGroupRun (destroy it to stop memory leak) Next, add every unit within range of the units with the ability that match the condition have the buff of a dummy aura, the EvasionAuraGroupRun, and are not in unit group EvasionAuraGroupSave. Pick every unit in unit group EvasionAuraGroupSave If - picked unit is in unit group EvasionAuraGroupRun is equal to true Then - Do nothing Else - Remove Evasion from picked unit. Pick every unit in unit group EvasionAuraGroupRun Add ability Evasion to picked unit. Add unit group EvasionAuraGroupRun to EvasionAuraGroupSave. That is it. |
| 12-01-2004, 04:49 PM | #5 |
darky has already created an aura template which allows you make nearly any aura you need. and yes it is written in jass. edit: sorry an "in" was missing |
| 12-01-2004, 05:43 PM | #6 |
Why jass? You don't need JASS, so why use it for a template? |
| 12-01-2004, 05:47 PM | #7 |
look in the bnet forums for the thread "why jass" and read it carefully. the template is easy to configure and works flawless even in mp and with multiple auras. |
| 12-01-2004, 06:59 PM | #8 | |
Quote:
This is the easiest way to do this. Eg. Events: Every 1 second. Actions: remove evasion from all units in udg_AffectedUnitGroup Destroy the unitgroup udg_AffectedUnitGroup set udg_AffectedUnitGroup = Units on map which have the aura buff add evasion to all units in udg_AffectedUnitGroup |
| 12-02-2004, 01:58 AM | #9 |
Hey sweet, it works. I am using Command Aura. Here is the code I made. Evasion is the unit group name, and the ability. Melee Initialization Events Time - Every 1.00 seconds of game time Conditions Actions Unit Group - Pick every unit in Evasion and do (Actions) Loop - Actions If (All Conditions are True) then do (Then Actions) else do (Else Actions) If - Conditions ((Picked unit) has buff Command Aura) Equal to True Then - Actions Else - Actions Unit - Remove Evasion from (Picked unit) Unit Group - Remove all units from Evasion Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions) Loop - Actions If (All Conditions are True) then do (Then Actions) else do (Else Actions) If - Conditions ((Picked unit) has buff Command Aura) Equal to True Then - Actions Unit Group - Add (Picked unit) to Evasion Unit - Add Evasion to (Picked unit) Else - Actions Oh and hey, when you say "delete the unit group", do you mean clear it? That's what I did here, but if that's not right, just correct me. |
| 12-02-2004, 12:06 PM | #10 |
Destroying a group means calling the custom script call DestroyGroup( [GROUPNAME] ), otherwise it will leak. In your particular case your trigger should be modified to Code:
Melee Initialization
Events
Time - Every 1.00 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in Evasion and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked unit) has buff Command Aura) Equal to True
Then - Actions
Else - Actions
Unit - Remove Evasion from (Picked unit)
Unit Group - Remove all units from Evasion
[b]set tmp_unitgroup = (Units in (Playable map area))
Unit Group - Pick every unit in tmp_unitgroup and do (Actions)[/b]
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked unit) has buff Command Aura) Equal to True
Then - Actions
Unit Group - Add (Picked unit) to Evasion
Unit - Add Evasion to (Picked unit)
Else - Actions
[b]call DestroyGroup( udg_tmp_unitgroup )[/b]The last line is a Custom Script Action. tmp_unitgroup is a Unit Group variable. |
| 01-20-2005, 09:37 AM | #11 |
yes, it can be done. |
| 01-20-2005, 09:35 PM | #12 |
It can be done and was done thousands of times, the only problem is hiding the icon of the evasion skill, but even in that case one would be able to trigger the whole evasion |
| 01-21-2005, 04:55 AM | #13 |
asking to create a spell of that callibre without triggers is rediculous. |
