lfnetwork.com mark read register faq members calendar

Thread: Soundsets
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 06-15-2012, 07:36 PM   #1
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,287
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
Soundsets

I was just wondering, what script controls when an NPC will say something with their soundset? Because there seem to be a lot of things that never occur. For example, in the game files there are voiced instanced for recovering mines, disarming mines, getting to very low health, and having something be immune to your attack. However, these voiced instances are never played in-game so I was wondering if it is an error, or BioWare just never made it so they would.


The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version
Fallen Guardian is offline   you may: quote & reply,
Old 09-19-2012, 04:16 PM   #2
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,287
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
Sorry about the bump but I was working with soundsets again today and I have the same question. Thought'd be better to bump it then start a new thread, especially since the last post was the fifteenth of June.


The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version
Fallen Guardian is offline   you may: quote & reply,
Old 09-19-2012, 11:49 PM   #3
Darth DeadMan
Rookie
 
Darth DeadMan's Avatar
 
Join Date: Sep 2005
Location: Russia
Posts: 120
Current Game: StarCraft II
I could be wrong, but during my experiments with soundsets and I've came to conclusion that this stuff is hardcoded in the engine.


Stay metal, live forever, never die!

My mods @ DeadlyStream
Darth DeadMan is offline   you may: quote & reply,
Old 09-20-2012, 12:07 PM   #4
JCarter426
Senior Member
 
JCarter426's Avatar
 
Join Date: Feb 2008
Location: Look to your left.
Posts: 1,636
That was my thought as well. Theoretically you could restore the missing ones with heartbeat scripts and such, but I doubt you could do anything to change the originals short of swapping out the audio files.


JCarter426 is offline   you may: quote & reply,
Old 09-20-2012, 03:41 PM   #5
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,287
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
Quote:
Originally Posted by JCarter426 View Post
That was my thought as well. Theoretically you could restore the missing ones with heartbeat scripts and such, but I doubt you could do anything to change the originals short of swapping out the audio files.
How would one go about the heartbeat script method?


The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version
Fallen Guardian is offline   you may: quote & reply,
Old 09-20-2012, 04:04 PM   #6
JCarter426
Senior Member
 
JCarter426's Avatar
 
Join Date: Feb 2008
Location: Look to your left.
Posts: 1,636
Well I'm not sure about the specifics off the top of my head, but I'm sure you could, for example, check if the enemy they just attacked is immune to the damage type of their weapon and then script them to say the line manually. I'm not sure how being in combat would affect it, you might need a bark string or PlaySound().

Keep in mind it's possible they didn't implement them because they never figured out how to make it work...


JCarter426 is offline   you may: quote & reply,
Old 09-20-2012, 05:48 PM   #7
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,287
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
Would something like this, when put into the onEndRound field, work for calling a failed attack? (By the way, I keep getting a syntax error at the || symbol... no idea what's causing this.)

Code:
void main()
{

   int nResult = GetLastAttackResult(OBJECT_SELF);

   object oAtackee = GetAttackTarget(OBJECT_SELF);

   

    ExecuteScript("k_ai_master", OBJECT_SELF, KOTOR_DEFAULT_EVENT_ON_COMBAT_ROUND_END);

      if( !GetLocalBoolean(OBJECT_SELF, 50))
      {

         if( GetLastAttacker(oAtackee) == OBJECT_SELF)
         {

            if(nResult == 5) || nResult == 6))
            {

               PlaySound("p_carth_tia");

               SetLocalBoolean(OBJECT_SELF, 50, TRUE); 

               DelayCommand(20.0, SetLocalBoolean(OBJECT_SELF, 50, FALSE)); 

            }
          }
       }
}
Also, is there a way to make a sound from a soundset be called, that way I wouldn't have to make unique scripts for each character?


The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version
Fallen Guardian is offline   you may: quote & reply,
Old 09-20-2012, 06:22 PM   #8
JCarter426
Senior Member
 
JCarter426's Avatar
 
Join Date: Feb 2008
Location: Look to your left.
Posts: 1,636
I dunno. Might be able to put it all in one script with some clever coding. I'll have to think about. Probably need a chart for each party member - if you have Carth, set it string A to "carth" - and then another for the soundset - if it's immune, set it to "tia" - and then at the end play "p_" + string A + "_" + string B. That's how I got my cloning function to work. I can copy that so you get an idea...
Code:
if(	 oTarget == GetFirstPC() &&
			 ObjectToNPC(GetFirstPC()) == -1 ){
			 sTemp = "jc_" + JediClassToLetter(GetClass(oTarget)) + "exile" + GenderToString(oTarget) + LevelToString(oTarget);
			 }
Well that's only part of it, because I did it quite a few times. Then you just do PlaySound(sTemp). I have this subroutine to get the tag of an NPC by their NPC integer:
Code:
string NPCToTag(int iNPC) {

	if( iNPC == 0 ) return "atton";
	else if( iNPC == 1 ) return "baodur";
	else if( iNPC == 2 ) return "mand";
	else if( iNPC == 3 ) return "G0T0";
	else if( iNPC == 4 ) return "handmaiden";
	else if( iNPC == 5 ) return "HK47";
	else if( iNPC == 6 ) return "kreia";
	else if( iNPC == 7 ) return "mira";
	else if( iNPC == 8 ) return "T3M4";
	else if( iNPC == 9 ) return "visasmarr";
	else if( iNPC == 10 ) return "hanharr";
	else if( iNPC == 11 ) return "disciple";
	else return "";

}
What you would need to do is use GetTag() and return the string that's in the file name (I'm pretty sure it's not the same in each one, but if it is then you don't need a subroutine for it).

Looks like a good start, but I'm not sure entirely sure how the attack results work. Having it play only once wouldn't work either, because it wouldn't change until you exit the module (if even then, I forget how it works with party members). But you also don't want it playing every round... hmm...
Quote:
By the way, I keep getting a syntax error at the || symbol... no idea what's causing this
You've got too many end parenthesis. Here:
Quote:
if(nResult == 5 || nResult == 6)
But again, I'm not sure if those are the right ones, as I haven't tested them all.



Last edited by JCarter426; 09-20-2012 at 06:34 PM.
JCarter426 is offline   you may: quote & reply,
Old 09-20-2012, 06:49 PM   #9
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,287
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
Alright, cool, thanks JC. I'll look into it.

As for the issue with it playing every round, that's why I set the LocalBoolean conditional. Only twenty seconds after the line has been said, can it be said again. Anyway, here's something for the recovering/disabling mine line.

Code:
void main()
{

     object oPC = GetFirstPC();

     int iGender = GetGender(oPC);

     object oCarth = GetObjectByTag("Carth");

     object oCand = GetObjectByTag("Cand");

     object oBast = GetObjectByTag("Bastila");

     object oHK = GetObjectByTag("HK47");

     object oJolee = GetObjectByTag("Jolee");

     object oJuhani = GetObjectByTag("Juhani");

     object oT3 = GetObjectByTag("T3M4");

     object oMission = GetObjectByTag("Mission");

     object oZaalbar = GetObjectByTag("Zaalbar");

     object oDisarmer = GetLastDisarmed();

     int nRoll = d8();

        if ( oPC == oDisarmer)
        {

            if ( iGender == GENDER_MALE)
            {

               if(nRoll == 1 || nRoll == 2 || nRoll == 3)
               {
                   PlaySound("p_playermw_dmin1");
               }
  
               if(nRoll == 4 || nRoll == 5 || nRoll == 6)
               {
                   PlaySound("p_playermw_dmin2");
               }

               if(nRoll == 7 || nRoll == 8)
               {
                   PlaySound("p_playermw_dmin3");
               }
             
            }

            if ( iGender == GENDER_FEMALE)
            {

               if(nRoll == 1 || nRoll == 2 || nRoll == 3)
               {
                   PlaySound("p_playerfw_dmin1");
               }
  
               if(nRoll == 4 || nRoll == 5 || nRoll == 6)
               {
                   PlaySound("p_playerfw_dmin3");   
               }

               if(nRoll == 7 || nRoll == 8)
               {
                   PlaySound("p_playerfw_dmin2");
               }
             
            }

        }

        if ( oCarth == oDisarmer)
        {
             PlaySound("p_carth_dmin");
        }

        if ( oCand == oDisarmer)
        {
             PlaySound("p_cand_dmin");
        }

        if ( oBast == oDisarmer)
        {
             PlaySound("p_bastila_dmin");
        }

        if ( oHK == oDisarmer)
        {
             PlaySound("p_hk-47_dmin");
        }

        if ( oJolee == oDisarmer)
        {
             PlaySound("p_jolee_dmin");
        }

        if ( oJuhani == oDisarmer)
        {
             PlaySound("p_juhani_dmin");
        }

        if ( oT3 == oDisarmer)
        {
             PlaySound("p_t3-m4_dmin");
        }

        if ( oMission == oDisarmer)
        {
             PlaySound("p_mission_dmin");
        }

        if ( oZaalbar == oDisarmer)
        {
             PlaySound("p_zaalbar_dmin");
        }

}
I added in the random stuff for the PC because he/she has three different versions of the disable mine line. Due to the eight sided die I had to make one line have an unequal chance, so I chose the one I thought sounded the worst/most awkward. Also, unfortunately for this script it'll have to be worked into the onDisarmed field of every g_t_trap***.utt trigger. But seeing as not many mods (if any) edit the generic trap triggers so I don't see compatibility as an issue.


The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version
Fallen Guardian is offline   you may: quote & reply,
Old 09-20-2012, 07:11 PM   #10
JCarter426
Senior Member
 
JCarter426's Avatar
 
Join Date: Feb 2008
Location: Look to your left.
Posts: 1,636
Quote:
Originally Posted by Fallen Guardian View Post
Only twenty seconds after the line has been said, can it be said again.
Ah ok, I see that now. That should work... maybe. I hope.

I wouldn't define all the objects ahead of time, though. If by chance there's more than one object with that tag in the module, the game could get confused. I suggest using GetTag() instead. Shouldn't be too hard, just change it to:
Code:
 if( GetTag(oDisarmer) == "carth" )
and such.
Quote:
I added in the random stuff for the PC because he/she has three different versions of the disable mine line. Due to the eight sided die I had to make one line have an unequal chance, so I chose the one I thought sounded the worst/most awkward.
You can choose your own dice with Random(). Just keep in mind that the result is one less than you'd get on a die (e.g. Random(2) will give you either 0 or 1).


JCarter426 is offline   you may: quote & reply,
Old 09-20-2012, 07:33 PM   #11
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,287
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
Okay, I'll use GetTag instead. Interesting stuff about the Random function, I'll look into it. I've now adjusted the onEndRound script to include a check for the cut low health soundset option, here it is:

Code:
void main()
{

   int nResult = GetLastAttackResult(OBJECT_SELF);

   int nCurHealth = GetCurrentHitPoints(OBJECT_SELF);

   int nMaxHealth = GetMaxHitPoints(OBJECT_SELF);

   object oAtackee = GetAttackTarget(OBJECT_SELF);

   

    ExecuteScript("k_ai_master", OBJECT_SELF, KOTOR_HENCH_EVENT_ON_COMBAT_ROUND_END);

      if( !GetLocalBoolean(OBJECT_SELF, 50))
      {

         if( GetLastAttacker(oAtackee) == OBJECT_SELF)
         {

            if(nResult == 5 || nResult == 6)
            {

               PlaySound("p_carth_tia");

               SetLocalBoolean(OBJECT_SELF, 50, TRUE); 

               DelayCommand(20.0, SetLocalBoolean(OBJECT_SELF, 50, FALSE)); 

            }
          }
       }

       if( nCurHealth <= nMaxHealth/7)
       {

          PlaySound("p_carth_low");

       }
}
I wasn't too sure what the best course for finding a decently low health would be, so I just divided the person's maximum health by seven. Also, how would I make this stuff apply to the PC? The traps were easy because they were played by the trap files, but I have no idea how to get the PC to say these.


The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version
Fallen Guardian is offline   you may: quote & reply,
Old 09-20-2012, 07:59 PM   #12
JCarter426
Senior Member
 
JCarter426's Avatar
 
Join Date: Feb 2008
Location: Look to your left.
Posts: 1,636
The wounded animations begin when the character's vitality is below 20%, I'd say copy that.

Party members should be easy enough, but I have no idea how to do it for the player. I don't think anyone's cracked how their scripts work. Maybe you could do it through the party members' scripts.


JCarter426 is offline   you may: quote & reply,
Old 09-20-2012, 08:29 PM   #13
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,287
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
Quote:
Originally Posted by JCarter426 View Post
The wounded animations begin when the character's vitality is below 20%, I'd say copy that.

Party members should be easy enough, but I have no idea how to do it for the player. I don't think anyone's cracked how their scripts work. Maybe you could do it through the party members' scripts.
Huh, okay. I tried multiplying the max health value by 0.2 by using this:

Code:
if( nCurHealth <= nMaxHealth*0.2)
But then I get an error saying (>=) is invalid, or something like that.

Just checked what scripts the PC's use by loading up a game and then looking at the UTC's in the gameinprogress folder that pops up in the main directory. Apparently the PC uses the same henchmen script set as the regular party members, but also also has a few k_def's thrown in there.


The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version

Last edited by Fallen Guardian; 09-20-2012 at 08:39 PM.
Fallen Guardian is offline   you may: quote & reply,
Old 09-20-2012, 08:34 PM   #14
JCarter426
Senior Member
 
JCarter426's Avatar
 
Join Date: Feb 2008
Location: Look to your left.
Posts: 1,636
The scripting language is really picky about numbers. I suggest doing something like:
Code:
int iWounded = ( GetCurrentHitPoints(oTarget) * 2 ) / 10;
and then just check if the current health is less than that.
Quote:
Just checked what scripts the PC use by loading up a game and then looking at the UTC's in the gameinprogress folder that pops up in the main directory. Apparently the PC uses the same henchmen script set as the regular party members, but also also has a few k_def's thrown in there.
Hmm. Didn't think to check there, well done.


JCarter426 is offline   you may: quote & reply,
Old 09-20-2012, 08:40 PM   #15
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,287
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
Quote:
Originally Posted by JCarter426 View Post
The scripting language is really picky about numbers. I suggest doing something like:
Code:
int iWounded = ( GetCurrentHitPoints(oTarget) * 2 ) / 10;
and then just check if the current health is less than that.
Okay, thanks.

Quote:
Originally Posted by JCarter426 View Post
Hmm. Didn't think to check there, well done.
So theoretically one could just edit the k_ai_master script to add in all the stuff to check for the PC soundset additions?

Just tested out the script that plays when you get low health, the sound plays at the right point, but it plays even after the person saying it has already done their death sound, and the voice is much too quiet. Would barking the string make it so the sound was played louder?


The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version

Last edited by Fallen Guardian; 09-20-2012 at 08:49 PM.
Fallen Guardian is offline   you may: quote & reply,
Old 09-20-2012, 08:52 PM   #16
JCarter426
Senior Member
 
JCarter426's Avatar
 
Join Date: Feb 2008
Location: Look to your left.
Posts: 1,636
Quote:
Originally Posted by Fallen Guardian View Post
So theoretically one could just edit the k_ai_master script to add in all the stuff to check for the PC soundset additions?
I suppose. That would be a lot better than modifying each script separately, too.
Quote:
Just tested out the script that plays when you get low health, the sound plays at the right point, but it plays even after the person saying it has already done their death sound, and the voice is much too quiet. Would barking the string make it so the sound was played louder?
I'm not sure. I have noticed that the audio quality of soundsets in the game is horrible, even though the files are file. It might be the same for PlaySound(). Worth a try, I say.


JCarter426 is offline   you may: quote & reply,
Old 09-22-2012, 10:00 AM   #17
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,287
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
Bark sound wasn't as favorable as I thought it'd be.. Good thing the only reason PlaySound made the sound quiet was because I'd accidentally had my SFX volume way low.

I've pondered a way to restore the "Search" soundset file and the "Separate party" one. I'm assuming they would go with when you open containers/corpses and go into solo mode. However, aside from the heartbeat script (which I'd like to make my last resort), I haven't found anything that would be practical as of yet.

I'll take a look at the events in k_ai_master and see if there isn't an event I could piggyback on.


The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version
Fallen Guardian is offline   you may: quote & reply,
Old 09-22-2012, 02:45 PM   #18
JCarter426
Senior Member
 
JCarter426's Avatar
 
Join Date: Feb 2008
Location: Look to your left.
Posts: 1,636
Quote:
Originally Posted by Fallen Guardian View Post
Bark sound wasn't as favorable as I thought it'd be.. Good thing the only reason PlaySound made the sound quiet was because I'd accidentally had my SFX volume way low.
Well, that's... good?

Quote:
I've pondered a way to restore the "Search" soundset file and the "Separate party" one. I'm assuming they would go with when you open containers/corpses and go into solo mode. However, aside from the heartbeat script (which I'd like to make my last resort), I haven't found anything that would be practical as of yet.

I'll take a look at the events in k_ai_master and see if there isn't an event I could piggyback on.
If you don't find anything there, could still do it in a heartbeat script. Check if the game is in solo mode and if the player is currently controlling that character, and if yes to both then fire the sound... and set a local boolean like you did before so it only does it once until we return to group mode.


JCarter426 is offline   you may: quote & reply,
Old 09-22-2012, 03:08 PM   #19
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,287
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
Quote:
Originally Posted by JCarter426 View Post
Well, that's... good?
Yep, that's good.


Quote:
Originally Posted by JCarter426 View Post
If you don't find anything there, could still do it in a heartbeat script. Check if the game is in solo mode and if the player is currently controlling that character, and if yes to both then fire the sound... and set a local boolean like you did before so it only does it once until we return to group mode.
Didn't find anything.. I did find some weird henchmen events but that's besides the point. The main reason I wanted to avoid heartbeat was due to the sound maybe being played a couple seconds after you'd already entered solo mode, or something like that. But there doesn't appear to be anything else, and this should work so, oh well.


The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version
Fallen Guardian is offline   you may: quote & reply,
Old 09-22-2012, 03:48 PM   #20
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,287
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
Okay, so I've gotten the solo mode stuff worked out in the heartbeat script.

Code:
#include "k_inc_debug"
#include "k_inc_switch"

void main()
{

     object oPC = GetFirstPC();

     int iGender = GetGender(oPC);

     int nRoll = d8();

    ExecuteScript("k_ai_master", OBJECT_SELF, KOTOR_HENCH_EVENT_ON_HEARTBEAT);

    if( GetSoloMode() == TRUE)
    {
       if(GetPartyMemberByIndex(0) == OBJECT_SELF)
       {

         if( !GetLocalBoolean(OBJECT_SELF, 52)) 
         {

           if ( oPC == OBJECT_SELF)
           {

             if ( iGender == GENDER_MALE)
             {
          
               if(nRoll == 1 || nRoll == 2 || nRoll == 3)
               {
                   PlaySound("p_playermw_sprty3");

                   SetLocalBoolean(OBJECT_SELF, 52, TRUE); 
               }
  
               if(nRoll == 4 || nRoll == 5 || nRoll == 6)
               {
                   PlaySound("p_playermw_sprty2");

                   SetLocalBoolean(OBJECT_SELF, 52, TRUE); 
               }

               if(nRoll == 7 || nRoll == 8)
               {
                   PlaySound("p_playermw_sprty1");

                   SetLocalBoolean(OBJECT_SELF, 52, TRUE); 
               }
             
             }

             if ( iGender == GENDER_FEMALE)
             {

               if(nRoll == 1 || nRoll == 2 || nRoll == 3)
               {
                   PlaySound("p_playerfw_sprty1");

                   SetLocalBoolean(OBJECT_SELF, 52, TRUE); 
               }
  
               if(nRoll == 4 || nRoll == 5 || nRoll == 6)
               {
                   PlaySound("p_playerfw_sprty2");   

                   SetLocalBoolean(OBJECT_SELF, 52, TRUE); 
               }

               if(nRoll == 7 || nRoll == 8)
               {
                   PlaySound("p_playerfw_sprty3");

                   SetLocalBoolean(OBJECT_SELF, 52, TRUE); 
               }
             
             }

        }

        if ( GetTag(OBJECT_SELF) == "Carth" )
        {
             PlaySound("p_carth_sprty");

             SetLocalBoolean(OBJECT_SELF, 52, TRUE); 
        }

        if ( GetTag(OBJECT_SELF) == "Cand" )
        {
             PlaySound("p_cand_sprty");

             SetLocalBoolean(OBJECT_SELF, 52, TRUE); 
        }

        if ( GetTag(OBJECT_SELF) == "Bastila" )
        {
             PlaySound("p_bastila_sprty");

             SetLocalBoolean(OBJECT_SELF, 52, TRUE); 
        }

        if ( GetTag(OBJECT_SELF) == "HK47" )
        {
             PlaySound("p_hk-47_sprty");

             SetLocalBoolean(OBJECT_SELF, 52, TRUE); 
        }

        if ( GetTag(OBJECT_SELF) == "Jolee" )
        {
             PlaySound("p_jolee_sprty");

             SetLocalBoolean(OBJECT_SELF, 52, TRUE); 
        }

        if ( GetTag(OBJECT_SELF) == "Juhani" )
        {
             PlaySound("p_juhani_sprty");

             SetLocalBoolean(OBJECT_SELF, 52, TRUE); 
        }

        if ( GetTag(OBJECT_SELF) == "T3M4" )
        {
             PlaySound("p_t3-m4_sprty");

             SetLocalBoolean(OBJECT_SELF, 52, TRUE); 
        }

        if ( GetTag(OBJECT_SELF) == "Mission" )
        {
             PlaySound("p_mission_sprty");

             SetLocalBoolean(OBJECT_SELF, 52, TRUE); 
        }

        if ( GetTag(OBJECT_SELF) == "Zaalbar" )
        {
             PlaySound("p_zaalbar_sprty");

             SetLocalBoolean(OBJECT_SELF, 52, TRUE); 
        }

      }
    }
  }


    if( GetSoloMode() == FALSE)
    {
       if(GetPartyMemberByIndex(0) == OBJECT_SELF)
       {

         if( GetLocalBoolean(OBJECT_SELF, 52)) 
         {

           if ( oPC == OBJECT_SELF)
           {

             if ( iGender == GENDER_MALE)
             {
          
               if(nRoll == 1 || nRoll == 2 || nRoll == 3)
               {
                   PlaySound("p_playermw_rprty3");

                   SetLocalBoolean(OBJECT_SELF, 52, FALSE); 
               }
  
               if(nRoll == 4 || nRoll == 5 || nRoll == 6)
               {
                   PlaySound("p_playermw_rprty2");

                   SetLocalBoolean(OBJECT_SELF, 52, FALSE); 
               }

               if(nRoll == 7 || nRoll == 8)
               {
                   PlaySound("p_playermw_rprty1");

                   SetLocalBoolean(OBJECT_SELF, 52, FALSE); 
               }
             
             }

             if ( iGender == GENDER_FEMALE)
             {

               if(nRoll == 1 || nRoll == 2 || nRoll == 3)
               {
                   PlaySound("p_playerfw_rprty1");

                   SetLocalBoolean(OBJECT_SELF, 52, FALSE); 
               }
  
               if(nRoll == 4 || nRoll == 5 || nRoll == 6)
               {
                   PlaySound("p_playerfw_rprty2");   

                   SetLocalBoolean(OBJECT_SELF, 52, FALSE); 
               }

               if(nRoll == 7 || nRoll == 8)
               {
                   PlaySound("p_playerfw_rprty3");

                   SetLocalBoolean(OBJECT_SELF, 52, FALSE); 
               }
             
             }

           }


        if ( GetTag(OBJECT_SELF) == "Carth" )
        {
             PlaySound("p_carth_rprty");

             SetLocalBoolean(OBJECT_SELF, 52, FALSE); 
        }

        if ( GetTag(OBJECT_SELF) == "Cand" )
        {
             PlaySound("p_cand_rprty");

             SetLocalBoolean(OBJECT_SELF, 52, FALSE); 
        }

        if ( GetTag(OBJECT_SELF) == "Bastila" )
        {
             PlaySound("p_bastila_rprty");

             SetLocalBoolean(OBJECT_SELF, 52, FALSE); 
        }

        if ( GetTag(OBJECT_SELF) == "HK47" )
        {
             PlaySound("p_hk-47_rprty");

             SetLocalBoolean(OBJECT_SELF, 52, FALSE); 
        }

        if ( GetTag(OBJECT_SELF) == "Jolee" )
        {
             PlaySound("p_jolee_rprty");

             SetLocalBoolean(OBJECT_SELF, 52, FALSE); 
        }

        if ( GetTag(OBJECT_SELF) == "Juhani" )
        {
             PlaySound("p_juhani_rprty");

             SetLocalBoolean(OBJECT_SELF, 52, FALSE); 
        }

        if ( GetTag(OBJECT_SELF) == "T3M4" )
        {
             PlaySound("p_t3-m4_rprty");

             SetLocalBoolean(OBJECT_SELF, 52, FALSE); 
        }

        if ( GetTag(OBJECT_SELF) == "Mission" )
        {
             PlaySound("p_mission_rprty");

             SetLocalBoolean(OBJECT_SELF, 52, FALSE); 
        }

        if ( GetTag(OBJECT_SELF) == "Zaalbar" )
        {
             PlaySound("p_zaalbar_rprty");

             SetLocalBoolean(OBJECT_SELF, 52, FALSE); 
        }

      }
    }
  }
}
Now my only concern with the coding as of now, is that someone could switch characters while in solo mode and the sounds/local booleans would get messed up. Meaning, someone goes into solo mode as Bastila. Her local boolean gets set and her sound plays. Then the player switches to Carth and exits solo mode. Now Carth wouldn't play any sound due to the way it's set up now. His boolean check was never set because he wasn't the one who initiated solo mode. Also, Bastila would still have her boolean set as true so she wouldn't say anything the next time the player entered solo mode with her. The boolean would have to be "fixed" by the player entering solo mode with Bastila and then exiting it with her. Can anyone think of another check I could have so this is avoided?


The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version
Fallen Guardian is offline   you may: quote & reply,
Old 09-22-2012, 07:40 PM   #21
Fair Strides 2
Witty Programmer
 
Fair Strides 2's Avatar
 
Join Date: Jan 2012
Location: Oregon, United States
Posts: 595
Current Game: Master of Orion 2
Helpful! 
Quote:
Originally Posted by Fallen Guardian View Post
Okay, so I've gotten the solo mode stuff worked out in the heartbeat script.

Show spoiler


Now my only concern with the coding as of now, is that someone could switch characters while in solo mode and the sounds/local booleans would get messed up. Meaning, someone goes into solo mode as Bastila. Her local boolean gets set and her sound plays. Then the player switches to Carth and exits solo mode. Now Carth wouldn't play any sound due to the way it's set up now. His boolean check was never set because he wasn't the one who initiated solo mode. Also, Bastila would still have her boolean set as true so she wouldn't say anything the next time the player entered solo mode with her. The boolean would have to be "fixed" by the player entering solo mode with Bastila and then exiting it with her. Can anyone think of another check I could have so this is avoided?
It seems to me that you could just make a boolean for each character and the PC, and check them with that. And/or you might examine the script that switches the Party Leader back to the PC at end of a dialogue(I forget what it is and I'm not on a computer that has file access right now), and work that into the form of a check(this is an example, not the actual language):
Show spoiler

Something like that on a character switch to revert everything to normal. After the above code, you would set oCurrent's to TRUE so that they'd say there line(after a check to see if it wasn't already said.

Hope that helps, though I might have to re-explain it once I get home and come back tomorrow with the actual files. If I do, then sorry.
Fair Strides 2 is offline   you may: quote & reply,
Old 09-22-2012, 07:43 PM   #22
JCarter426
Senior Member
 
JCarter426's Avatar
 
Join Date: Feb 2008
Location: Look to your left.
Posts: 1,636
Quote:
Originally Posted by Fallen Guardian View Post
Now my only concern with the coding as of now, is that someone could switch characters while in solo mode and the sounds/local booleans would get messed up. Meaning, someone goes into solo mode as Bastila. Her local boolean gets set and her sound plays. Then the player switches to Carth and exits solo mode. Now Carth wouldn't play any sound due to the way it's set up now. His boolean check was never set because he wasn't the one who initiated solo mode. Also, Bastila would still have her boolean set as true so she wouldn't say anything the next time the player entered solo mode with her. The boolean would have to be "fixed" by the player entering solo mode with Bastila and then exiting it with her. Can anyone think of another check I could have so this is avoided?
Hmm. You can't switch party members while you're in solo mode, correct? If so, then I'd say use more locals and set them for everyone in the party. The one who first goes into solo gets different boolean than the other two, and they say the line both times. It might take a bit of work to set it up so the stuff only get triggered once, but I think it should work.

I'd also suggest you hold off on them saying it until they are actually close to another party member.

If you have nightmares about if trees, blame me.


JCarter426 is offline   you may: quote & reply,
Old 09-22-2012, 08:03 PM   #23
Fair Strides 2
Witty Programmer
 
Fair Strides 2's Avatar
 
Join Date: Jan 2012
Location: Oregon, United States
Posts: 595
Current Game: Master of Orion 2
Helpful! 
Quote:
Originally Posted by JCarter426 View Post
Hmm. You can't switch party members while you're in solo mode, correct? If so, then I'd say use more locals and set them for everyone in the party. The one who first goes into solo gets different boolean than the other two, and they say the line both times. It might take a bit of work to set it up so the stuff only get triggered once, but I think it should work.

I'd also suggest you hold off on them saying it until they are actually close to another party member.

If you have nightmares about if trees, blame me.
Tulio, from the cartoon movie El Dorado: "I blame you!"

Check my comment, and I think we might be on the same idea.
Fair Strides 2 is offline   you may: quote & reply,
Old 09-22-2012, 08:50 PM   #24
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,287
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
Okay, I thought it through.

I added this to the top of the script (the part where I defined the objects):

Code:
     object oPL = GetPartyMemberByIndex(0);

     object oPM1 = GetPartyMemberByIndex(1);

     object oPM2 = GetPartyMemberByIndex(2);

     int nParty = GetPartyMemberCount();
I added this to the conditional that checks what sound to play when entering solo mode:

Code:
  if( nParty > 1)
  {
I thought there wouldn't be a point of someone entering solo mode and saying to stay back if no one else is in the party.

And added this after the code in my last post:

Code:
   if( GetSoloMode() == TRUE)
   {

      if( GetLocalBoolean(oPL, 52, FALSE)
      { 
         if( GetLocalBoolean(oPM1, 52, TRUE)
         {
            SetLocalBoolean(oPM1, 52 FALSE)

            SetLocalBoolean(oPL, 52 TRUE)
         }

         if( GetLocalBoolean(oPM2, 52, TRUE)
         {
            SetLocalBoolean(oPM2, 52 FALSE)

            SetLocalBoolean(oPL, 52 TRUE)
         }
      }
   }
I'm thinking, that since this is used through the heartbeat script, it'll check every couple seconds to see if you've switched characters since turning on solo mode. Then, if you have switched characters it'll check to see which party member initiated solo mode. It'll set their boolean to false, and the current party leader's to true, so that when exiting solo mode, whoever the party leader is will say their line for exiting solo mode. However, now my concern is that the game will just disregard this check, seeing as it's beginning conditional is the same as the ones used to determine which sound is played. Would I have to set this up differently or am I thinking incorrectly about how the game reads scripts?


The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version

Last edited by Fallen Guardian; 09-22-2012 at 09:04 PM.
Fallen Guardian is offline   you may: quote & reply,
Old 09-22-2012, 09:41 PM   #25
JCarter426
Senior Member
 
JCarter426's Avatar
 
Join Date: Feb 2008
Location: Look to your left.
Posts: 1,636
So you want the current party leader to always say the line? All right, let me think... if you place that before everything else, I think it should work.


JCarter426 is offline   you may: quote & reply,
Old 10-02-2012, 03:21 PM   #26
Giant Graffiti
Custom User Title
 
Giant Graffiti's Avatar
 
Join Date: May 2008
Posts: 827
Are you sure that the immune to attack clip doesn't play? I could've sworn that I've heard Canderous's "I need a better weapon!" clip play ingame...
Giant Graffiti is offline   you may: quote & reply,
Old 10-02-2012, 04:37 PM   #27
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,287
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
I'm positive. I've never heard Canderous or anyone say that line in game.


The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version
Fallen Guardian is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > Knights of the Old Republic > Editing / Modding > Holowan Laboratories > Soundsets

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:53 AM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.