Vox Kalam Posted October 8, 2007 Share Posted October 8, 2007 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); } Link to comment Share on other sites More sharing options...
tk102 Posted October 8, 2007 Share Posted October 8, 2007 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)); } Link to comment Share on other sites More sharing options...
Vox Kalam Posted October 8, 2007 Author Share Posted October 8, 2007 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? Link to comment Share on other sites More sharing options...
tk102 Posted October 8, 2007 Share Posted October 8, 2007 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. Link to comment Share on other sites More sharing options...
Vox Kalam Posted October 9, 2007 Author Share Posted October 9, 2007 It's for TSL Link to comment Share on other sites More sharing options...
stoffe Posted October 9, 2007 Share Posted October 9, 2007 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)); } Link to comment Share on other sites More sharing options...
Vox Kalam Posted December 1, 2007 Author Share Posted December 1, 2007 sorry I haven't been on lately, internet problems and no time to fix it...but it still isn't working... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.