Jump to content

Home

on entrance script???


Pikmin

Recommended Posts

How can I make it so this script will start the dialogs if the global equals 1 and then later two, but if it equals zero loads 650dan normally?

 

 

void main() {
if (GetLoadFromSaveGame()) {
	return;
}
object oEntering = GetEnteringObject();
if ((oEntering != GetFirstPC())) {
	return;
}
int nGlobal = GetGlobalNumber("000_PC_IsDead");
SetGlobalFadeOut(0.0, 0.0, 0.0, 0.0, 0.0);
SetFadeUntilScript();
switch (nGlobal) {
	case 1:
		AssignCommand(GetObjectByTag("atton", 0), ActionStartConversation(oEntering, "unconc", 0, 0, 0, "", "", "", "", "", "", 0, 0xFFFFFFFF, 0xFFFFFFFF, 0));
		break;
	case 2:
		AssignCommand(GetObjectByTag("atton", 0), ActionStartConversation(oEntering, "unconc2", 0, 0, 0, "", "", "", "", "", "", 0, 0xFFFFFFFF, 0xFFFFFFFF, 0));
		break;

  }

}

Link to comment
Share on other sites

I guess you want something like that.

void main(){
if (GetLoadFromSaveGame()) {
	return;
}

object oPC=GetEnteringObject());
if(GetIsPC(oPC))
{
if(GetGlobalNumber("000_PC_IsDead") == 1)//If global is 1...
{
		AssignCommand(GetObjectByTag("atton", 0), ActionStartConversation(oEntering, "unconc", 0, 0, 0, "", "", "", "", "", "", 0, 0xFFFFFFFF, 0xFFFFFFFF, 0));//...start dialog "unconc" with Atton.
                  } else {//if...
if(GetGlobalNumber("000_PC_IsDead")==2)//...global is two...
{
		AssignCommand(GetObjectByTag("atton", 0), ActionStartConversation(oEntering, "unconc2", 0, 0, 0, "", "", "", "", "", "", 0, 0xFFFFFFFF, 0xFFFFFFFF, 0));//...start conversation unconc2.
		}
else {//And if global isn't equals 1 or two (global = 0, 3, 4 etc)...
StartNewModule("650DAN");//Just start 650DAN.
}
}
}
}

It should be it, (but propadly something is wrong... like always whe I making some "big" script) if something is wrong please someone tell me it. I'm not master of scripting (YET!:xp:).

Link to comment
Share on other sites

How can I make it so this script will start the dialogs if the global equals 1 and then later two, but if it equals zero loads 650dan normally?

 

The issue is it will always load 650DAN normally because the Exile doesn't "die" until after meeting with the masters. So after the Exle dies you would have to leave and re-enter 650DAN to trigger it.

Link to comment
Share on other sites

The issue is it will always load 650DAN normally because the Exile doesn't "die" until after meeting with the masters. So after the Exle dies you would have to leave and re-enter 650DAN to trigger it.

 

I set the script as the onenter script for 650dan, and when i enter through the door I only get black. i'm going to try a modified version of zybl2's script.

 

EDIT: This should be it right?

 

void main(){
if (GetLoadFromSaveGame()) {
	return;
}

object oPC=GetEnteringObject());
if(GetIsPC(oPC))
{
if(GetGlobalNumber("000_PC_IsDead") == 1)
{
AssignCommand(GetObjectByTag("atton", 0), ActionStartConversation(oEntering, "unconc", 0, 0, 0, "", "", "", "", "", "", 0, 0xFFFFFFFF, 0xFFFFFFFF, 0));
                  } else {
if(GetGlobalNumber("000_PC_IsDead")==2)
{
		AssignCommand(GetObjectByTag("atton", 0), ActionStartConversation(oEntering, "unconc2", 0, 0, 0, "", "", "", "", "", "", 0, 0xFFFFFFFF, 0xFFFFFFFF, 0));
		}
else {
SetGlobalFadeIn(1.0, 1.0, 0.0, 0.0, 0.0);
AssignCommand(GetObjectByTag("atton", 0), ClearAllActions));
}
}
}
}

Link to comment
Share on other sites

Yeap, there are couple of error... Here is good version (I compiled it!).

void main(){
if (GetLoadFromSaveGame()) {
	return;
}

object oPC=GetEnteringObject();
if ((oPC != GetFirstPC())) {
	return;
}

if(GetGlobalNumber("000_PC_IsDead") == 1)
{
AssignCommand(GetObjectByTag("atton", 0), ActionStartConversation(oPC, "unconc", 0, 0, 0, "", "", "", "", "", "", 0, 0xFFFFFFFF, 0xFFFFFFFF, 0));
                  } else {
if(GetGlobalNumber("000_PC_IsDead")==2)
{
		AssignCommand(GetObjectByTag("atton", 0), ActionStartConversation(oPC, "unconc2", 0, 0, 0, "", "", "", "", "", "", 0, 0xFFFFFFFF, 0xFFFFFFFF, 0));
		}
else {
SetGlobalFadeIn(1.0, 1.0, 0.0, 0.0, 0.0);
AssignCommand(GetObjectByTag("atton", 0), ClearAllActions());
}
}
}

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...