| 05-29-2006, 08:13 AM | #1 |
Hi all! Thanks to a member of the wc3c community, i've realised that i need to use a SetUnitAnimationByIndex function. It seems that this has no GUI equivalent (i'm still using GUI!! LOL) so i'm trying to learn some Jass. It would be a great help if someone could explain exactly what's wrong with this syntax: call SetUnitAnimationByIndex((Picked Unit),1) Thanks in advance. If you can explain this to me, it'd be such a great help. I've looked at the tutorials but they seem to cover the basics of programming (which i can do) rather than the syntax required. |
| 05-29-2006, 08:18 AM | #2 |
(Picked Unit) "compiles" to GetEnumUnit() in JASS for the forgroup callback function. JASS:call SetUnitAnimationByIndex(GetEnumUnit(),1) |
| 05-29-2006, 08:23 AM | #3 |
That's right. Whenever you don't know the JASS equivalent of something, simply make a GUI trigger that uses it and then use Edit/Convert to Custom Text to see how it looks in JASS. |
| 05-29-2006, 08:26 AM | #4 |
When in doubt about syntax, you can always convert GUI triggers to JASS to see what converts to what. Note, though, that many GUI actions use BJ functions that are redundant, inefficient and sometimes leak memory, so it is advised that you always look up every function you use to see what it does. |
| 05-29-2006, 08:35 AM | #5 |
Thanks a lot everyone! That helps loads, especially the bit about converting GUI to Jass to see what it looks like. |
| 05-29-2006, 10:15 AM | #6 |
If you ever set a AnimationByIndex, just store the Integer in a cache or variable, then you can refer back to it, but if you dident store it or dident force the animation, then theres no possible way |
