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.

Create Jedi scripts...

Page: 1 of 1
 Gorgod
11-26-2010, 3:12 PM
#1
I'm currently developing a modification that will allow you to train your party members as Jedi/Dark Jedi, just like in KOTOR II. I'm not a very experienced scripter, so I was wondering if you guys could help me out. I tried consulting RedHawke's "make Mission/Carth/Canderous Jedi" mods, but I couldn't find those, so I'm on my own- with the help of LucasForums, of course. :P What script will add a new class to a party member, making them a multi-class Jedi?

Another problem I have is how to configure the dialogue to make it so it's only after a certain part in the game. I know that it needs to be placed in "Script that determines availability", but I don't know the script. For example, to make Carth a Jedi/Dark Jedi, it must be after the Leviathan. To make Mission/Canderous a Jedi/Dark Jedi, it must be after Taris. To make Zaalbar a Jedi/Dark Jedi, it must be after the Chuundar squabble on Kashyyyk.

Another script I need is to how to automatically make the party member gain, and equip, a lightsaber.

And one more- how to change the party member's alignment.

I know it's a lot, but I'd really appreciate some help with this.
 Stream
11-27-2010, 3:26 PM
#2
First you need to define the party member and the lightsaber.

object oNPC = GetObjectByTag("NPC_TAG", 0);
object oSaber = GetObjectByTag("LIGHTSABER_TAG", 0);
Next you have to assign the additional class you want them to have.

3 = Guardian
4 = Consular
5 = Sentinel

AddMultiClass(3, oNPC);
This will alter the alignment of the party member. This example adjusts their light side alignment by 20 points, if you wanted them to go dark side you would change it from LIGHT to DARK.

I believe you can only alter it my a maximum of 50 and it alters it from their current alignment so for example if the party members alignment was 100% light and you set the script to dark and 50 that would then only make them neutral.

AdjustAlignment(oNPC, ALIGNMENT_LIGHT_SIDE, 20);
I'm not too sure if this next part is right or not, if it is right then it will give the party member the lightsaber you defined earlier and then equip it in the left hand. If it's not right then god knows what it will do ;)

CreateItemOnObject("oSaber", oNPC, 1);
ActionEquipItem(oSaber, 5, 1);
You may not need/want this next part but what it does is shows the party selection screen. If you don't require it just omit this line from the script.

DelayCommand(1.0, ShowPartySelectionGUI("", 0xFFFFFFFF, 0xFFFFFFFF));

Put all that together and this is your full script.


void main() {

object oNPC = GetObjectByTag("NPC_TAG", 0);
object oSaber = GetObjectByTag("LIGHTSABER_TAG", 0);
AddMultiClass(3, oNPC);
AdjustAlignment(oNPC, ALIGNMENT_LIGHT_SIDE, 20);
CreateItemOnObject("oSaber", oNPC, 1);
ActionEquipItem(oSaber, 5, 1);
DelayCommand(1.0, ShowPartySelectionGUI("", 0xFFFFFFFF, 0xFFFFFFFF));
}



As for the conditional script, there are numerous ways of checking the current state of the game and the one that springs to mind is journal entries.

You'll have to look through the journal file to see the entries and their states, when you find the one close to where you want to fire the script, just change the entry name and the state number

int StartingConditional() {
return (GetJournalEntry("ENTRY_NAME") == 80);
}
 Gorgod
02-13-2011, 12:00 AM
#3
I abandoned this mod a while ago, but I'm starting it back up again. I've got most of it down, but is there a script that levels the party member up?

Thanks for the info Stream. It really helped me out- even though you probably won't acknowledge this post in any way. :P
 TimBob12
02-13-2011, 3:55 AM
#4
If you are still wondering about conditiomals, my tutorial should help. Its the top one in the sxripts section.
 Gorgod
02-13-2011, 9:40 AM
#5
If you are still wondering about conditiomals, my tutorial should help. Its the top one in the sxripts section.

I think I understand conditionals, it's just that one thing with leveling that's holding me back. I'm sure it's a basic script (hopefully), but I have absolutely no clue what it is.
 Stream
02-16-2011, 4:11 PM
#6
I don't think there's a script that will level a party member up but I think there's something that will show the level up screen.

I'll take a look and let you know.
 Gorgod
02-16-2011, 9:53 PM
#7
I only need one script- one where it checks what class the character is at that point. Any help with this would be appreciated.
 DarthStoney
02-16-2011, 10:37 PM
#8
I sent you a PM but in case it didn't go through a script along this lines may work for your purpose.
void main() {
object oCarth = GetObjectByTag("Carth", 0);
int int1 = GetLevelByClass(CLASS_TYPE_SOLDIER, oCarth);
if ((int1 == 0)) {
AddMultiClass(CLASS_TYPE_JEDIGUARDIAN,oCarth);
GiveXPToCreature(oCarth,1100);
}
if ((int1 == 1)) {
AddMultiClass(CLASS_TYPE_JEDIGUARDIAN,oCarth);
GiveXPToCreature(oCarth,1100);
}
if ((int1 == 2)) {
AddMultiClass(CLASS_TYPE_JEDIGUARDIAN,oCarth);
GiveXPToCreature(oCarth,2100);
}
if ((int1 == 3)) {
AddMultiClass(CLASS_TYPE_JEDIGUARDIAN,oCarth);
GiveXPToCreature(oCarth,3100);
}
if ((int1 == 4)) {
AddMultiClass(CLASS_TYPE_JEDIGUARDIAN,oCarth);
GiveXPToCreature(oCarth,5100);

}
}
 Gorgod
02-19-2011, 9:28 AM
#9
I sent you a PM but in case it didn't go through a script along this lines may work for your purpose.
void main() {
object oCarth = GetObjectByTag("Carth", 0);
int int1 = GetLevelByClass(CLASS_TYPE_SOLDIER, oCarth);
if ((int1 == 0)) {
AddMultiClass(CLASS_TYPE_JEDIGUARDIAN,oCarth);
GiveXPToCreature(oCarth,1100);
}
if ((int1 == 1)) {
AddMultiClass(CLASS_TYPE_JEDIGUARDIAN,oCarth);
GiveXPToCreature(oCarth,1100);
}
if ((int1 == 2)) {
AddMultiClass(CLASS_TYPE_JEDIGUARDIAN,oCarth);
GiveXPToCreature(oCarth,2100);
}
if ((int1 == 3)) {
AddMultiClass(CLASS_TYPE_JEDIGUARDIAN,oCarth);
GiveXPToCreature(oCarth,3100);
}
if ((int1 == 4)) {
AddMultiClass(CLASS_TYPE_JEDIGUARDIAN,oCarth);
GiveXPToCreature(oCarth,5100);

}
}

Yeah, I got it. Sadly, that didn't work for me. It gives the experience depending on the PC's class.

Although, I'm almost done with the first light side dialogue string- I have all the journal entries too. All I need is a script that checks Mission's class, although it might not work because of the XP problem.
 Qui-Gon Glenn
02-19-2011, 3:24 PM
#10
The default for GetLevelByClass is OBJECT_SELF, which should have been fixed by Stoney's defining oCarth by his tag "Carth".

Perhaps you can attach the script to a dialog where Carth or Mission or whoever is the OWNER of the conversation. This way, you can use OBJECT_SELF rather than the tag variant in his script.

Just an idea, it is surprising that this didn't work properly.
Page: 1 of 1