Jump to content

Home

Need help with scripting *again*


JediKnight707

Recommended Posts

I had the great person kdsphantom compile a script for me and I stuck it in my override (I also took out all mods that I had as well) along with the custom items that I was trying to put in. Is there something wrong with the script? Here it is:

void main() {
   object oDoor = GetObjectByTag("MorgueDoor");
   SetLocked(oDoor, FALSE);
   DelayCommand(1.0, AssignCommand(oDoor, ActionOpenDoor(oDoor)));

   object oCorpse = GetItemPossessor(GetObjectByTag("plasmatorch"));
   if (GetIsObjectValid(oCorpse)) {
       CreateItemOnObject("anakin_saber", oCorpse);
CreateItemOnObject("jinn_saber", oCorpse);
       CreateItemOnObject("luke_saber", oCorpse);
       CreateItemOnObject("maul_saber", oCorpse);
       CreateItemOnObject("obiwan_saber", oCorpse);
       CreateItemOnObject("palpatine_saber", oCorpse);
       CreateItemOnObject("windu_saber", oCorpse);
       CreateItemOnObject("yoda_saber", oCorpse);
       CreateItemOnObject("vader_saber", oCorpse);
       CreateItemOnObject("koon_saber", oCorpse);
       CreateItemOnObject("dooku_saber", oCorpse);
   }
}

Link to comment
Share on other sites

It's not necessary to determine the stack size in this script unless you want to put a value greater than 1.

 

Are you sure you script is even fired? Make sure the script's name is a_doormor.ncs. Also, the script will only fire once when you select the following dialogue option on the computer to unlock the morgue door:

MORGUE UNLOCKED

MEDICAL BAY FUNCTIONS

EMERGENCY LOCKDOWN

ENTER COMMAND

 

It is only at this moment that the items will be created on the corpse. Use a save game from before unlocking the door.

Link to comment
Share on other sites

hiya Jedi

member to bring up a saved game from before you did anything with the door. And you mean the door is locked when you click it, But you went to the computer and went through those 4 conditions to open it right? and then over to the door, and its been a while since i was at the begining of TSL but does the computer open the door for you or do you still click the door? I think I membered right. the computer unlocks and you still click it right, and this is where your saying the door is still locked correct?

Kdsphantom

Link to comment
Share on other sites

void main() {
   object oDoor = GetObjectByTag("MorgueDoor");
   SetLocked(oDoor, FALSE);
   DelayCommand(1.0, AssignCommand(oDoor, ActionOpenDoor(oDoor)));

   object oCorpse = GetItemPossessor(GetObjectByTag("plasmatorch"));
   if (GetIsObjectValid(oCorpse)) {
       CreateItemOnObject("anakin_saber", oCorpse);
CreateItemOnObject("jinn_saber", oCorpse);
       CreateItemOnObject("luke_saber", oCorpse);
       CreateItemOnObject("maul_saber", oCorpse);
       CreateItemOnObject("obiwan_saber", oCorpse);
       CreateItemOnObject("palpatine_saber", oCorpse);
       CreateItemOnObject("windu_saber", oCorpse);
       CreateItemOnObject("yoda_saber", oCorpse);
       CreateItemOnObject("vader_saber", oCorpse);
       CreateItemOnObject("koon_saber", oCorpse);
       CreateItemOnObject("dooku_saber", oCorpse);

ExecuteScript("i forgot what script it was :)", OBJECT_SELF);
}

 

Like that jmac?

Link to comment
Share on other sites

Make your own locker and put all items in inventory then use this

 

a_doormor.nss

 

void main() {
   object oDoor = GetObjectByTag("MorgueDoor");
   SetLocked(oDoor, FALSE);
   DelayCommand(1.0, AssignCommand(oDoor, ActionOpenDoor(oDoor)));
//test
   CreateObject(OBJECT_TYPE_PLACEABLE, "mylocker", Location(Vector(-19.48675, 11.91394, 9.11489), 55.0));
}

Link to comment
Share on other sites

@Jedi_Knight_707

Yes, minus the script name :p

 

***Edit***

Don't forget to re-name the original script, and name your new script whatever the name of the original one was, and execute the old one in your script. Then just compile both, and put them in your 'Override' folder :)

 

Basically:

Your script is named 'a_doormor' and executes the original that you re-named, perhaps 'a_doormor2'.

Link to comment
Share on other sites

I think that, as Darth333 said, it's 'a_doormor'. Therefore your script should be this:

void main() {
   object oDoor = GetObjectByTag("MorgueDoor");
   SetLocked(oDoor, FALSE);
   DelayCommand(1.0, AssignCommand(oDoor, ActionOpenDoor(oDoor)));

   object oCorpse = GetItemPossessor(GetObjectByTag("plasmatorch"));
   if (GetIsObjectValid(oCorpse)) {
       CreateItemOnObject("anakin_saber", oCorpse);
CreateItemOnObject("jinn_saber", oCorpse);
       CreateItemOnObject("luke_saber", oCorpse);
       CreateItemOnObject("maul_saber", oCorpse);
       CreateItemOnObject("obiwan_saber", oCorpse);
       CreateItemOnObject("palpatine_saber", oCorpse);
       CreateItemOnObject("windu_saber", oCorpse);
       CreateItemOnObject("yoda_saber", oCorpse);
       CreateItemOnObject("vader_saber", oCorpse);
       CreateItemOnObject("koon_saber", oCorpse);
       CreateItemOnObject("dooku_saber", oCorpse);

ExecuteScript("a_doormor_old", OBJECT_SELF);
}

... and named 'a_doormor', with the old script (the one oldflash posted) named 'a_doormor_old'.

Link to comment
Share on other sites

Err...the script already contains all the a_doormor.ncs contents so there is no real point in re-executing the script at the end. The original contents of a_doormor.ncs are:

void main() {
   object oDoor = GetObjectByTag("MorgueDoor");
   SetLocked(oDoor, FALSE);
   DelayCommand(1.0, AssignCommand(oDoor, ActionOpenDoor(oDoor)));

 

edit: I just tried the following script (had to change the items because I don't have yours) and it worked perfectly:

void main() {
   object oDoor = GetObjectByTag("MorgueDoor");
   SetLocked(oDoor, FALSE);
   DelayCommand(1.0, AssignCommand(oDoor, ActionOpenDoor(oDoor)));

   object oCorpse = GetItemPossessor(GetObjectByTag("plasmatorch"));
   if (GetIsObjectValid(oCorpse)) {
       CreateItemOnObject("a_helmet_01", oCorpse);
CreateItemOnObject("a_helmet_02", oCorpse);
       CreateItemOnObject("a_helmet_03", oCorpse);
       CreateItemOnObject("a_robe_08", oCorpse);
       CreateItemOnObject("a_robe_09", oCorpse);

 }
}

So you must be doing something wrong because it's not the script. Double check the resref of your items and make sure you can acquire them with cheats. If you can't get your items with cheats in the game, then the problem is likely there. Make sure that each time you want to test the script you start a game from before opening the morgue door.

Link to comment
Share on other sites

Err...the script already contains all the a_doormor.ncs contents so there is no real point in re-executing the script at the end. The original contents of a_doormor.ncs are:
void main() {
   object oDoor = GetObjectByTag("MorgueDoor");
   SetLocked(oDoor, FALSE);
   DelayCommand(1.0, AssignCommand(oDoor, ActionOpenDoor(oDoor)));

 

edit: I just tried the following script (had to change the items because I don't have yours) and it worked perfectly:

void main() {
   object oDoor = GetObjectByTag("MorgueDoor");
   SetLocked(oDoor, FALSE);
   DelayCommand(1.0, AssignCommand(oDoor, ActionOpenDoor(oDoor)));

   object oCorpse = GetItemPossessor(GetObjectByTag("plasmatorch"));
   if (GetIsObjectValid(oCorpse)) {
       CreateItemOnObject("a_helmet_01", oCorpse);
CreateItemOnObject("a_helmet_02", oCorpse);
       CreateItemOnObject("a_helmet_03", oCorpse);
       CreateItemOnObject("a_robe_08", oCorpse);
       CreateItemOnObject("a_robe_09", oCorpse);

 }
}

So you must be doing something wrong because it's not the script. Double check the resref of your items and make sure you can acquire them with cheats. If you can't get your items with cheats in the game, then the problem is likely there. Make sure that each time you want to test the script you start a game from before opening the morgue door.

 

Well, crap. I don't know what I'm doing wrong :(

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...