Script question
Does someone can do something like this?:
void main (void)
{
int &var;
int &wiz;
&crap = 0;
if (&var == 0)
{
//cutscene
&var = 1;
}
}
I just don't wanna waste the 200 global limit with so short cutscenes...
void main (void)
{
int &var;
int &wiz;
&crap = 0;
if (&var == 0)
{
//cutscene
&var = 1;
}
}
I just don't wanna waste the 200 global limit with so short cutscenes...
: Does someone can do something like this?:
: void main (void)
: {
: int &var;
: int &wiz;
: &crap = 0;
: if (&var == 0)
: {
: //cutscene
: &var = 1;
: }
: }
: I just don't wanna waste the 200 global limit with so short cutscenes...
Duh! I meant &var = 0; not &crap = 0;
: void main (void)
: {
: int &var;
: int &wiz;
: &crap = 0;
: if (&var == 0)
: {
: //cutscene
: &var = 1;
: }
: }
: I just don't wanna waste the 200 global limit with so short cutscenes...
Duh! I meant &var = 0; not &crap = 0;
: Does someone can do something like this?:
: void main (void)
: {
: int &var;
: int &wiz;
: &var = 0;
: if (&var == 0)
: {
: //cutscene
: &var = 1;
: }
: }
: I just don't wanna waste the 200 global limit with so short cutscenes...
I'm not sure I understand. Why would you set a variable to 0 and then test if it's 0 right afterwards?
If all you want to do is run the cutscene every time, you don't need a variable or test at all.
: void main (void)
: {
: int &var;
: int &wiz;
: &var = 0;
: if (&var == 0)
: {
: //cutscene
: &var = 1;
: }
: }
: I just don't wanna waste the 200 global limit with so short cutscenes...
I'm not sure I understand. Why would you set a variable to 0 and then test if it's 0 right afterwards?
If all you want to do is run the cutscene every time, you don't need a variable or test at all.
: : Does someone can do something like this?:
: : void main (void)
: : {
: : int &var;
: : int &wiz;
: : &var = 0;
: : if (&var == 0)
: : {
: : //cutscene
: : &var = 1;
: : }
: : }
: : I just don't wanna waste the 200 global limit with so short cutscenes...
: I'm not sure I understand. Why would you set a variable to 0 and then test if it's 0 right afterwards?
: If all you want to do is run the cutscene every time, you don't need a variable or test at all.
i think he wants &var to be global so that the cutscene runs and then &var is 1 and doesnt run anymore. the problem my fine fellow is that int &var creates a local variable, these dont have a 200 limit, but they can only be used inside of this script when it is called. when the script dies, so does the var. you need to make the &var in main.c, and yeah i guess you do have to waste one, that is why people do if &story == 1, if &story > 2, and so on. you can make the cutscene play only if &story < 1 and then use &story for other special things in the future. if you are confused about global and local variables or anything else i just said... or something... ask more and i or someone else will be more specific. cheers.
: : void main (void)
: : {
: : int &var;
: : int &wiz;
: : &var = 0;
: : if (&var == 0)
: : {
: : //cutscene
: : &var = 1;
: : }
: : }
: : I just don't wanna waste the 200 global limit with so short cutscenes...
: I'm not sure I understand. Why would you set a variable to 0 and then test if it's 0 right afterwards?
: If all you want to do is run the cutscene every time, you don't need a variable or test at all.
i think he wants &var to be global so that the cutscene runs and then &var is 1 and doesnt run anymore. the problem my fine fellow is that int &var creates a local variable, these dont have a 200 limit, but they can only be used inside of this script when it is called. when the script dies, so does the var. you need to make the &var in main.c, and yeah i guess you do have to waste one, that is why people do if &story == 1, if &story > 2, and so on. you can make the cutscene play only if &story < 1 and then use &story for other special things in the future. if you are confused about global and local variables or anything else i just said... or something... ask more and i or someone else will be more specific. cheers.
There are certain (more complicated, to say the least) ways to do a one-time cutscene without using global.
One is to use vision. I don't like it though since sometimes it gets more confused if you are making a huge epic thing without careful plot.
The other is a "cheating" trick. You can add a small sprite on that screen (a stone or pot or anything that won't do any harm... or you can even shrink it to 1% size to make it disappear... or...). put the cutscene in the main{} of that sprite or use spawn to call the actual cutscene script. (I would recommend the later.) Then before Dink exits this screen, make that sprite disappear! I forgot which editer number it should be, but you should know it.
One is to use vision. I don't like it though since sometimes it gets more confused if you are making a huge epic thing without careful plot.
The other is a "cheating" trick. You can add a small sprite on that screen (a stone or pot or anything that won't do any harm... or you can even shrink it to 1% size to make it disappear... or...). put the cutscene in the main{} of that sprite or use spawn to call the actual cutscene script. (I would recommend the later.) Then before Dink exits this screen, make that sprite disappear! I forgot which editer number it should be, but you should know it.
:the problem my fine fellow is that int &var creates a local variable, these dont have a 200 limit...
Not exactly.
Dink can have 238 active variables at one time, if my memory serves me correctly. This total includes all global variables and all local variables instantiated in all active scripts.
Not exactly.
Dink can have 238 active variables at one time, if my memory serves me correctly. This total includes all global variables and all local variables instantiated in all active scripts.