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.

OnFailToOpen script for locked dood

Page: 1 of 1
 Seamhainn
02-09-2008, 4:02 AM
#1
Hello!

Once again I need scripting help, please. I have this OnFailToOpen script for a locked door:


void main(){

object oDoor=GetObjectByTag("tar10_lab");
object oCard=GetObjectByTag("tar10_mechid");

if (GetBaseItemType(oCard))

{

ActionOpenDoor(oDoor);

}

else

{

ActionBarkString(14614);

}

}


Unfortunately the string is not displayed if the pc does not have the tar10_mechid item, and also the door does not open if the pc has the tar10_mechid item.

Any help would be highly appreciated!

Thanks and take care
 stoffe
02-09-2008, 7:27 AM
#2
Hello!

Once again I need scripting help, please. I have this OnFailToOpen script for a locked door:


Try this variant of your script:

void main(){
object oDoor = GetObjectByTag("tar10_lab");
object oCard = GetItemPossessedBy(GetFirstPC(), "tar10_mechid");

if (GetIsObjectValid(oCard)) {
SetLocked(oDoor, FALSE);
AssignCommand(oDoor, ActionOpenDoor(oDoor));
}
else {
BarkString(OBJECT_INVALID, 14614);
}
}
 Seamhainn
02-09-2008, 11:16 AM
#3
Try this variant of your script:

void main(){
object oDoor = GetObjectByTag("tar10_lab");
object oCard = GetItemPossessedBy(GetFirstPC(), "tar10_mechid");

if (GetIsObjectValid(oCard)) {
SetLocked(oDoor, FALSE);
AssignCommand(oDoor, ActionOpenDoor(oDoor));
}
else {
BarkString(OBJECT_INVALID, 14614);
}
}


That did not work. The String is only barked once (!) and not anymore if I click on the door later on again, and the door does not open if I give tar10_mechid with the giveitem cheat to the pc.

I now locked the door and asked for the tar10_mechid key to open it. Also I changed the script to


void main()

{

BarkString(OBJECT_INVALID, 14614);

}


Everything works nicely now. EXCEPT that I still get the annoying three boxes under "Locked" when I click on the door. How can I eliminate those three boxes?

Thanks and take care
Page: 1 of 1