Sorry i know i do a lot of questiosn, but i never learn any programming nor anything like that and i want to do some complicated stuff and it's hard to me to learn ERM.
Now ihave to ask about variables.
I use only y variables, flags and v variables because those are the only one i understand, what advantage can i ake of the other variables? specialy x and z that i see used a lot?
variables
Re: variables
x variables are used primarily when you want to pass values into a function. After the FU:P, you can list up to 16 values (or variables), separated by slashes and these will show up as x variables in the function itself. It's just a handy way of getting values in without having to use y- or v variables.Pollo2002 wrote:Sorry i know i do a lot of questiosn, but i never learn any programming nor anything like that and i want to do some complicated stuff and it's hard to me to learn ERM.
Now ihave to ask about variables.
I use only y variables, flags and v variables because those are the only one i understand, what advantage can i ake of the other variables? specialy x and z that i see used a lot?
x16 is a special case because it keeps the loop value when you use a function DO loop.
z variables are different from all others because the other variables are numeric variables. z variables hold strings of characters (e.g., hero names, monster names, artifact names, hint text, words, paragraphs etc.) so they're definitely handy if you want to do anything that involves text other than displaying a simple message.
Some other useful variable types are w variables (each hero has its own set of 200 variables so for example, you could set w50 to 1 for any hero that gains some special scripted ability during the game--then just check if the hero's w50 variable is set and execute the code if it is) and y- variables which are like y variables but used for non-Function triggers (and their values carry over into any functions called by those trigger sections).
- Fnord
- Qurqirish Dragon
- Genie
- Posts: 1011
- Joined: 06 Jan 2006
- Location: Flying the skies of Ohlam
i wanted to tell you that your erm for dummies was the first thing i readed not from here but from the erm help that comes into the wog tools, sorry if i seem like a bad student and ask things you already explained
but the variable thing got a little confusing to me. I'm doing scripts and really never now why should i use one variable over other exactly.
what i do is look other scripts that share common things with mine and see what variables they use, so i use those , for now that's working just fine.
i generally use v variables if i need to use them in other place, y variables if i need them only in the function and flags when i just need an off on variable that works on several functions. but other than that while i have some idea what they are for, i don't exactly know why. For example i see that people use variables y- and Z- and don't know why they use them exactly even i use them but i don't know why i'm doing it just because i see it somehwere else. I don't understand also the e variables but i don't see them used very much
but the variable thing got a little confusing to me. I'm doing scripts and really never now why should i use one variable over other exactly.
what i do is look other scripts that share common things with mine and see what variables they use, so i use those , for now that's working just fine.
i generally use v variables if i need to use them in other place, y variables if i need them only in the function and flags when i just need an off on variable that works on several functions. but other than that while i have some idea what they are for, i don't exactly know why. For example i see that people use variables y- and Z- and don't know why they use them exactly even i use them but i don't know why i'm doing it just because i see it somehwere else. I don't understand also the e variables but i don't see them used very much
- Qurqirish Dragon
- Genie
- Posts: 1011
- Joined: 06 Jan 2006
- Location: Flying the skies of Ohlam
y- variables are for temporary values (similar to other y variables), but they will remain unaltered by other function calls within the current function. They are basically "local" variables to a subroutine, while normal y variables are "global". Once the given function ends, however, the y- values are lost.Pollo2002 wrote: i generally use v variables if i need to use them in other place, y variables if i need them only in the function and flags when i just need an off on variable that works on several functions. but other than that while i have some idea what they are for, i don't exactly know why. For example i see that people use variables y- and Z- and don't know why they use them exactly even i use them but i don't know why i'm doing it just because i see it somehwere else. I don't understand also the e variables but i don't see them used very much
IIRC, z- variables are to z variables what y variables are to v variables. i.e. they are for temporary storage of text values.
e variables are to store floating-point values. They are not needed very often, as usually things can be scripted better with integer arithmetic. You should only need them if you are going to be using division by relatively large numbers. (for example, to calculate half the experience a hero has, dividing by 2 is fine, but to find one ten-thousanth of it you may want to keep the fractional part)
Who is online
Users browsing this forum: No registered users and 3 guests