HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Some JASS questions

06-24-2007, 09:00 AM#1
Super_Duck
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
Toadcop
Quote:
What is the difference between a constant function and a normal one
how i have know... non =)

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
blu_da_noob
Quote:
What is the difference between a constant function and a normal one?

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:
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?

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
Super_Duck
thanks for the fast replies. Im going to read about vJass soon.
06-26-2007, 08:20 AM#5
Silvenon
Quote:
Originally Posted by Super_Duck
What is the difference between a constant function and a normal one?

Quote:
Originally Posted by Daelin
Constant function are slightly faster, sometimes it's significant, sometimes it's not
06-26-2007, 11:42 AM#6
blu_da_noob
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).