| 11-28-2008, 06:33 AM | #1 |
Is it possible to acquire the element of an array in an event and use it in an action? I got stuck with a list of triggers for an arrayed timer because I can't figure this out and I really want to condense them. Problem: I have a timer array with 12 elements to have a countdown timer that corresponds to each player respectively because each person can have a different count as another player simultaneously. I have a similar set of actions for if any of the timers expire, but those actions require knowing which timer set off the trigger. Right now I have a seperate trigger for each timer with the following setup Trigger "Release" has the universal actions that function on the two temp variables shown. I want to be able to throw it all into one trigger with a list of the 12 events, and then be able to pull the number of the element that ran the trigger. I doubt this is possible, but I'm asking for the sake of a possibility. I don't know any JASS, so if the solution lies therein, you'll need to spoonfeed me some custom script :< |
| 11-28-2008, 07:25 AM | #2 |
could use a 12 array global and set the aproprate players # to true then false after the 2nd trigger runs, and do some sort of loop to find which one is true at the begining |
| 11-28-2008, 08:14 AM | #3 |
That would be sloppy compared to what it is now, and wouldn't make anything more efficient. It runs fine as is, I'm just looking for a way to compact it. |
| 12-04-2008, 07:09 PM | #5 |
omg i <3 you. aff i feel stupid now ._. EDIT: Eh, Idk if I'm just blind, but there's no Timer Comparison condition. wtf D:< |
| 12-05-2008, 12:58 AM | #6 |
I think you might have to do it through a boolean comparison: Trigger: (temp_Timer equal to Expired Timer) equal to True |
| 12-05-2008, 04:54 AM | #7 |
That doesn't exist as a boolean either. Yes, I know GUI is lame.. What's the custom script for that condition? WEU allows custom script conditions so, I'm thinking that's the best way to go at this point. |
| 12-05-2008, 05:20 AM | #8 |
JASS:udg_temp_Timer == GetExpiredTimer() |
| 12-05-2008, 05:31 AM | #9 |
Thanks a bunch man, I'll give it a try. |
