PDA

View Full Version : createpcsaber script thoughts? (TSL)


Qui-Don Jorn
08-01-2010, 02:46 AM
Howdy!

Would anyone have an idea/thought on how to replace the default game saber you get from Atris after 650Dan?

What I want to do is replace the game saber you get from Atris as "your" saber with a custom Exile saber. I know that setpchilt.ncs and setsabercolor.ncs from 003EBO make createpcsaber.ncs, problem is, they are compiled already, so you cant edit that. So you would have to make a new script??
Would anyone have an idea on how to do this?
Anyone interested in writing that script?? At the moment I dont think i could.

Any and all advice would be greatly apprieciated. :)
Thanks
-KDJ

Darth_Calo
08-01-2010, 04:38 AM
you may have more success with this in the modding requests section

reivzje
08-01-2010, 01:50 PM
To do that you could try DeNCS Script Decompiler for Kotor 2 TSL who can be found on http://starwarsknights.com/tools.php :) Tough i have never tried DeNCS :)

Qui-Don Jorn
08-01-2010, 07:23 PM
To do that you could try DeNCS Script Decompiler for Kotor 2 TSL who can be found on http://starwarsknights.com/tools.php :) Tough i have never tried DeNCS :)

Oh ok.. didnt know that even existed.thanks!
Im trying to do this for my LS mod.

Edit: Now that Im thinking about it, a DeNcs'er is a great idea since i just want to change the templates in the 'createpcsaber' script. awesome.

DarthStoney
08-01-2010, 10:39 PM
I take it your using TSLRCM since in the default game Atris doesn't give your saber back.
this was the script I used to give your saber to you.
It's createpcsaber3.ncs in 262TEL and attatched to Atris's ending dialog(can't recall the exact name of the dialog file atm)
void main() {
int nGlobal = 0;
int int2 = 0;
string string1;
nGlobal = GetGlobalNumber("003EBO_PC_Hilt");
int2 = GetGlobalNumber("003EBO_PC_Lightsaber");
switch (int2) {
case 0:
switch (nGlobal) {
case 0:
string1 = "g_w_lghtsbr10";
break;
case 1:
string1 = "g_w_shortsbr10";
break;
case 2:
string1 = "g_w_dblsbr010";
break;
}
break;
case 1:
switch (nGlobal) {
case 0:
string1 = "g_w_lghtsbr02";
break;
case 1:
string1 = "g_w_shortsbr02";
break;
case 2:
string1 = "g_w_dblsbr002";
break;
}
break;
case 2:
switch (nGlobal) {
case 0:
string1 = "g_w_lghtsbr03";
break;
case 1:
string1 = "g_w_shortsbr03";
break;
case 2:
string1 = "g_w_dblsbr003";
break;
}
break;
case 3:
switch (nGlobal) {
case 0:
string1 = "g_w_lghtsbr01";
break;
case 1:
string1 = "g_w_shortsbr01";
break;
case 2:
string1 = "g_w_dblsbr001";
break;
}
break;
case 4:
switch (nGlobal) {
case 0:
string1 = "g_w_lghtsbr04";
break;
case 1:
string1 = "g_w_shortsbr04";
break;
case 2:
string1 = "g_w_dblsbr004";
break;
}
break;
case 5:
switch (nGlobal) {
case 0:
string1 = "g_w_lghtsbr05";
break;
case 1:
string1 = "g_w_shortsbr05";
break;
case 2:
string1 = "g_w_dblsbr005";
break;
}
break;
case 6:
switch (nGlobal) {
case 0:
string1 = "g_w_lghtsbr08";
break;
case 1:
string1 = "g_w_shortsbr08";
break;
case 2:
string1 = "g_w_dblsbr008";
break;
}
break;
case 7:
switch (nGlobal) {
case 0:
string1 = "g_w_lghtsbr09";
break;
case 1:
string1 = "g_w_shortsbr09";
break;
case 2:
string1 = "g_w_dblsbr009";
break;
}
break;
case 8:
switch (nGlobal) {
case 0:
string1 = "g_w_lghtsbr07";
break;
case 1:
string1 = "g_w_shortsbr07";
break;
case 2:
string1 = "g_w_dblsbr007";
break;
}
break;
case 9:
switch (nGlobal) {
case 0:
string1 = "g_w_lghtsbr11";
break;
case 1:
string1 = "g_w_shortsbr11";
break;
case 2:
string1 = "g_w_dblsbr011"; break;
}
break;
}
object object1 = CreateItemOnObject(string1, GetFirstPC(), 1, 0);
}

what you could do if you have a saber in mind to use is this simple script
void main() {
object oItem=CreateItemOnObject( ".uti name of saber", GetFirstPC());
}

Qui-Don Jorn
08-02-2010, 03:24 PM
Thank You!! I think thats exactly what I needed..
Yes, I guess I should have said that I was making it compatible with TSLRCM,..didnt think to. oops.
It's been so long with TSLRCM 1.5 installed that I forgot that that dosent happen in normal gameplay.

Is it possible in the first script to replace the default saber tags with my custom saber tags so that you get one of those instead? thats exactly what i wanted to do.
lemme go mess with this then Ill come back. :)
thanks again.
-KDJ

DarthStoney
08-02-2010, 07:30 PM
Is it possible in the first script to replace the default saber tags with my custom saber tags so that you get one of those instead?

Yes you can but you'll have to do the same for the original createpcsaber.ncs file also.
void main() {
int nGlobal = 0;
int int2 = 0;
string string1;
nGlobal = GetGlobalNumber("003EBO_PC_Hilt");
int2 = GetGlobalNumber("003EBO_PC_Lightsaber");
switch (int2) {
case 0:
switch (nGlobal) {
case 0:
string1 = "g_w_lghtsbr10";
break;
case 1:
string1 = "g_w_shortsbr10";
break;
case 2:
string1 = "g_w_dblsbr010";
break;
}
break;
case 1:
switch (nGlobal) {
case 0:
string1 = "g_w_lghtsbr02";
break;
case 1:
string1 = "g_w_shortsbr02";
break;
case 2:
string1 = "g_w_dblsbr002";
break;
}
break;
case 2:
switch (nGlobal) {
case 0:
string1 = "g_w_lghtsbr03";
break;
case 1:
string1 = "g_w_shortsbr03";
break;
case 2:
string1 = "g_w_dblsbr003";
break;
}
break;
case 3:
switch (nGlobal) {
case 0:
string1 = "g_w_lghtsbr01";
break;
case 1:
string1 = "g_w_shortsbr01";
break;
case 2:
string1 = "g_w_dblsbr001";
break;
}
break;
case 4:
switch (nGlobal) {
case 0:
string1 = "g_w_lghtsbr04";
break;
case 1:
string1 = "g_w_shortsbr04";
break;
case 2:
string1 = "g_w_dblsbr004";
break;
}
break;
case 5:
switch (nGlobal) {
case 0:
string1 = "g_w_lghtsbr05";
break;
case 1:
string1 = "g_w_shortsbr05";
break;
case 2:
string1 = "g_w_dblsbr005";
break;
}
break;
case 6:
switch (nGlobal) {
case 0:
string1 = "g_w_lghtsbr08";
break;
case 1:
string1 = "g_w_shortsbr08";
break;
case 2:
string1 = "g_w_dblsbr008";
break;
}
break;
case 7:
switch (nGlobal) {
case 0:
string1 = "g_w_lghtsbr09";
break;
case 1:
string1 = "g_w_shortsbr09";
break;
case 2:
string1 = "g_w_dblsbr009";
break;
}
break;
case 8:
switch (nGlobal) {
case 0:
string1 = "g_w_lghtsbr07";
break;
case 1:
string1 = "g_w_shortsbr07";
break;
case 2:
string1 = "g_w_dblsbr007";
break;
}
break;
case 9:
switch (nGlobal) {
case 0:
string1 = "g_w_lghtsbr11";
break;
case 1:
string1 = "g_w_shortsbr11";
break;
case 2:
string1 = "g_w_dblsbr011";
break;
}
break;
}
object object1 = CreateItemOnObject(string1, OBJECT_SELF, 1, 0);
ActionEquipItem(object1, 4, 0);
ActionPlayAnimation(115, 1.0, 0.0);
}

If you want Atris to have it when she attacks you, you'll need to modify a_atrisweapon.ncs and a_atrisweapon2.ncs. If you need the source files (.nss) for those I can send/post them also.

Qui-Don Jorn
08-03-2010, 08:54 PM
Yes you can but you'll have to do the same for the original createpcsaber.ncs file also.
void main() {
int nGlobal = 0;
int int2 = 0;
string string1;
nGlobal = GetGlobalNumber("003EBO_PC_Hilt");
int2 = GetGlobalNumber("003EBO_PC_Lightsaber");
switch (int2) {
case 0:
switch (nGlobal) {
case 0:
string1 = "g_w_lghtsbr10";
break;
case 1:
string1 = "g_w_shortsbr10";
break;
case 2:
string1 = "g_w_dblsbr010";
break;
}
break;
case 1:
switch (nGlobal) {
case 0:
string1 = "g_w_lghtsbr02";
break;
case 1:
string1 = "g_w_shortsbr02";
break;
case 2:
string1 = "g_w_dblsbr002";
break;
}
break;
case 2:
switch (nGlobal) {
case 0:
string1 = "g_w_lghtsbr03";
break;
case 1:
string1 = "g_w_shortsbr03";
break;
case 2:
string1 = "g_w_dblsbr003";
break;
}
break;
case 3:
switch (nGlobal) {
case 0:
string1 = "g_w_lghtsbr01";
break;
case 1:
string1 = "g_w_shortsbr01";
break;
case 2:
string1 = "g_w_dblsbr001";
break;
}
break;
case 4:
switch (nGlobal) {
case 0:
string1 = "g_w_lghtsbr04";
break;
case 1:
string1 = "g_w_shortsbr04";
break;
case 2:
string1 = "g_w_dblsbr004";
break;
}
break;
case 5:
switch (nGlobal) {
case 0:
string1 = "g_w_lghtsbr05";
break;
case 1:
string1 = "g_w_shortsbr05";
break;
case 2:
string1 = "g_w_dblsbr005";
break;
}
break;
case 6:
switch (nGlobal) {
case 0:
string1 = "g_w_lghtsbr08";
break;
case 1:
string1 = "g_w_shortsbr08";
break;
case 2:
string1 = "g_w_dblsbr008";
break;
}
break;
case 7:
switch (nGlobal) {
case 0:
string1 = "g_w_lghtsbr09";
break;
case 1:
string1 = "g_w_shortsbr09";
break;
case 2:
string1 = "g_w_dblsbr009";
break;
}
break;
case 8:
switch (nGlobal) {
case 0:
string1 = "g_w_lghtsbr07";
break;
case 1:
string1 = "g_w_shortsbr07";
break;
case 2:
string1 = "g_w_dblsbr007";
break;
}
break;
case 9:
switch (nGlobal) {
case 0:
string1 = "g_w_lghtsbr11";
break;
case 1:
string1 = "g_w_shortsbr11";
break;
case 2:
string1 = "g_w_dblsbr011";
break;
}
break;
}
object object1 = CreateItemOnObject(string1, OBJECT_SELF, 1, 0);
ActionEquipItem(object1, 4, 0);
ActionPlayAnimation(115, 1.0, 0.0);
}

If you want Atris to have it when she attacks you, you'll need to modify a_atrisweapon.ncs and a_atrisweapon2.ncs. If you need the source files (.nss) for those I can send/post them also.

Thanks!
Yeah, that was in Atrend3.dlg...

So I guess it dosent matter if there's a PC restrict on the saber?
I would think it would.
I'd be grateful if you wanted to do that for me..I really dont understand how to make scripts yet. But im learning little by little..

Heck, if I could bother you for it, I needed a conditional where it checks if the cnpc (Atton, BD, HM) is a jedi yet. So I could trigger a "time to make your saber" node off the main dlg node..tried c_npc_class.nss from USM's script source folder but i dont think that's what I need.
So, thanks for your help!
-KDJ

DarthStoney
08-03-2010, 10:46 PM
I believe you could use this for Atton its more or less what we added for Atton's training stuff.(I just removed the global it sets also)
int StartingConditional() {
return (((GetClassByPosition(2, GetObjectByTag("Atton", 0) == 5)));
}
for BaoDurr change the "tag" to Baodurr and the number 5 to 3(this is the jediclass).
JediGaurdian is 3 (BaoDurr,Handmaiden)
Jediconsular is 4 (Disciple)
Jedisentinal is 5 (Atton,Mira,VisasMarr)

If your going to restrict the saber to the PC then don't change the Atris scripts she'll just use a saber based of the 2 global settings you picked for your saber and use a standard game saber.

Qui-Don Jorn
08-04-2010, 11:16 PM
I believe you could use this for Atton its more or less what we added for Atton's training stuff.(I just removed the global it sets also)
int StartingConditional() {
return (((GetClassByPosition(2, GetObjectByTag("Atton", 0) == 5)));
}
for BaoDurr change the "tag" to Baodurr and the number 5 to 3(this is the jediclass).
JediGaurdian is 3 (BaoDurr,Handmaiden)
Jediconsular is 4 (Disciple)
Jedisentinal is 5 (Atton,Mira,VisasMarr)

If your going to restrict the saber to the PC then don't change the Atris scripts she'll just use a saber based of the 2 global settings you picked for your saber and use a standard game saber.

Right, thats what i thought...those globals being the setsabercolor and setpchilt..yes? so then, createpcsaber2.ncs dosent need any modifying?

Thanks again Stoney, very awesome of you!..oh no my laptops gonna die...
KDJ

DarthStoney
08-04-2010, 11:51 PM
Right, thats what i thought...those globals being the setsabercolor and setpchilt..yes? so then, createpcsaber2.ncs dosent need any modifying?


Correct thats all the globals do, createpcsaber3.ncs is the only file you will need to change(it's the one that actually gives the saber to the pc).

PS, once we get the download section back at deadlystream I will re-upload the source files for TSLRCM.

vanir
08-05-2010, 02:14 PM
Hang on a second, I'm confused. Atris gives you your sabre back in TSLRCM? I tried to achieve this just in case (because I had the mod before but removed it), but I thought it unlikely since it would make the PC sabre quest redundant. Anyway it was a no go by any dialogue options I found, trying to explore them just sent Atris back into loops as if we'd just met but had actually been talking for ages.

Is it in current TSLRCM 1.6 or are you talking about a future update of TSLRCM stoney?
If so how did you handle the PC sabre quest, or does Atris give you the sabre back later, when you fight her?

DarthStoney
08-05-2010, 03:31 PM
Hang on a second, I'm confused. Atris gives you your sabre back in TSLRCM? I tried to achieve this just in case (because I had the mod before but removed it), but I thought it unlikely since it would make the PC sabre quest redundant. Anyway it was a no go by any dialogue options I found, trying to explore them just sent Atris back into loops as if we'd just met but had actually been talking for ages.

Is it in current TSLRCM 1.6 or are you talking about a future update of TSLRCM stoney?
If so how did you handle the PC sabre quest, or does Atris give you the sabre back later, when you fight her?

It's been in since at least 1.5 but yes ,you get it back after you fight her(she also uses it when you fight her instead of just using a red one(unless it's what you pick at the begining of the game).

vanir
08-06-2010, 11:09 PM
Cool, that makes sense and I was actually expecting it in the original vanilla, being a little surprised when it didn't happen and a little disappointed she suddenly broke out a red sabre. Even as a Sith/dark Jedi it seems a little more poetic she would attack you with your own lightsabre.

After all obviously her whole trip is presuming to be the sole inheritor of the entire Jedi Order and by default its council to boot, she doesn't consider herself Sith but then I guess many dark Jedi probably never did until it was too late and other Sith or Jedi pointed it out.

In that final battle she in part views the Exile as the catalyst for her entire world crumbling around her. I think it would be to her mind poetic justice that she would intentionally attack the Exile with his/her own sabre.

Yet another measure of common sense and logical plot restoration from the TSLRCM crew.

Qui-Don Jorn
08-12-2010, 06:06 AM
I believe you could use this for Atton its more or less what we added for Atton's training stuff.(I just removed the global it sets also)
int StartingConditional() {
return (((GetClassByPosition(2, GetObjectByTag("Atton", 0) == 5)));
}
for BaoDurr change the "tag" to Baodurr and the number 5 to 3(this is the jediclass).
JediGaurdian is 3 (BaoDurr,Handmaiden)
Jediconsular is 4 (Disciple)
Jedisentinal is 5 (Atton,Mira,VisasMarr)

If your going to restrict the saber to the PC then don't change the Atris scripts she'll just use a saber based of the 2 global settings you picked for your saber and use a standard game saber.

Hey Stoney, I discovered something the other day.

a) this script wasnt working at first, so I looked at it closely, and found that you have a closing parantheses missing after ("Atton", 0).
So i put it in and it worked, then i jumped for joy.
Then it occured to me that if this is the script you used for his training in RCM 1.6 (c_att_jedi) then that would also be why it's not working either, Atton just keeps saying "I cant use that"...SO, I replaced it with my c_atton_jedi.ncs.
Then i remembered you said you took the global it sets out of the above script. So I now have to ask if you could do me a flavor and repost that script with nothing taken out, so a) I can learn how to write something like that, and b) so i can replace it in my override so his training lines will work. I know its SetGlobalNumber ( something something something....
2 birds 1 rock.


thanks,
-KDJ

DarthStoney
08-13-2010, 11:37 PM
here's the original
int StartingConditional() {
return (((GetClassByPosition(2, GetObjectByTag("Atton", 0)) == 5) && (GetGlobalNumber("000_Atton_Learn") == 0)));
}

Atton only learns force forms your exile knows,so if you don't have the next one he can learn he just says "I can't use that". there are other check scripts for those.

Qui-Don Jorn
08-14-2010, 02:02 PM
Gotcha. Thanks!!