Ferc Kast Posted January 1, 2008 Share Posted January 1, 2008 I'm trying to make three Jedi scripts work, but it's not working. Here's one of 'em: void main() { int maimpar = GetScriptParameter( 1 ); int subparam = GetScriptParameter( 2 ); int nValue = GetScriptParameter( 3 ); string sTag = GetScriptStringParameter(); if ( maimpar == 1 ) { if ( subparam == 1 ) { AddMultiClass( CLASS_TYPE_JEDICONSULAR, GetObjectByTag("mand")); } if ( subparam == 2 ) { AddMultiClass( CLASS_TYPE_JEDIGUARDIAN, GetObjectByTag("mand")); } if ( subparam == 3 ) { AddMultiClass( CLASS_TYPE_JEDISENTINEL, GetObjectByTag("mand")); } } if ( maimpar == 2 ) { if ( subparam == 1 ) { AddMultiClass( CLASS_TYPE_JEDIMASTER, GetObjectByTag("mand")); } if ( subparam == 2 ) { AddMultiClass( CLASS_TYPE_JEDIWATCHMAN, GetObjectByTag("mand")); } if ( subparam == 3 ) { AddMultiClass( CLASS_TYPE_JEDIWEAPONMASTER, GetObjectByTag("mand")); } } if ( maimpar == 3 ) { if ( subparam == 1 ) { AddMultiClass( CLASS_TYPE_SITHASSASSIN, GetObjectByTag("mand")); } if ( subparam == 2 ) { AddMultiClass( CLASS_TYPE_SITHLORD, GetObjectByTag("mand")); } if ( subparam == 3 ) { AddMultiClass( CLASS_TYPE_SITHMARAUDER, GetObjectByTag("mand")); } } } The other two that I'm having trouble with are Handmaiden and Disciple. My other 6 scripts of this nature for K2 are working, but not these three. Any ideas what I did wrong? Link to comment Share on other sites More sharing options...
matinee suxxx Posted January 1, 2008 Share Posted January 1, 2008 im note good at prgramming or anything alltough i did notcie you dont have any "end if" 's or "esle" 's in the program.. Or am i just thinking of VB? Link to comment Share on other sites More sharing options...
Ferc Kast Posted January 1, 2008 Author Share Posted January 1, 2008 im note good at prgramming or anything alltough i did notcie you dont have any "end if" 's or "esle" 's in the program.. I didn't need them with the other Jedi scripts that I made with this same setup. So, that shouldn't be the problem. EDIT: I wonder if I set the dialog to work correctly with those options. Hmm...I'll go check the dialog and report back. EDIT II: Everything is set correctly in the dialog, yet the three scripts don't function. Link to comment Share on other sites More sharing options...
matinee suxxx Posted January 1, 2008 Share Posted January 1, 2008 I didn't need them with the other Jedi scripts that I made with this same setup. So, that shouldn't be the problem. hmm i really dont know then EDIT: I wonder if I set the dialog to work correctly with those options. Hmm...I'll go check the dialog and report back. are you useing kotor tool? Link to comment Share on other sites More sharing options...
Ferc Kast Posted January 2, 2008 Author Share Posted January 2, 2008 Nope; I'm not using KotOR Tool. I'm using Kristy Kistic's dialog editor; But, that's not the problem either. Link to comment Share on other sites More sharing options...
matinee suxxx Posted January 2, 2008 Share Posted January 2, 2008 Nope; I'm not using KotOR Tool. I'm using Kristy Kistic's dialog editor; But, that's not the problem either. no, i was just curious Link to comment Share on other sites More sharing options...
stoffe Posted January 2, 2008 Share Posted January 2, 2008 I'm trying to make three Jedi scripts work, but it's not working. Here's one of 'em: As far as I can see there's technically nothing wrong with that script, so the problem likely lies in how it's used. Make sure your script is fired at all, and that the party member is present in the area when it is run. * * * That said, your script is a bit needlessly complicated in my opinion. This would accomplish the same thing in a more generic manner and could be used for any NPC. You put the first script parameter on the dialog node to the line number of the class in classes.2da and the String Param to the tag of the NPC to multiclass: void main() { object oNPC = GetObjectByTag(GetScriptStringParameter()); if (GetIsObjectValid(oNPC)) { AddMultiClass(GetScriptParameter(1), oNPC); } } Link to comment Share on other sites More sharing options...
Ferc Kast Posted January 3, 2008 Author Share Posted January 3, 2008 I abandoned the first script and came up with this template. I wanted to know, before I compile the following script, if there appear to be any problems with this script? void main() { int maimpar = GetScriptParameter( 1 ); int subparam = GetScriptParameter( 2 ); int nValue = GetScriptParameter( 3 ); string sTag = GetScriptStringParameter(); AddMultiClass( CLASS_TYPE_JEDIMASTER, oNPC); if ( maimpar == 12 ) { if ( subparam == 0 ) { object oNPC=GetObjectByTag("Atton"); } if ( subparam == 1 ) { object oNPC=GetObjectByTag("BaoDur"); } if ( subparam == 2 ) { object oNPC=GetObjectByTag("Mand"); } if ( subparam == 4 ) { object oNPC=GetObjectByTag("Handmaiden"); } if ( subparam == 6 ) { object oNPC=GetObjectByTag("Kreia"); } if ( subparam == 7 ) { object oNPC=GetObjectByTag("Mira"); } if ( subparam == 9 ) { object oNPC=GetObjectByTag("VisasMarr"); } if ( subparam == 10 ) { object oNPC=GetObjectByTag("Hanharr"); } if ( subparam == 11 ) { object oNPC=GetObjectByTag("Disciple"); } } } Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.