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.

scripting help

Page: 1 of 1
 m16965
12-03-2006, 2:51 PM
#1
hey! does anyone know the script to spawn a simple blue lightsaber when you activate a certan dialouge choice. im still new to this scripting stuff and i mostly rely on a scripting genarator.
thanks!
:sithk:
 Inyri
12-03-2006, 3:00 PM
#2
http://www.lucasforums.com/showthread.php?s=&threadid=143412)

Look for "How can I script an object into my Inventory?" Replace "item template" with g_w_lghtsbr01 and simply add the bit to your script. Don't forget your brackets and your opening statement and such.

The final script should look like this:
void main()
{
object oItem=CreateItemOnObject("g_w_lghtsbr01", GetFirstPC());
}If you can understand what each part of the script does, you'll understand how to write simple scripts better.
 m16965
12-03-2006, 3:31 PM
#3
thanks inyri.

do i just copy this to a nss file then compile it?
 m16965
12-03-2006, 4:04 PM
#4
well i did the script and installed this nsscomp. i put it in the override folder with blank.nss, (my script.nss) and nwscript.nss. i have double clicked on the nsscomp and i get this.

" __ __
" ___ ___ ___ _______ __ _ ___ / / ___ _/ /_
" / _ \(_-<(_-</ __/ _ \/ ' \/ _ \_ / _ \/ _ `/ __/
" /_//_/___/___/\__/\___/_/_/_/ .__(_)_.__/\_,_/\__/
" /_/
Contents of nsscomp-log.txt is as follows:
Could Not Find C:\Program Files\LucasArts\SWKotOR2\override\*.ndb
-------------------------------------------
NSSCOMP.bat output 03/12/2006 21:03
-------------------------------------------
Unable to locate or open Neverwinter Night
Unable to locate or open Neverwinter Night
Unable to locate or open Neverwinter Night
Unable to locate or open Neverwinter Night
Unable to locate or open Neverwinter Night
Unable to locate or open Neverwinter Night
Unable to locate or open Neverwinter Night
Unable to locate or open Neverwinter Night
Unable to locate or open Neverwinter Night
-------------------------------------------
Compilation complete: 9/9 files compiled
Press any key to continue . . .

anybody know how to help? :ball:
 Lit Ridl
12-04-2006, 11:39 AM
#5
http://www.lucasforums.com/showthread.php?s=&threadid=143412)

Look for "How can I script an object into my Inventory?" Replace "item template" with g_w_lghtsbr01 and simply add the bit to your script. Don't forget your brackets and your opening statement and such.

The final script should look like this:
void main()
{
object oItem=CreateItemOnObject("g_w_lghtsbr01", GetFirstPC());
}If you can understand what each part of the script does, you'll understand how to write simple scripts better.
Hmm...
Don't you need to use your object then to fire the event???
It looks like you have only identified and declared your constant.
But it should be called as I remember...
void main()
{
int nQuantity = 1;
CreateItemOnObject("g_w_lghtsbr01", GetFirstPC(), nQuantity);
}
And here you may change nQuantity to any number you want, you will get this amount of items. In this example you will get 1 item with ResRef g_w_lghtsbr01 that will be given to the player.
p.s.: you may use Kotor Tool to compile some scripts.
Do it in this way: copy nwscript.nss to your Kotor II's Override folder.
Open your Kotor Tool. Look for black button labeled Txt
Click on it, open your .nss script in it, and then go to Script/Script is for KotOR II.
Then press F5.
Put the resulting .ncs script in your Override folder, this is compiled, ready for in-game work script.
 m16965
12-04-2006, 1:52 PM
#6
thanks very much lit ridl

do i change the nQuantity to a number just like this

void main()
{
int nQuantity = 1;
CreateItemOnObject("g_w_lghtsbr01", GetFirstPC(), 1);
}
 Lit Ridl
12-04-2006, 2:19 PM
#7
thanks very much lit ridl

do i change the nQuantity to a number just like this

void main()
{
int nQuantity = 1;
CreateItemOnObject("g_w_lghtsbr01", GetFirstPC(), 1);
}

Yes, you may.
But it will be more visually appealable if you will do it like this:
void main()
{
int nQuantity = 12;
CreateItemOnObject("g_w_lghtsbr01", GetFirstPC(), nQuantity);
}
In this example I want to get 12 items.
void main()
{
int nQuantity = 7;
CreateItemOnObject("g_w_lghtsbr01", GetFirstPC(), nQuantity);
}
In this, I want to get 7 items.
 m16965
12-04-2006, 2:31 PM
#8
okay thats actually quite interesting

can you get me the scripts for that you can warp somewhare and that you complete a quest

thanks again!

m16965
 Lit Ridl
12-04-2006, 11:49 PM
#9
can you get me the scripts for that you can warp somewhare and that you complete a quest

Script to warp somewhere is like this:
void main ()
{
string sModule = "file_name";
StartNewModule(sModule);
}
In this example change file_name to your module's filename, without extension.
If you want to warp to some module to the specific waypoint, use this:
void main ()
{
string sModule = "file_name";
string sWayPoint = "waypoint_name";
StartNewModule(sModule, sWayPoint);
}
Replace waypoint_name with your waypoint's name.
About quest.
this will be like this:
void main ()
{
string sQuestTag = "quest_tag";
AddJournalQuestEntry(sQuestTag, 99);
}
Here you have to repalce quest_tag with your quest's tag, as it specified in global.jrl file.
99 - is you quest's state, usually 99 marks finishing the quest. But, again, look in global.jrl file to see what is actually the last entry. Also, some qests do have LS/DS variants... So look in global.jrl....
 m16965
12-05-2006, 4:00 PM
#10
ook in global.jrl

how do i look in it or open it with?
 SithRevan
12-05-2006, 4:27 PM
#11
You would open it with a gff editor. Personally my favorite one is KGFF editor of the starwarsknights.com modding tools web page.
Page: 1 of 1