Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

Module conditional script

Page: 1 of 1
 Ferc Kast
05-14-2008, 4:54 PM
#1
How can you make a conditional script that checks if you came from a certain module (which, for all intents & purposes, I will call 301NARb)?
 glovemaster
05-15-2008, 3:51 AM
#2
void main(){
if(GetGlobalString("K_LAST_MODULE") == "301NARb")
return TRUE;
return FALSE;
}
:^:
 Ferc Kast
05-18-2008, 5:05 PM
#3
I have a question about why the following script won't run for me. It did compile perfectly for me. I edited a_return371.nss to make that script; So, why won't it run? Or should I have modded another script to make it take me back to 301NARb, if that's the module I came from?

void main(){
if(GetGlobalString("K_LAST_MODULE") == "301NARb") {
SetGlobalFadeOut(0.0, 0.0, 0.0, 0.0, 0.0);
AssignCommand(GetFirstPC(), StartNewModule("301NARb", "from_371", "", "", "", "", "", ""));
}
else if(GetGlobalString("K_LAST_MODULE") == "301NAR") {
SetGlobalFadeOut(0.0, 0.0, 0.0, 0.0, 0.0);
AssignCommand(GetFirstPC(), StartNewModule("301NAR", "from_371", "", "", "", "", "", ""));
}
}
Page: 1 of 1