ok so i am a compleate newb to jass i know some simple dos programing but not much more. i would like to know how i can get an interger to = itself+1 i tried somthing like this set [integer] = [integer] + 1 oh and the [integer] stands for the name of my integer ok i am still quite new with jass but i started doing Qbasic programing a few years ago. My main problem with this though is that i dont know any of the commands or how they go together if u can supply me with the commands (or help me fix what i did wrong) for jass it would really help me
set (i)=(i)+1 should do the trick in ur script,but before you do that you must ensure that the integer exists(is created),a.k.a. local integer (i) = (number) (0 most commonly) ;
function .... takes .... returns ....
local integer (i)=0
set (i)=(i)+1
....
endfunction
i do have one other question though will this piece of code (trigger) reset my integer everytime it is run and if so can i fix it by making another trigger with just the set (i)=(i)+1 thx
The integer (i) I introduce to you is a local variable this means it's created and can be only used by the current thread of the function.As calling/executing,the function creates a new thread and the local variable and it remains only for this thread.So to answer your question directly,you can't.You might use global variables wich can be manipulated by all threads keeping the same result.Another way is to store the integer value in a gamecache.If thats your prime objective.Hope i helped,honestley i really hard understood your question.Btw this is not a trigger it's a function,don't call 'em triggers,since they are things completly different from functions.
edit: here is my question in different words "how can i use a global variable in a custom script to make it = itself + 1" thx for the help and sry for the trouble
Edit: K i think i found out how i can get it to work if i put
local integer C=C Set C=C+1
would that work??? or do i need to use the call and execute commands because i dont know how to use them.
but you wont learn GOOD jass for atleast 2 months... thats what suxorz. I've been doing it since september and im still not all that gr8, tho im pretty good.