| 02-04-2007, 07:52 AM | #1 |
Hi i was wondering if anyone here could help me with a trigger. I'm trying to make one that makes it so whenever a unit type comes within a range of building type it activates the trigger but i can't seem to figure out how to do an event like that |
| 02-04-2007, 09:22 AM | #2 |
I'd assume you'll have to do it by dynamically creating regions whenever a building of your unit-type enters the map area. How you'd go about doing that, however, is beyond me, since I don't understand the difference between a region and a rect (which is what you'd be dynamically creating). For this, you're going to need a real JASS-er. Alternatively, I suppose you could run a constant check around each of these units to simulate the event... let me think about that. |
| 02-04-2007, 09:53 AM | #3 |
Ok thanks man |
| 02-04-2007, 01:31 PM | #5 |
Ok thanks, i'll try that |
| 02-05-2007, 04:50 AM | #6 |
>>Pyrogasm Would you not just use the event "A unit comes within range of x of Your_Unit" Example Trigger: Trigger: That should work... I interpreted what he wrote as "I need a trigger to run when a unit comes near it" I'm quite sure if that's what he meant or not though |
| 02-05-2007, 05:11 AM | #7 |
You could make events for the trigger to fire, but only if the units were pre-placed . If the units can be created in-game, then there's no way to add an event to the trigger this.Even this does not work, because you can't select "Triggering Unit" for the unit to add the action for: |
| 02-06-2007, 02:21 AM | #8 |
| 02-06-2007, 02:30 AM | #9 | |
Trigger: Does actually work As I use it in my ORPG Adding the event Say the unit's name was Rock 001 When you actually add the event, it adds a unit comes within 200 of (Rock 001 <gen>) To Any trigger, it does work because I use it in my ORPG to "display" the damage delt, each attack, in which it works perfectly Quote:
Not so, cause this will work Trigger: TheTrig The trigger "TheTrig" would kill any unit that came near the footman, originally created in the trigger above "TheTrig", test it if you dont belive me ^_^ |
| 02-07-2007, 12:07 AM | #10 |
I really don't believe you, but I suppose I should take your word for it. The reason I'm saying it won't work is because the "A Unit comes within range of Unit" event requires a unit variable (The 'pick a unit' button) to work. GetLastCreatedUnit() (Otherwise known as "last created Unit") is not a variable, it is a function. |
| 02-07-2007, 02:11 AM | #11 |
It does work. The event requires a unit. GetLastCtraedUnit() returns a unit. Everything is kosher. But that being said, it only takes a single unit. That means if GetLastCreatedUnit() starts returning a different unit, the event won't update. It will still reference the unit set to the event. The problem that appears is that many events (1 for each unit that appears in your map) will be on the same trigger. And events take up memory. |
| 02-07-2007, 02:12 AM | #12 |
Yes, but thats only when manually selecting the event When you "add" from a trigger it works I have done this millions of times, in maps such as Mythical Fr0st Maker, Even my ORPG which is fully working, and many other maps... Trigger: Which is basically saying, A unit comes within range of (That specific frogman) Test it, it works 100%, preferably not that trigger... lol Thats how escape maker works, when a unit is trained, it adds trigger, that a unit comes within X of that unit... |
| 02-07-2007, 02:15 AM | #13 |
Sue me and my pessimism. Here's what it breaks down to:
|
| 02-07-2007, 04:44 AM | #14 | |
Quote:
Naa your not dumb * << not a man yet lol |
