Jump to content

Home

easier? (Placing Items In The Game)


akuma7802

Recommended Posts

ok i understand but the thing is that would i have to make a new script or just add on to another. i am looking for the cutscenes in the dialog editor but maybe i just looking for the wrong thing. ok darthrevanrlz maybe you can help me if u got it b/c i am still kinda stumped. on outting the footlocker in the script and having the footlocker appear where i want it in the game. and where in the keria dialog i can find the "awake" cutscrene

Link to comment
Share on other sites

and where in the keria dialog i can find the "awake" cutscrene

 

This is not present in the main kreia.dlg file. The scene where you awaken in the kolto tank in the MedBay is found separately in the 101awake.dlg file, found in (in KotorTools treeview) Kotor2 --> ERFs --> Modules --> 101PER_dlg.erf --> 1 --> 101awake.dlg. The chat with Kreia in the morgue is found in the 101kreia.dlg file in the same location.

Link to comment
Share on other sites

I am having a little trouble b/c the foot locker i want to put in the game is not appearing at all and including the cutscrene. where keria wakes up in the begining now she just appears to be standing and does not even show her getting up. hwere would be the best place to put the footlocker in the script to actived the new footlocker and so it will appear in the game.

Link to comment
Share on other sites

I am having a little trouble b/c the foot locker i want to put in the game is not appearing at all and including the cutscrene. where keria wakes up in the begining now she just appears to be standing and does not even show her getting up.

 

Sounds like your DLG files have been corrupted. What did you use to edit the dialog files? The DLG editor in KotorTool does not work with KotOR2, and will corrupt files you save with it. You'll either have to use tk102's DLG Editor, or a GFF Editor.

 

To spawn my own custom gear container I have modified the a_hatchopen script in the 101PER module. This is the script that runs when you wake up in the kolto tank in the Peragus Medbay. I'm using it to add an extra plasteel cylinder in the storage area and that seems to work fine. :)

Link to comment
Share on other sites

i was using the tk102's dlg editor but i was using a script that was already been mod. no where in the script lets take what u was using the a_hatchopen where would i put the new foot locker or placeable.

 

could u send me your modified script and the plasteel cylinder aso i can have a good idea what i am doing wrong. maybe i am putting the new footlocker in the wrong slot.

Link to comment
Share on other sites

could u send me your modified script and the plasteel cylinder aso i can have a good idea what i am doing wrong. maybe i am putting the new footlocker in the wrong slot.

 

Here is the modified a_hatch_open.nss script I've used. I've avoided creating a new container placeable and used one of the standard ones in the game instead, which I then add my custom items to in the script. The cylinder is spawned inside the storage room opposite to the computer console that unlocks the morgue where Kreia rests.

 

Look for the part of the script inside the "------" dashed lines:

 

// ST: a_hatch_open.nss (101PER_s.rim)


void RemoveT3();

// ST: custom function used to spawn storage bin if necessary.
object ST_SpawnStorageBin();

void main() {
   object oEnter = GetEnteringObject();

   if (GetEnteringObject() == GetFirstPC()) {
       if (GetGlobalNumber("101PER_Sion_Arrives") > 0)
           PlayRoomAnimation("101PERzc", ANIMATION_ROOM_SCRIPTLOOP01);
       else
           PlayRoomAnimation("101PERzc", ANIMATION_ROOM_SCRIPTLOOP02);

       if (GetLoadFromSaveGame()) {
           SetGlobalFadeOut();
           SetFadeUntilScript();
           DelayCommand(2.0, SetGlobalFadeIn(1.0, 1.0));   
           return;
       }

       if (GetGlobalBoolean("PER_TURNINTO_T3M4")) {
           SetGlobalBoolean("PER_TURNINTO_T3M4", FALSE);
           DelayCommand(0.1, RemoveT3());  
       }

       if (GetGlobalNumber("105PER_T3_End") == 1) {
           SetGlobalFadeIn(0.0, 1.0);
           SetGlobalNumber("105PER_T3_End", 2);
           object oAtton = GetObjectByTag("Atton");
           DelayCommand(0.5, AssignCommand(oAtton, ClearAllActions()));    
           DelayCommand(0.5, AssignCommand(oAtton, ActionStartConversation(oEnter, "101Atton", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE)));
       }

       object oWP = GetObjectByTag("WP_wakeup_donnie");
       if (GetIsObjectValid(oWP) && GetLocalBoolean(oWP, 29)) {
           PlayRoomAnimation("101per2b", ANIMATION_ROOM_SCRIPTLOOP03);
       }
       else {  
           if (GENDER_MALE == GetGender(oEnter)) {
               SetGlobalBoolean("000_PLAYER_GENDER", TRUE);
               // ST: Don't!
               // return;
           }

           // ST: ADD CUSTOM ITEMS TO START WITH HERE -----------------
           object oBin = ST_SpawnStorageBin();
           if (GetIsObjectValid(oBin)) {
               CreateItemOnObject("st_alisrobe03", oBin);
               CreateItemOnObject("st_alisbelt01", oBin);
               CreateItemOnObject("st_aliscirclet", oBin);
           }
           // ---------------------------------------------------------

           SetGlobalFadeOut();
           SetFadeUntilScript();           
       }
   }
}


void RemoveT3() {
   object oT3 = GetObjectByTag("t3m4");
   if (GetIsObjectValid(oT3)) {
       AurPostString("destroying t3 off the map", 5, 15, 10.0);
       DestroyObject(oT3);
   }
   SetNPCSelectability(NPC_T3_M4, FALSE);

   object oPC = GetFirstPC();
   effect eEff = GetFirstEffect(oPC);
   while (GetIsEffectValid(eEff)) {
       if (GetEffectType(eEff) == EFFECT_TYPE_PARALYZE)
           RemoveEffect(oPC, eEff);    

       eEff = GetNextEffect(oPC);
   }

   SetGlobalFadeIn(0.0, 2.0);
}


// ST: custom function used to spawn storage bin if necessary.
object ST_SpawnStorageBin() {
   location lLoc = Location(Vector(-0.99, -5.8, 9.09), 138.0);
   int nIdx = 0;
   int bFound = FALSE;

   object oBin = GetObjectByTag("MilHighPlstcCylin", nIdx);
   while (GetIsObjectValid(oBin)) {
       if (GetDistanceBetweenLocations2D(GetLocation(oBin), lLoc) < 0.5) {
           bFound = TRUE;
           break;  
       }
       oBin = GetObjectByTag("MilHighPlstcCylin", ++nIdx);
   }

   if (!GetIsObjectValid(oBin) || !bFound) {   
       oBin = CreateObject(OBJECT_TYPE_PLACEABLE, "g_tresmilhig005", lLoc);

       if (GetIsObjectValid(oBin)) {
           RemoveHeartbeat(oBin);
           return oBin;            
       }
   }
   return OBJECT_INVALID;  
}

Link to comment
Share on other sites

oh ok so do i add that to a .dlg or just compile that into .ncs sorry i am a little blonde when it comes to this. ok i am really blonde its like u have to point it out and show me how to do it i am really sorry.

 

ok i could the basics of the making my own footlocker with tk. i made a nss and compiled it to .ncs. the script is the problem and the cutscrenes. now do i make a script like u then put into the overdrive or can i put the new footlocker into a .dlg like 101keria. not sure b/c i just want a custom footlocker with custom items and placed where i want. and i know this is really complicated. like i said i am sorry.

Link to comment
Share on other sites

Oh ok. So, do I add that to a .dlg or just compile that into .ncs? Sorry I am a little blonde when it comes to this. Ok I am really blonde, it's like you have to point it out and show me how to do it.

 

You compile the a_hatch_open.nss file with nwnnsscomp and put the resulting NCS file into the override folder. Nothing else should be necessary, since the script is already assigned as the OnEnter event script of the Peragus Administration level.

 

If you want to use a custom UTP template for the container instead of a standard game plasteel cylinder, just replace the Tag and ResRef of the cylinder with the corresponding values for your own UTP. Check the custom function at the bottom of the script, they shouldn't be hard to find.

Link to comment
Share on other sites

Did you double post that on purpose? It looks like you did, because it was three hours and twenty-seven minutes apart.

 

Bumping is not allowed, as per forum rules.

 

Don't worry, this community is helpful -- you'll get an answer -- but remember, it's not a chat room. It takes time :)

 

If you click 'Edit this' under your post and delete the second one, I will delete this post and you can delete the post that explains what happened.

 

Sorry about the misunderstanding.

 

_EW_

Link to comment
Share on other sites

in the script what part do i need to change for .dlg?

 

if (GetEnteringObject() == GetFirstPC()) {
       if (GetGlobalNumber("101PER_Sion_Arrives") > 0)
           PlayRoomAnimation("101PERzc", ANIMATION_ROOM_SCRIPTLOOP01);?
       else
           PlayRoomAnimation("101PERzc", ANIMATION_ROOM_SCRIPTLOOP02);

       if (GetLoadFromSaveGame()) {
           SetGlobalFadeOut();
           SetFadeUntilScript();
           DelayCommand(2.0, SetGlobalFadeIn(1.0, 1.0));   
           return;
       }

       if (GetGlobalBoolean("PER_TURNINTO_T3M4")) {
           SetGlobalBoolean("PER_TURNINTO_T3M4", FALSE);
           DelayCommand(0.1, RemoveT3());  
       }

       if (GetGlobalNumber("105PER_T3_End") == 1) {
           SetGlobalFadeIn(0.0, 1.0);
           SetGlobalNumber("105PER_T3_End", 2);
           object oAtton = GetObjectByTag("Atton");?
           DelayCommand(0.5, AssignCommand(oAtton, ClearAllActions()));    
           DelayCommand(0.5, AssignCommand(oAtton, ActionStartConversation(oEnter, "101Atton", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE)));
       }

       object oWP = GetObjectByTag("WP_wakeup_donnie");?
       if (GetIsObjectValid(oWP) && GetLocalBoolean(oWP, 29)) {
           PlayRoomAnimation("101per2b", ANIMATION_ROOM_SCRIPTLOOP03);?

this part where it says t3m4?

void RemoveT3() {
   object oT3 = GetObjectByTag("t3m4");
   if (GetIsObjectValid(oT3)) {
       AurPostString("destroying t3 off the map", 5, 15, 10.0);
       DestroyObject(oT3);
   }
   SetNPCSelectability(NPC_T3_M4, FALSE);

   object oPC = GetFirstPC();
   effect eEff = GetFirstEffect(oPC);
   while (GetIsEffectValid(eEff)) {
       if (GetEffectType(eEff) == EFFECT_TYPE_PARALYZE)
           RemoveEffect(oPC, eEff);    

       eEff = GetNextEffect(oPC);
   }

   SetGlobalFadeIn(0.0, 2.0);
}


// ST: custom function used to spawn storage bin if necessary.
object ST_SpawnStorageBin() {
   location lLoc = Location(Vector(-0.99, -5.8, 9.09), 138.0);
   int nIdx = 0;
   int bFound = FALSE;

   object oBin = GetObjectByTag("MilHighPlstcCylin", nIdx);
   while (GetIsObjectValid(oBin)) {
       if (GetDistanceBetweenLocations2D(GetLocation(oBin), lLoc) < 0.5) {
           bFound = TRUE;
           break;  
       }
       oBin = GetObjectByTag("MilHighPlstcCylin", ++nIdx);?
   }

   if (!GetIsObjectValid(oBin) || !bFound) {   
       oBin = CreateObject(OBJECT_TYPE_PLACEABLE, "g_tresmilhig005", lLoc);

       if (GetIsObjectValid(oBin)) {
           RemoveHeartbeat(oBin);
           return oBin;            
       }
   }
   return OBJECT_INVALID;  
}

 

oh and the question marks i am kinda wondering aobut those.

Link to comment
Share on other sites

in the script what part do i need to change for .dlg?

oh and the question marks i am kinda wondering aobut those.

 

That script is not a script made to be fired from a dialog (.dlg) file. It is made to be automatically run every time the player enters the area it is assigned to (101PER, Peragus Administration in this case).

 

So, if you for some reason want to fire it from a dialog you'll have to change pretty much all of it. You might as well start over from scratch then. :) If you only want the part that spawns a new container and fills it with custom items that script could look something like:

 

object SpawnStorageBin();

void main() {
   object oBin = SpawnStorageBin();
   if (GetIsObjectValid(oBin)) {
       CreateItemOnObject("[color=Red][b]FirstItemResref[/b][/color]", oBin);
       CreateItemOnObject("[color=Red][b]SecondItemResref[/b][/color]", oBin);
       CreateItemOnObject("[color=Red][b]ThirdItemResref[/b][/color]", oBin);
   }
}

object SpawnStorageBin() {
   location lLoc = Location(Vector([color=Green][b]-0.99, -5.8, 9.09[/b][/color]), [color=SkyBlue][b]138.0[/b][/color]);
   int nIdx = 0;
   int bFound = FALSE;

   object oBin = GetObjectByTag("[color=Yellow][b]MilHighPlstcCylin[/b][/color]", nIdx);
   while (GetIsObjectValid(oBin)) {
       if (GetDistanceBetweenLocations2D(GetLocation(oBin), lLoc) < 0.5) {
           bFound = TRUE;
           break;  
       }
       oBin = GetObjectByTag("[color=Yellow][b]MilHighPlstcCylin[/b][/color]", ++nIdx);
   }

   if (!GetIsObjectValid(oBin) || !bFound) {   
       oBin = CreateObject(OBJECT_TYPE_PLACEABLE, "[color=Pink][b]g_tresmilhig005[/b][/color]", lLoc);

       if (GetIsObjectValid(oBin)) {
           RemoveHeartbeat(oBin);
           return oBin;            
       }
   }
   return OBJECT_INVALID;  
}

 

The things marked in bold above is what you may need to change. Replace the text in red with the ResRef values of the items you wish the container to contain. Replace the text in green with the x, y, z coordinates in-game you want the container to appear. Replace the text in blue with the direction, in degrees, you want the container to be facing. Replace the text in yellow with the Tag of the container placeable you wish to spawn. And finally, replace the text in pink with the ResRef of the container placeable you wish to spawn.

 

Save the script as whatever name you like (max 16 character, alphanumerical characters only!) and compile it into a NCS file, which you put in override. Then you put this name (without the .ncs extension) in the Script# field on the dialog node in a .dlg file where you want it to be fired.

 

 

 

The question marks looks like something a text editor which can't handle both Linefeed + Carriage return for marking a new line, showing the unhandled of the pair as a ? instead. Seems like that text in question is inconsistent in how it marks a new line.

Link to comment
Share on other sites

i think there is something wrong with my dialog files b/c when i place the .ncs in the script # and then place it in the overdrive file the placeable still does not show up. i am using the KT to compile the nss to ncs and that might be it i am not sure.

Link to comment
Share on other sites

i think there is something wrong with my dialog files b/c when i place the .ncs in the script # and then place it in the overdrive file the placeable still does not show up. i am using the KT to compile the nss to ncs and that might be it i am not sure.

 

Hard to say what could be wrong without knowing what you have done. Some things to check:

  1. Make sure your changes to the DLG file has been saved. You usually have to select another field or node after having changed things, otherwise your changes may not be kept when you save.
     
     
  2. Make sure you've added the script to the correct DLG node. Sometimes there are many that looks similar but fire under different circumstances.
     
     
  3. Make sure you've set the script name correctly. If your script is named spawnbox.ncs, you should put spawnbox in the Script# field.
     
     
  4. In the script, make sure you've set the coordinates for the container correctly. Unlike creatures, placeables may be spawned "inside" other placeables, or outside the game world (inside walls, below the floor, above the ceiling etc) without problems.
     
     
  5. If you use a custom container placeable that you've made yourself, make sure it's in the override folder and that its filename conforms to the ResRef rules (i.e. only alpanumerical characters and underscores, max 16 characters in length).
     
     
  6. Make sure you've set the ResRef of the container properly in the script. If your container placeable is named mybox.utp, put "mybox" as the ResRef in the script.
     
     
  7. Make sure you've set the Tag of the container properly in the script. This is specified in the Tag field inside the UTP file of the placeable and is not necessarily the same as the ResRef (though I recommend making them the same if you create your own placeables for simplicity's sake).

Link to comment
Share on other sites

object SpawnStorageBin();

 

void main() {

object oBin = SpawnStorageBin();

if (GetIsObjectValid(oBin)) {

CreateItemOnObject("u_l_colo_26", oBin);

CreateItemOnObject("u_l_colo_29", oBin);

CreateItemOnObject("djmask", oBin);

}

}

 

object SpawnStorageBin() {

location lLoc = Location(Vector(70.82, 37.37, 1.80),14.57 );

int nIdx = 0;

int bFound = FALSE;

 

object oBin = GetObjectByTag("footlocker99", nIdx);

while (GetIsObjectValid(oBin)) {

if (GetDistanceBetweenLocations2D(GetLocation(oBin), lLoc) < 0.5) {

bFound = TRUE;

break;

}

oBin = GetObjectByTag("footlooker99", ++nIdx);

}

 

if (!GetIsObjectValid(oBin) || !bFound) {

oBin = CreateObject(OBJECT_TYPE_PLACEABLE, "footlker099", lLoc);

 

if (GetIsObjectValid(oBin)) {

RemoveHeartbeat(oBin);

return oBin;

}

}

return OBJECT_INVALID;

}

thats what i have now and the .dlg can i make it where on perogus pc opnes a door and the box appears?

 

Is it possible to spawn a box from a dialog that you can open a door?

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...