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.

making a placeable in dantooine?

Page: 1 of 1
 SithRevan
07-20-2006, 2:33 PM
#1
I was just wondering if somebody could help me with making a container in the jedi enclave on dantooine near jorran, I have been trying for a week to do it so I decided to get some help.

-SithRevan
 stoffe
07-20-2006, 4:35 PM
#2
I was just wondering if somebody could help me with making a container in the jedi enclave on dantooine near jorran, I have been trying for a week to do it so I decided to get some help.


You could do this by altering the script that makes Jorran open the door and come out of the room he's holed up in. The script is a_jorr_cs, and, if altered like below it should spawn a container from the template jorranbox.utp near where he stands inside the room.

You'll need to create a container placeable named like above, make sure it has the Tag field set to "jorranbox" as well, and save it in the override folder along with the script.


void main() {
// ST: ADDED - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Spawn the box near where Jorran stands.
if (!GetIsObjectValid(GetObjectByTag("jorranbox"))) {
location lLoc = GetLocation(GetObjectByTag("npc_jorran"));
vector vPos = GetPositionFromLocation(lLoc);
vPos.x += 1.5;
vPos.y += 1.5;
lLoc = Location(vPos, GetFacingFromLocation(lLoc));
CreateObject(OBJECT_TYPE_PLACEABLE, "jorranbox", lLoc);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

// ST: Open the door...
object oDoor = GetObjectByTag("jorr_door");
SetLocked(oDoor, FALSE);
DelayCommand(0.5, AssignCommand(oDoor, ActionOpenDoor(oDoor)));

// ST: Put the player in position...
AssignCommand(GetFirstPC(), ActionJumpToObject(GetObjectByTag("wp_jorr_pc"), TRUE));

// ST: Move Jorran out of the room.
DelayCommand(1.0, AssignCommand(GetObjectByTag("npc_jorran"), ActionMoveToObject(GetObjectByTag("wp_jorr_1"), TRUE)));
}


I've attached a compiled version of the above script in case you have trouble compiling scripts.
 SithRevan
07-20-2006, 10:40 PM
#3
Thank you so much I have been trying to figure that one out for a week.
 SithRevan
07-20-2006, 11:30 PM
#4
Just one more thing I was kinda wondering where to put the coordinates in this script, I am not sure just how to go about it.
 Darth333
07-20-2006, 11:40 PM
#5
Stoffe already took care of that for you with this:


location lLoc = GetLocation(GetObjectByTag("npc_jorran"));
vector vPos = GetPositionFromLocation(lLoc);
vPos.x += 1.5;
vPos.y += 1.5;


It will place the container near Jorran (1.5 m from his position) so unless you want something specific, you don't have to do anything.


If you absolutely want specific coordinates, then replace the following lines of the script:

if (!GetIsObjectValid(GetObjectByTag("jorranbox"))) {
location lLoc = GetLocation(GetObjectByTag("npc_jorran"));
vector vPos = GetPositionFromLocation(lLoc);
vPos.x += 1.5;
vPos.y += 1.5;
lLoc = Location(vPos, GetFacingFromLocation(lLoc));
CreateObject(OBJECT_TYPE_PLACEABLE, "jorranbox", lLoc);
}



With:


if (!GetIsObjectValid(GetObjectByTag("jorranbox"))) {

CreateObject(OBJECT_TYPE_PLACEABLE, "jorranbox", Location(Vector(0.00,0.00,0.00), 0.0));
}

Just replace the (0.00,0.00,0.00), 0.0 by your xyz coordinates and the orientation. The first 0.00 =x, the second = y, the third = z and the last 0.00 after the parenthesis is the orientation.

You'll also find a few extra options here: http://www.lucasforums.com/showthread.php?t=143536)
 SithRevan
07-20-2006, 11:46 PM
#6
Thank you very much I was really confused with that one, so thanks a lot.
 SithRevan
07-21-2006, 12:53 AM
#7
hey, also I was wondering how to put items in this container if someboy could help me with that I would be very thankful, Thanks.
 ChAiNz.2da
07-21-2006, 6:12 AM
#8
hey, also I was wondering how to put items in this container if someboy could help me with that I would be very thankful, Thanks.
Since you're going to need to create a custom .utp file (the "jorranbox.utp" container).. just add what you want in it by using the "Inventory" function (assuming you're using KotOR Tool)

When you open the function there will be a "split" screen...

To the left is a list of game items.. to the right will be the box's inventory. Just drag-n-drop items from the left over to the right :)

If you want to place 'custom' modded items... drag anything over from the left side of the screen over to the right, then re-name the ResRef field of the dragged item to your new item's ResRef tag...

Be sure after all is saved, said & done.. you remember to also place your custom/modded items (.uti) in your override folder... and of course, your jorranbox.utp ;)
 SithRevan
07-21-2006, 11:46 AM
#9
Thanks I was thinking that that would probly work but I wanted to get a professional opinion first, so thanks

-SithRevan
 SithRevan
07-21-2006, 1:04 PM
#10
Hey one more thing I was wondering how to put like bones by the container would I have to write a new script for it or could I put something else in the script to make it spawn another placeable, and if I can do that what would the script look like.
 Darth333
07-21-2006, 1:30 PM
#11
Just add the number of lines you need to the above code. Example:


if (!GetIsObjectValid(GetObjectByTag("jorranbox"))) {

CreateObject(OBJECT_TYPE_PLACEABLE, "jorranbox", Location(Vector(0.00,0.00,0.00), 0.0));
}
if (!GetIsObjectValid(GetObjectByTag("newplaceable2"))) {
CreateObject(OBJECT_TYPE_PLACEABLE, "newplaceable2", Location(Vector(0.00,0.00,0.00), 0.0));
}

replace newplaceable2 by the tag (1st line) and resref (second line) of your placeable. Make sure it does not exceed 16 characters.
 SithRevan
07-21-2006, 1:32 PM
#12
Thank you so much I really needed that!
Page: 1 of 1