Jump to content

Home

Create Jedi scripts...


Gorgod

Recommended Posts

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.

Link to comment
Share on other sites

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);
}

Link to comment
Share on other sites

  • 2 months later...

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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);

         }
}

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...