Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tatooine Dune Sea - Miners near sandcrawler never leave #115

Closed
DarthParametric opened this issue May 11, 2019 · 2 comments
Closed

Tatooine Dune Sea - Miners near sandcrawler never leave #115

DarthParametric opened this issue May 11, 2019 · 2 comments
Labels
Module: Tatooine Issue occurs primarily on Tatooine Suggestion Type: Scripting This issue is related specifically to a scripting bug/error

Comments

@DarthParametric
Copy link
Contributor

The miners near the sandcrawler tell you they will leave soon after you have killed the attacking Sandpeople. But they remain there and repeat the same dialogue if subsequently talked to. They could be destroyed via an OnEnter check of certain quest states, such as the player going to the Sandpeople enclave.

Suggested by ebmar.

@DarthParametric DarthParametric added Suggestion Module: Tatooine Issue occurs primarily on Tatooine Type: Scripting This issue is related specifically to a scripting bug/error labels May 11, 2019
@DarthParametric
Copy link
Contributor Author

DarthParametric commented May 12, 2019

Possible OnEnter hijack:

void main() {

	object oMinerCap = GetObjectByTag("tat18_13craw2_01", 0);
	object oMinerGrunt = GetObjectByTag("tat18_13craw1_01", 0);
	
	// Execute original OnEnter
	ExecuteScript("cp_tat18aa_enter", OBJECT_SELF, -1);
	
	// Check if the player has spoken to the miners at the sandcrawler
	// and has dealt with the Sandpeople chieftain
	if (((GetLocalBoolean(oMinerCap, 53) == TRUE) && (GetGlobalBoolean("tat_TuskenDead") == TRUE)))
		{
		
			if (GetIsObjectValid(oMinerCap))
				{
					DestroyObject(oMinerCap,0.0,TRUE);
				}
		
			while (GetIsObjectValid(oMinerGrunt))
				{
					DestroyObject(oMinerGrunt,0.0,TRUE);
				}
		}
}

The miner captain's DLG looks a little screwy. It has a TalkedTo boolean set, but only if you speak to him in the "correct" manner. Seems like you could miss it if you spoke to him dressed in the Sandpeople disguise. So setting a local boolean at the end of the convo is probably the easiest solution.

@JCarter426
Copy link
Contributor

JCarter426 commented May 19, 2019

Updated code that I think should fix the while loop:

void main() {

// Execute original OnEnter
ExecuteScript("cp_tat18aa_enter", OBJECT_SELF, -1);

// Check if the player has spoken to the miners at the sandcrawler
// and has dealt with the Sandpeople chieftain
if( GetLocalBoolean(oMinerCap, 53) == TRUE &&
	GetGlobalBoolean("tat_TuskenDead") == TRUE ) {
	// Destroy miner captain
	object oMinerCap = GetObjectByTag("tat18_13craw2_01", 0);
	if( GetIsObjectValid(oMinerCap) ) {
		DestroyObject(oMinerCap,0.0,TRUE);
		}
	// Destroy miner grunts
	object oMinerGrunt = GetObjectByTag("tat18_13craw1_01", 0);
	while( GetIsObjectValid(oMinerGrunt) ) {
		DestroyObject(oMinerGrunt, 0.0, TRUE);
		oMinerGrunt = GetObjectByTag("tat18_13craw1_01", 0);
		}
	}

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Module: Tatooine Issue occurs primarily on Tatooine Suggestion Type: Scripting This issue is related specifically to a scripting bug/error
Projects
None yet
Development

No branches or pull requests

2 participants