| 06-24-2007, 09:00 AM | #1 |
Okay, i think i know the basics of jass now, and i'm able to create some abilities fully in jass. But i have some questions: What is the difference between a constant function and a normal one? I've heard that kattana's handle vars aren't the best thing to use if you want to transfer local variables from a function to another. For example when doing stuff with a timer. My second question is, what should i then use if i want to make for example a slide trigger, which moves a unit a little bit forward each x time? |
| 06-24-2007, 09:21 AM | #2 | |
Quote:
it's better to use simple arrays than gamecache. for "slide" algs you would better use vJass (it's more userfriendly than to write anything by yourself) so use structures as data-transfer. it's relative easy... sorry i am a bad explainer ^^ |
| 06-24-2007, 09:22 AM | #3 | ||
Quote:
A constant function has the constant prefix, you can't call non-constant functions from inside it and Vex's optimizer can inline them for you. Beyond that they are no different to normal functions. Quote:
Too vague. You could use vJass and set up a system to handle sliding of every unit on the map with some structs and global arrays, all using only a single timer. Or you could want it for a single instance and you need to attach stuff. Or you need... That's right, we don't know exactly what you need. |
| 06-24-2007, 05:16 PM | #4 |
thanks for the fast replies. Im going to read about vJass soon. |
| 06-26-2007, 08:20 AM | #5 | ||
Quote:
Quote:
|
| 06-26-2007, 11:42 AM | #6 |
According to PipeDream constant functions compile to the same bytecode, so it shouldn't be faster (unless he saying that in the context of having it optimized). |
