| 10-16-2002, 12:46 AM | #1 |
Guest | Calling all WE Experts... 2 quick questions which I hope have quick answers (for your sake.) 1. I can set Wander abilities in the Unit editor, but how do you make a unit wander with code? I'd like more control over when certain units wander and when they don't. 2. I can start a timer and create a window for it and it works great! BUT, when I change that timer variable to an array, it no longer works. Aren't a timer variable called Timer1 and a timer variable array called Timer1(1) both valid variables? Thanks alot for any suggestions! |
| 10-16-2002, 12:47 AM | #2 |
1. Just use the enable/disable ability action and use it on wander. Not sure this will work, so if it doesn't post back and lemme know, there are possible trigger fixes. 2. It's a bug, arrays don't work in events :( |
| 10-16-2002, 01:06 AM | #3 |
Guest | Hey dataangel, 1. I look under the unit actions and can't find the enable/disable abilities. All I can find is Unit-Remove Ability, so I converted to custom text and tried to change "remove" with "add." Nice try...but no dice. I must be looking in the wrong place to do this. Where is "enable/disable ability action?" 2. re: "arrays don't work in events" Arrrrrrgggggggggghhhhhhhh...rats. Must find another way... Thanks for your help! |
| 10-16-2002, 03:56 PM | #4 |
Under Player. Player - enable/disable ability for player -The Great and Immortal Lord Imperialist Insaniteus- --------------------------------I'm cool, I know! |
| 10-16-2002, 05:08 PM | #5 |
Guest | I can understand how arrays wouldn't work in events normally, because it seems as an array they would go by value and not by reference (and arrays can't be initialized before the game starts). But couldn't you use one of the Add Event triggers (from GoldenUrg) after you initialize an array? |
| 10-16-2002, 06:38 PM | #6 |
I tried this out yesterday, its supposed to be a work arround for dialog arrays not working in events. http://wc3campaigns.com/forums/showt...&threadid=2903 however, i couldn't get it to work. I belive what this is doin is making the newly created varible = to the memory location and not what is in the memory location. Can anybody confirm this? |
| 10-16-2002, 10:31 PM | #7 |
Guest | I found a solution to my Event Array problem, but it may not be what others are hoping for. What I did was to create a Timer Variable Array and a number of Timer variables. During runtime, I set one of the variables equal to the Array element I need to reference in an event, then I just reference that Variable in the event. Of course, this isn't super efficient if your array size is huge since you have to hard code each variable. Anyway, I've got my array of Timers and Timer Windows working and referenced in events by using temporary variables to set to specific array elements just before the trigger fires. Hope someone else can use this idea. |
