Thread: [WIP] LDR's WIPs
View Single Post
Old 10-28-2010, 02:06 PM   #28
TimBob12
I'm in space!
 
TimBob12's Avatar
 
Join Date: Feb 2010
Location: Dantooine
Posts: 515
Current Game: Mass Effect 2!
Helpful! 
Quote:
Alright, I made my script, but I have 3 questions:
1.) Where do I put my X and Y Orientations?
2.) How do I add more people to this script, and also a placeable?
3.) How do I make this script work ingame?
I don't get what you mean by X and Y orientations

The three numbers you get when using the 'whereami' cheat should be entered in the brackets after 'Vector'.

Code:
CreateObject(OBJECT_TYPE_CREATURE, "kor_czex1", Location(Vector(#1,#2,#3), 0.0));
There is no way to get a number from the game about orientation so you just have to play around. The orientation goes immediately after the three numbers where the '0.0' is.
Code:
CreateObject(OBJECT_TYPE_CREATURE, "kor_czex1", Location(Vector(22.99,23.79,59.10), Orientation));
(This is the same for placeables by the way) to add more people just repeat the code but change "kor_czex1" to the tag of your other utc file.

To create a placeable replace 'OBJECT_TYPE CREATURE' with 'OBJECT_TYPE_PLACEABLE' and make "kor_czex1" the tag of your utp file.
Code:
CreateObject(OBJECT_TYPE_PLACEABLE, "kor_czex1", Location(Vector(22.99,23.79,59.10), 0.0));


OK, now comes the mini tutorial, getting it working in game. First you have to extract the original on_enter script for the area (should be a .ncs file) and rename it so it has 'old_' at the begining.

You already have most of your script done just make sure that before the final curly bracket you have:

Code:
ExecuteScript("old_old script name", OBJECT_SELF);
This means that the old code will still be run even with your new code running.

Then save your script BUT MAKE SURE THAT WHEN YOU SAVE IT THE EXTENSION IS .NSS AND THAT IT IS THE SAME NAME AS THE ORIGINAL ON_ENTER SCRIPT BEFORE YOU RENAMED IT OR THIS WILL NOT WORK!!!!!
(This cannot be stressed enough )

Then you have to open up KOTOR Tool and open up the text edior from the menu at the top.

Show spoiler


Then with the text editor open up your .nss file. (This is just an on_enter script I made for a mod i am making and it is for the Tatooine Cantina)
Show spoiler


This next step is very important. Go to the script menu at the top and click on 'Script is for KOTOR 1'.

Show spoiler


Now go to file, save and just overite the original file. (If you do this now then it doesn't make it more confusing later on.

Then go to the script menu again and click on 'Compile'

Show spoiler


If all went well and there were no errors then this should pop up:

Show spoiler


If not it will state the error and the line. Usually errors are quite easy to fix like you missed out a semi colon. If you get stuck you can post here or ask me .

Then if you look in the folder you saved the .nss , there should now be a .NCS file. This is your compiled script and the file that the game can read.

Now you need to place your new compiled script and your old renamed one in your Overide directory and you are DONE!. Phew. My longest post yet.

If you have any problems just post them and i will do my best to answer them

TimBob12


Hey
TimBob12 is offline   you may: quote & reply,