Fallen Guardian Posted June 15, 2012 Share Posted June 15, 2012 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. Link to comment Share on other sites More sharing options...
Fallen Guardian Posted September 19, 2012 Author Share Posted September 19, 2012 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. Link to comment Share on other sites More sharing options...
Darth DeadMan Posted September 20, 2012 Share Posted September 20, 2012 I could be wrong, but during my experiments with soundsets and I've came to conclusion that this stuff is hardcoded in the engine. Link to comment Share on other sites More sharing options...
JCarter426 Posted September 20, 2012 Share Posted September 20, 2012 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. Link to comment Share on other sites More sharing options...
Fallen Guardian Posted September 20, 2012 Author Share Posted September 20, 2012 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? Link to comment Share on other sites More sharing options...
JCarter426 Posted September 20, 2012 Share Posted September 20, 2012 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... Link to comment Share on other sites More sharing options...
Fallen Guardian Posted September 20, 2012 Author Share Posted September 20, 2012 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.) Â 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? Link to comment Share on other sites More sharing options...
JCarter426 Posted September 20, 2012 Share Posted September 20, 2012 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... 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: 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... 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: if(nResult == 5 || nResult == 6) But again, I'm not sure if those are the right ones, as I haven't tested them all. Link to comment Share on other sites More sharing options...
Fallen Guardian Posted September 20, 2012 Author Share Posted September 20, 2012 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. Â 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. Link to comment Share on other sites More sharing options...
JCarter426 Posted September 20, 2012 Share Posted September 20, 2012 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: if( GetTag(oDisarmer) == "carth" ) and such. 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). Link to comment Share on other sites More sharing options...
Fallen Guardian Posted September 20, 2012 Author Share Posted September 20, 2012 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: Â 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. Link to comment Share on other sites More sharing options...
JCarter426 Posted September 20, 2012 Share Posted September 20, 2012 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. Link to comment Share on other sites More sharing options...
Fallen Guardian Posted September 21, 2012 Author Share Posted September 21, 2012 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:  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. Link to comment Share on other sites More sharing options...
JCarter426 Posted September 21, 2012 Share Posted September 21, 2012 The scripting language is really picky about numbers. I suggest doing something like: int iWounded = ( GetCurrentHitPoints(oTarget) * 2 ) / 10; and then just check if the current health is less than that. 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. Link to comment Share on other sites More sharing options...
Fallen Guardian Posted September 21, 2012 Author Share Posted September 21, 2012 The scripting language is really picky about numbers. I suggest doing something like: int iWounded = ( GetCurrentHitPoints(oTarget) * 2 ) / 10; and then just check if the current health is less than that. Â Okay, thanks. Â 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? Link to comment Share on other sites More sharing options...
JCarter426 Posted September 21, 2012 Share Posted September 21, 2012 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. 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. Link to comment Share on other sites More sharing options...
Fallen Guardian Posted September 22, 2012 Author Share Posted September 22, 2012 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. Link to comment Share on other sites More sharing options...
JCarter426 Posted September 22, 2012 Share Posted September 22, 2012 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?  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. Link to comment Share on other sites More sharing options...
Fallen Guardian Posted September 22, 2012 Author Share Posted September 22, 2012 Well, that's... good? Â Yep, that's good. Â Â 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. Link to comment Share on other sites More sharing options...
Fallen Guardian Posted September 22, 2012 Author Share Posted September 22, 2012 Okay, so I've gotten the solo mode stuff worked out in the heartbeat script. Â #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? Link to comment Share on other sites More sharing options...
Fair Strides 2 Posted September 22, 2012 Share Posted September 22, 2012 Okay, so I've gotten the solo mode stuff worked out in the heartbeat script. Â Show spoiler (hidden content - requires Javascript to show) #include "k_inc_debug" #include "k_inc_switch" void main() { ..... if ( GetTag(OBJECT_SELF) == "Zaalbar" ) { PlaySound("p_zaalbar_sprty"); SetLocalBoolean(OBJECT_SELF, 52, TRUE); ..... 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? Â 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 (hidden content - requires Javascript to show) object oLast = (set the last character by tag, like you had above with "GetTag(OBJECT_SELF)" only setting it.); object oCurrent = GetTag(OBJECT_SELF); If( oLast doesn't equal(!=, right?) oCurrent) { SetLocalBoolean(the info above here, only FALSE); } else { } 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. Link to comment Share on other sites More sharing options...
JCarter426 Posted September 22, 2012 Share Posted September 22, 2012 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. Link to comment Share on other sites More sharing options...
Fair Strides 2 Posted September 23, 2012 Share Posted September 23, 2012 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. Link to comment Share on other sites More sharing options...
Fallen Guardian Posted September 23, 2012 Author Share Posted September 23, 2012 Okay, I thought it through. Â I added this to the top of the script (the part where I defined the objects): Â 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: Â 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: Â 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? Link to comment Share on other sites More sharing options...
JCarter426 Posted September 23, 2012 Share Posted September 23, 2012 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.