souder Posted February 4, 2006 Share Posted February 4, 2006 I want to change the LS/DS bonuses for being totally dark or light to a smooth scale. This way you get partial bonuses for being partially light or dark. that way players can be in the grey area and be cheated out of the bonuses. However i cant seem to find the files that manage this, if someone can help me out, i'd really appreciate it. Thanx Link to comment Share on other sites More sharing options...
deathdisco Posted February 4, 2006 Share Posted February 4, 2006 I believe this is hard-coded and cannot be modified. Sorry. Link to comment Share on other sites More sharing options...
The Source Posted February 4, 2006 Share Posted February 4, 2006 I want to change the LS/DS bonuses for being totally dark or light to a smooth scale. This way you get partial bonuses for being partially light or dark. that way players can be in the grey area and be cheated out of the bonuses. However i cant seem to find the files that manage this, if someone can help me out, i'd really appreciate it. Thanx I think it may be in a .2da file. Ah... Use the KotOR Tool, and look in the .2da files. I will bet you can find something close to this. Link to comment Share on other sites More sharing options...
stoffe Posted February 5, 2006 Share Posted February 5, 2006 As said, Light/Darkside Mastery is handled internally by the Alignment system, which is hardcoded in the game engine. There is no mechanism for changing what bonuses are given, or changing when they appear. The best you could do as a workaround would probably be to have a script checking the GoodEvilValue of the player/party members and apply different effects to them depending on what the value is. But it's a rather clumsy and far from perfect solution. Link to comment Share on other sites More sharing options...
souder Posted February 5, 2006 Author Share Posted February 5, 2006 Thanx, the script thing is prolly my only option if the actual mastery bonus code is hard coded. BTW if someone can tell me how to get a script to trigger when the main character dies, it would help me a lot. I made an arm band with Atton's SPIRIT feat on it and got it working for the NPC's, by adding the attonspirit script to their OnDeath field, but i dont know how to add it to the main character. Link to comment Share on other sites More sharing options...
stoffe Posted February 5, 2006 Share Posted February 5, 2006 BTW if someone can tell me how to get a script to trigger when the main character dies, it would help me a lot. I made an arm band with Atton's SPIRIT feat on it and got it working for the NPC's, by adding the attonspirit script to their OnDeath field, but i dont know how to add it to the main character. As far as I can tell the Player Character does not have an OnDeath AI script assigned to it. There is a module script event, "OnPlayerDeath" (Mod_OnPlrDeath field in a GFF Editor) which should fire when the player dies, though in the case of KotOR I am unsure if it fires when the main character dies or when the entire party goes down. In either case, using it would be highly unpractical since it has to be set in the module.ifo file for every single module in the game independently. The best workaround I can think of would be to modify the combat AI for your other party members to work as a monitor for the main character's health. Thus, if the main character dies, the AI of your party members notice and revive her again. While this would only work when you have other members in the party, that isn't a problem for the "Spirit" feats since they are only supposed to work if there are other party members still standing anyway. A function like this, if called from either the CombatRound-script of the party members, or from GN_DetermineCombatRound(), would probably work: void ST_CheckRevivePlayer() { // Only make party members do this. if (!IsObjectPartyMember(OBJECT_SELF)) return; object oTarget = GetFirstPC(); // Abort if the main character could not be located yet. if(!GetIsObjectValid(oTarget)) return; // The main character shouldn't run this on themselves... if (oTarget == OBJECT_SELF) return; // If I'm dead myself, no point doing this... if ((GetCurrentHitPoints(OBJECT_SELF) < 1) || GetIsDead(OBJECT_SELF)) return; // If the main character isn't dead, no point continuing... if ((GetCurrentHitPoints(oTarget) > 0) && !GetIsDead(oTarget)) return; // Only proceed if the main character has one of the feats... if ( !GetHasFeat(FEAT_SPIRIT, oTarget) && !GetHasFeat(FEAT_FIGHTING_SPIRIT, oTarget) && !GetHasFeat(FEAT_HEROIC_RESOLVE, oTarget)) { return; } // Check to see if any other party member is still alive. int bPartyNotDead = FALSE; int nIdx = 0; object oParty = GetPartyMemberByIndex(nIdx); while (GetIsObjectValid(oParty)) { if ((GetCurrentHitPoints(oParty) > 0) && !GetIsDead(oParty) && GetIsInCombat(oParty, TRUE)) { bPartyNotDead = TRUE; break; } oParty = GetPartyMemberByIndex(++nIdx); } // Someone was alive, attempt to revive the main character. if (bPartyNotDead) { if (GetCurrentHitPoints(oTarget) < 1) { int nHPPercent = 0; if( GetHasFeat(FEAT_HEROIC_RESOLVE, oTarget) ) nHPPercent = 30; else if( GetHasFeat(FEAT_FIGHTING_SPIRIT, oTarget) ) nHPPercent = 20; else if( GetHasFeat(FEAT_SPIRIT, oTarget) ) nHPPercent = 10; ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectResurrection(nHPPercent), oTarget); AssignCommand(oTarget, ClearAllActions()); } // Kickstart combat AI again if not player controlled... if (!GetIsPartyLeader(oTarget)) DelayCommand(4.0, ExecuteScript("k_ai_master", oTarget, 2003)); } } Link to comment Share on other sites More sharing options...
souder Posted February 6, 2006 Author Share Posted February 6, 2006 could i add the script into the on death event in the k_master_ai script? I would much rather just change one file that have to change several. Link to comment Share on other sites More sharing options...
souder Posted February 6, 2006 Author Share Posted February 6, 2006 How do i go about adding this to the end of combat round script (k_hen_combend01), my only real coding experience is coding for a ROM mud in C...If you can get me pointed in the right direction, it would be a huge help Link to comment Share on other sites More sharing options...
souder Posted February 9, 2006 Author Share Posted February 9, 2006 Nevermind, i got it working...thanx for the script Stoffe-MKB- when i publish it i'll make sure you get credit for helping me out. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.