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.

open a door through scripting?

Page: 1 of 1
 Vox Kalam
10-08-2007, 3:44 PM
#1
void main()
{
string sTag = GetScriptStringParameter();
int iDelay = GetScriptParameter(1);

object oDoor = GetObjectByTag("attackdoor");
DelayCommand(IntToFloat(iDelay), AssignCommand(oDoor,ActionUnlockObject(oDoor)));
DelayCommand(IntToFloat(iDelay), AssignCommand(oDoor,ActionOpenDoor(oDoor)));
}
How do you like that? The stubborn door won't open.

EDIT: I tried this one, too...nothing.
void main() {
object oDoor = GetObjectByTag("TagOfTheDoor");
AssignCommand(oDoor, ActionOpenDoor(oDoor));
SetLocked(oDoor, FALSE);
}
 tk102
10-08-2007, 6:21 PM
#2
Give this a try. Pass the door's tag as the StringParam and the delay in seconds as P1.
void main()
{
string sTagOfDoor = GetScriptStringParameter();
int iDelay = GetScriptParameter(1);
object oDoor = GetObjectByTag(sTagOfDoor);

SetLocked(oDoor,FALSE);
DelayCommand(IntToFloat(iDelay), DoDoorAction(oDoor, DOOR_ACTION_OPEN));
}
 Vox Kalam
10-08-2007, 7:19 PM
#3
void main()
{
string sTagOfDoor = GetScriptStringParameter();
int iDelay = GetScriptParameter(1);
object oDoor = GetObjectByTag("attackdoor");

SetLocked(oDoor,FALSE);
DelayCommand(IntToFloat(1), DoDoorAction(oDoor, DOOR_ACTION_OPEN));
}

Like this? Not working...Dids I do it wrong?
 tk102
10-08-2007, 7:44 PM
#4
Is the tag of your door "attackdoor"? I assumed you were calling this script via a dialog and so you could put the string "attackdoor" in the dialog StringParam field as I mentioned.

If this script is not called by a dialog or this is for KotOR1,
void main()
{
SendMessageToPC(GetFirstPC(),"DEBUG: Trying to open attackdoor");
object oDoor = GetObjectByTag("attackdoor"); //confirm this tag is correct
SetLocked(oDoor,FALSE);
DelayCommand(1.0, DoDoorAction(oDoor, DOOR_ACTION_OPEN));
SendMessageToPC(GetFirstPC(),"DEBUG: Tried to open attackdoor");
}
Check your feedback screen after running the above script. You should see both debug messages there.
 Vox Kalam
10-08-2007, 8:07 PM
#5
It's for TSL
 stoffe
10-09-2007, 7:02 AM
#6
It's for TSL

This works here to unlock and open a door. If it doesn't do anything in your game then either the script isn't running at all, or the tag of the door is either wrong or you have more than one door in the module with the same tag:


void main() {
object oDoor = GetObjectByTag("attackdoor");
SetLocked(oDoor, FALSE);
AssignCommand(oDoor, ActionOpenDoor(oDoor));
}
 Vox Kalam
12-01-2007, 4:32 PM
#7
sorry I haven't been on lately, internet problems and no time to fix it...but it still isn't working...:(
Page: 1 of 1