Pikmin Posted August 11, 2008 Share Posted August 11, 2008 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 More sharing options...
zbyl2 Posted August 11, 2008 Share Posted August 11, 2008 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!). Link to comment Share on other sites More sharing options...
DarthStoney Posted August 11, 2008 Share Posted August 11, 2008 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 More sharing options...
Pikmin Posted August 11, 2008 Author Share Posted August 11, 2008 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 More sharing options...
zbyl2 Posted August 11, 2008 Share Posted August 11, 2008 EDIT: This should be it right? The best way to check it is try that in game:) Link to comment Share on other sites More sharing options...
Pikmin Posted August 11, 2008 Author Share Posted August 11, 2008 It wont' compile though. I'll go check how to use the clearactions command. Link to comment Share on other sites More sharing options...
zbyl2 Posted August 11, 2008 Share Posted August 11, 2008 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 More sharing options...
Pikmin Posted August 11, 2008 Author Share Posted August 11, 2008 To the tune of "Off to see the Wizard" "I'm off to test our scripting" Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.