Masamune753 38 Posted April 21, 2021 Hello! I officially started on this, so I thought I should post progress in the official WIP channel as opposed to the general help one. This is my first attempt at making a mod, so any advice or callouts would be greatly appreciated. The outline is to bring a version of TSL’s richer companion interactions to K1. I am a big believer that story and gameplay should effect each other as much as possible, in TSL that is fulfilled by lots of real benefits for engaging with party members. The Exile has a huge effect on their companions, which makes sense given the plot. The same should be true for K1...but the features just aren't there. The bones for what we see in TSL exists as the upgrade system for HK-47, so that is the foundation I am building this mod on. The mod would give buffs to party members for finishing their sidequests. It would do this by leveling them up and equipping custom “hide” items to their hidden inventory slot when you finish their relevant quest. The goal is to boost the weaker non-jedi characters, while providing some incentive/satisfaction for pursuing their each character's individual storylines. I have the following basics mapped out: Kotortool + K-GFF Editor - Create new .uti files for the items containing the buffs. Kotortool + Kotor Scripting Tool - Create a script that equips the item in the “hide” slot (or replace an item already there) DLG_Editor - Attach the script to the dialog event associated with completing the relevant quest DLG_Editor - Change/add text to the last dialog entry associated with that quest to explain to players the nature of the boost [ala HK-47’s repair boosts] The relevant characters and quests are: Carth → Finding Dustil Mission → Mission’s brother Canderous → Jagi’s Challenge Zaalbar → Chieftain in Need Juhani → Threat from Xor Jolee → After Final Dialogue HK-47 → Finishing repairs T3-M4 → Finishing a custom dialog The bonuses would include leveling the character to make them equal to the player as well as the following: Spoiler Carth (All Weapon Specializations) The trauma has held back Carth. Finding Dustil helps Carth remember who he was, a battle-trained hero of the republic. Mission (Will +8) Mission will become more resistant to mental effects due to experiencing and seeing through yet another con job from her brother (and spending time with you). Canderous (Ability to equip lightsabers; Plus Focus Feat) Considering his strength build, his association with Jedi, and other Mandalorian lightsaber users, this feels like a unique boost to his character. I also believe he would abandon such a practice as he shifted to his role as Mandalore in TSL. Would pair well with JC’s Darksaber mod for K1 Zaalbar (+5 defense) Part of the culmination of his storyline is the implication he will return to lead his people one day. I think this would shift his sense of self-preservation (exiled vs. future leader). Juhani (Alignment shift +/- 21) Whether or not you push Juhani to murder Xor in rage will move her alignment 2 categories in either direction, making some powers less expensive to use Jolee (No other bonuses) Jolee doesn't really have a big moment where the narrative merits a particular benefit HK-47 No bonuses, since HK already gets several bonuses throughout the repair process T3-M4 A computer use challenge will allow T3-M4 to be used as an upgrade bench Progress: Released version 1.0! [1/26/2022] Spoiler Tested using custom saves here from djh268 (Thank you!) Finalized v0.5 version with TSLpatcher, testing now (thank you ebmar & StellarExile!). After a long time away, tested and confirmed new level up method to supplement meaningful bonuses to characters. Added bonuses for Juhani and Jolee. Mission will no longer get the power attack feats as her free bonus. This felt pretty lame in practice, even though it stacks well with one super-powered stealth attack. Created uti and scripts files, tracked down relevant dialog entries, wrote out player facing descriptions, and created final versions of dialog files with upgrade scripts. → Changed boosts to Carth and Mission: Keen & Massive Criticals (Too difficult to implement; these properties can only be applied at the item level or through hard coded feats) Plan B is to frame Carth as a hero of battle, any weapon available he can use to its fullest. The unique gameplay is to make him versatile. Most players will only have one weapon type specc'ed out fully, granting all types means some will be additive. Bonus Damage to Dark Alignment (Same as above) Using learning from the above, I am pivoting to power attack feats for Mission. Power attack meshs well with sneak attack since stealth/stun also lowers defense, negating the loss in accuracy. X Researched scripting methods that I could fire off from an item with "activate item" equipped in the hide slot to simulate an attack. While this is an interesting route I will explore, it should be out of scope for this mod. ✓ Proof of concept!!! Used updated dialog file for Carth to fire script to equip custom hide item and (some) bonuses applied. Defense boost, Regeneration, and Bonus Feat all worked "Keen" property didn't seem to apply based on feedback battle data Lightsaber unequip issue still exists. ✓ Fixed "Lookup path root set to: \ Error: Couldn't initialize the NwnStdLoader" error through updating registry as recommended here. ✓ Used KotorTool to pull HK-47 upgrade scripts to understand how they work ✓ Used DLG_Editor to identify dialog entries and relevant scripts for HK-47 upgrade sequence ✓ Used KotorTool to pull hide items for Canderous, T3-M4, and HK-47 for reference Credits (Will continue to update as I go): Big thanks to Thor110 for directing me to his video tutorial on Kotor modding! Additional gratitude for DarthParametric as they talked through issues Huge thanks to ebmar for helping me clean up my change.ini for TSLpatcher JC & Sdub for helping find Xor’s .dlg file djh268 for their full game saves I used for testing StellarExile & N-Drew25 for taking a look at my mod before release Blue for their Kotor Scripting Tool Fred Tetra for KotOR Tool tk102 for their DLGEditor Stoffe & Fair Strides - TSLPatcher 4 Quote Share this post Link to post Share on other sites
Masamune753 38 Posted April 23, 2021 Is there anyone who could help me figure out how to decompile k_sp1_generic.ncs? I am using DeNCS and I have tried with both K1 and TSL's nwsscript.nss included in the folder. I still get a "Decompiling...k_sp1_generic.ncs: failure" error. For context, I am trying to learn how force powers are scripted so I can attempt to create some kind of effect that can be pinged off a hide item's "Active Item" property (thus pinging a script I have made in the impact script column of an updated spells.2da). Quote Share this post Link to post Share on other sites
DarthParametric 3,783 Posted April 23, 2021 It's a global script. You don't need to decompile it because the game already includes source for it. Look in the NSS folder of the same BIF you got the NCS from. Quote Share this post Link to post Share on other sites
Masamune753 38 Posted April 23, 2021 5 hours ago, DarthParametric said: Look in the NSS folder of the same BIF you got the NCS from. Oof. Thanks for the callout, I can say that I looked ahead of time and just missed it but that almost makes it worse. Quote Share this post Link to post Share on other sites
Masamune753 38 Posted April 23, 2021 So, my hope with digging into the force power scripts was to reverse engineer how the game does force jump, since it is listed in the spells.2da. My plan was to use force jump as a reference for some kind of special attack that could be triggered by using the equipped hide item. Looking into the "k_inc_force.nss" file... I have a good frame of reference for what force powers look like, but the listings for force jump don't actually lead anywhere. My guess is they are hardcoded into the .exe with the rest of the attacking feats. As I was doing that I realized I was putting the cart before the horse by not checking whether the "activate item" property could be pinged off a hide item at all. When I tried, it looks like it does not. I assumed it could since that is the premise of the "whereami armband" found here. Looking at that file, it seems like this was something implemented in TSL. For anyone who has more insight, could something like the "whereami armband" be implemented in K1 at all? If so, could anyone help me with the qualifications necessary to make that work? My plan with the pinged script would be as follows (Spoilers for anyone who wants to be surprised by the companion bonuses): Spoiler I am hoping to create a spell that simulates a rapid fire of blaster attacks from Carth. The outline is that this could be loaded exclusively on Carth through the same hide item implementation that I would equip through a dialog entry. You would activate this spell through the equipped item and then I could just attach blaster fire animations to the activation to make it SEEM like a ranged blaster attack. In reality, it is just a spell that only Carth would have access to. Incredibly hacky, but that is my current outline given the limitations. Quote Share this post Link to post Share on other sites
DarthParametric 3,783 Posted April 24, 2021 You need to provide more detail about what it is exactly you want to achieve. I gather you want a scriptable attack animation? What is the scenario you envisage this executing in? What's the goal? Are you looking for some simple combat buff, or some sort of cinematic thing? Interactive armbands work exactly the same in both games. You give it an "Activate Item" property which links to spells.2da, this in turn fires a script. The script then does whatever you want, within the limits of the engine. So you can start a conversation/cutscene, open/close doors, spawn items/creatures/objects, kill/destroy items/creatures/objects, add/remove party members, jump the player/party to different positions, warp the party to a different module, set plot states, etc. You can also do this with other interactive items the player equips, like medpacs or stims. You can add an Activate Item property to any item, but a creature hide is not exposed to the player. It is not interactive, so the player can never activate it. The same goes for most other equippable items - there's no way for the player to manually activate them. If you are looking for combat effects, you can apply On Hit status effects to weapons, like slow and stun, etc., but these don't fire scripts. Items can also grant feats, so you could just make a blaster that grants the full Rapid Fire series of feats. So if you wanted to have a manually activateable item, you could just use an armband. K1 doesn't have a pre-existing user limitation for Carth, so you'd have to jump through some hoops to limit it to only him. You could use this in conjunction with your creature hide idea, where the script checks if the activating creature has the hide equipped and the effect fails if not. But how you go about it goes back to my first quest - what is it you are trying to do exactly? 1 Quote Share this post Link to post Share on other sites
Masamune753 38 Posted April 24, 2021 Hey DarthParametric, I felt like my posts were already pretty longwinded, but I am happy to get more granular in detail. 30 minutes ago, DarthParametric said: You need to provide more detail about what it is exactly you want to achieve. I gather you want a scriptable attack animation? What is the scenario you envisage this executing in? What's the goal? Are you looking for some simple combat buff, or some sort of cinematic thing? My overall goal is to provide a gameplay boost/capability for each non-jedi character as a reward for their side quests. For me, those boosts need to have the following characteristics: Consistent with the character Unique in how they affect gameplay Additive such that the player choice/ignorance wouldn't negate it It would be easy to just add a flat +5 to a different attribute for each character and be done with this, but I feel like that is pretty boring. Adding a bonus feat like Rapid Fire wouldn't work because players could easily choose those feats before finishing the questline, then the whole benefit would be lost. For Carth, my goal is trying to find any way for him to deal more damage that follows the characteristics listed above. The scenario would be something useful for every battle till the end of the game. Getting started, I had the idea of all of Carth's attacks having Keen+Massive Crit (thus stacking with the crit feats). However, increased crit range is an item property that cannot be applied at the attack action level outside the Crit feats. The armband and "Activate Item" property line of thought was born out of an attempt to create or simulate more critical hits (again, outside of just granting the Crit feats). When that seemed impossible, I wondered if the same Armband+Script method could instead activate an attack spell that would damage a target 5 times in a single round. If that is true, then the next step would be to associate that custom spell with an animation that looks like Carth firing his blasters. The goal isn't to just make him deal more damage with his regular attacks, that wouldn't be any different than 4-5 other buffs any character could do. 5 attacks per round would be unique for a non-jedi character and would fit a sort of gunslinger theme. More critical hits would fit a theme of being a veteran soldier who is just better at shooting. If it seems like I am leaping from idea to idea, that is because I am. I am engaging with this whole exercise as a way to learn how all of these systems work, so a lot of what I covered above I learned for the first time by trying it out. 1 hour ago, DarthParametric said: You can add an Activate Item property to any item, but a creature hide is not exposed to the player. It is not interactive, so the player can never activate it [...] So if you wanted to have a manually activateable item, you could just use an armband. K1 doesn't have a pre-existing user limitation for Carth, so you'd have to jump through some hoops to limit it to only him. You could use this in conjunction with your creature hide idea, where the script checks if the activating creature has the hide equipped and the effect fails if not. This is interesting. My thinking about being able to activate a hide item was based on Juhani's Eriadu Stealth Unit. However, that clearly is an exception since stealth is activated in a unique way. So, if the script simply has to be activated through an armband (which could be limited to Carth through a custom feat granted by the same hide item), could you have an armband that just fires off a modded script of Adv. Lightsaber throw? If that is true, could you just link it to a different set of animations that already exist (like firing blasters)? A modified version of Adv. lightsaber throw could also fit a gunslinger theme by appearing as though Carth is shooting at several targets all at once. Quote Share this post Link to post Share on other sites
DarthParametric 3,783 Posted April 24, 2021 You are probably going to wind up disappointed if you expect characters to reliably perform scripted animations during combat. For starters you cannot play arbitrary animations in K1 using PlayAnimation/ActionPlayAnimation. Only TSL can do that. In K1 you are limited to a small pool of anims predefined in nwscript.nns like ANIMATION_LOOPING_DANCE, ANIMATION_FIREFORGET_SALUTE, etc. There is the CutsceneAttack function, which, as the name suggests, is designed for choreographing cutscene fights. That does let you specify attack animations, but I have no idea if that will even work outside of a cutscene. void CutsceneAttack(object oTarget, int nAnimation, int nAttackResult, int nDamage); It also lets you specify whether the attack is a hit or miss, and what the damage is. I suppose you could experiment and see what it does when fired during a regular combat round. I'm not sure if anyone has done that before. There may be a problem with the target not responding with the appropriate animation, assuming it works at all, so they might also need to be forcibly scripted in the same manner. 1 Quote Share this post Link to post Share on other sites
Masamune753 38 Posted April 26, 2021 On 4/24/2021 at 12:21 AM, DarthParametric said: There is the CutsceneAttack function, which, as the name suggests, is designed for choreographing cutscene fights. That does let you specify attack animations, but I have no idea if that will even work outside of a cutscene. Thank you for the advice! I think I will look into this as its own concept, since I don't want a bunch of exploratory fiddling to bottleneck this mod. Obviously you can pursue this as well, that is your prerogative. If anyone else is inspired by this thread, I'd say just shout us out if anything comes of it! ------------------------------------------------------------------------ For anyone tracking this thread, I do have a question about the general etiquette for posting new mods. Right now, I have all the files necessary to make the mod happen in-game. I am planning to spend the night testing this as much as possible. If all goes well, I will start figuring out TSLpatcher to release a 1.0 version. However, the files I am using are already built off the dialog.tlk from [KotOR] Dialogue Fixes 4.0 and the K1CP 1.8.1 changes to Canderous and Carth's .dlg files, so it would likely be compatible with most people's games since most people use those mods (big assumption?). So, my question is whether it would be considered inappropriate to post a 0.50 version that just had those files without TSLpatcher? This would let me, potentially, hear feedback on the mod earlier so I could make changes before integrating TSLpatcher. I only ask because I imagine the TSLpatcher research will take a bit, since I have never used it and I will most likely need to make adjustments to this mod based on whether or not players have the dialogue fix and K1CP mods installed to ensure as much compatibility as possible. Quote Share this post Link to post Share on other sites
ebmar 893 Posted April 27, 2021 On 4/26/2021 at 10:14 AM, Masamune753 said: ...whether it would be considered inappropriate to post a 0.50 version that just had those files without TSLpatcher? As for me -- you can always ask for permission from both the author for using the files/setup taken directly from them. I mean, since you already said that you have it from. Granted, it's not impossible for someone happened to create similarity to what others did, and for that I believe it's fine to release one [without direct permission] -- at least on modding practice, far as my concern. And that's from etiquette perspective. What makes them legit or not from what I see is whether they can provide support to their work. If they can, then it's good -- if not then they better don't. As from practical perspective I guess it'd be better if you create something that at least at the same level -- both in compatibility as well as quality -- as what it means here at least you don't make new problems that didn't occur previously. Lastly, consider releasing this or any of your mods using TSLPatcher as possible -- regardless of how difficult for you to pull that one off, you'll find it more rewarding than the other way around. Cheers, and good luck! 🍻 1 Quote Share this post Link to post Share on other sites
Masamune753 38 Posted April 29, 2021 As I went through testing this the last few days, the script based equipping and extra dialog worked great, but I really didn't like one of the bonuses I had planned. I have thus pivoted on one of the characters (I will list out details in the progress section in the OP) and part of my new direction will be to get back into the armband+script method. I created the script for the buff, added a new row in spells.2da by copy pasting the basic energy shield row and changing the name and pointing it to the new script, built out an armband edited off of KotorTool to activate the new effect and...it didn't work. One possibility is that this has something to do with the armband, but in game it seems like everything works up until the effect is supposed to take place. That suggests it is just flawed scripting on my part: void main(){ { effect eLink; { eLink = EffectMovementSpeedIncrease(99); ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, OBJECT_SELF, 600.0); } } } I edited this from the burst of speed force powers, but considering it didn't work I am wondering if there is some glaring error. I removed the reference to a spell target and changed that to OBJECT_SELF, added the eLink within the ApplyEffectToObject, and changed the duration to 10 min (600 sec). The script itself wouldn't compile without the above changes. Does anyone have any advice for how to edit this? Or even to just clarify why it is failing? Quote Share this post Link to post Share on other sites
TamerBill 135 Posted April 29, 2021 Well for starters your brackets are all over the place. And while it doesn't actually affect anything, you shouldn't use the name eLink if you're not linking effects together. So what you're actually trying to write is this: void main() { effect eMove = EffectMovementSpeedIncrease(99); ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eMove, OBJECT_SELF, 600.0); } If it doesn't work then the problem is probably how you've set up the armband. 1 Quote Share this post Link to post Share on other sites
Masamune753 38 Posted April 30, 2021 @TamerBill This script worked! Much appreciated. I had to do a lot of KotorTool rinse-and-repeat at doing seemingly the same thing with the armband, but eventually it worked. In the great spirit of learning by doing, I just learned that movement speed during stealth is fixed. Oh well, at least now I have a template for new versions/attempts. Quote Share this post Link to post Share on other sites
DeathScepter 46 Posted June 24, 2021 a possible idea is that you add a Creature Hide line that reflects the weapon. Carth's hide: Blaster tag(please refer to the Blaster item row there are damage, critical threat and critical mulitiple and AC. Well I was testing on a gauntlet row and use the quarter staff damage tags. it does work. i am tempted to full on Mod with that in mind later down the road. Quote Share this post Link to post Share on other sites
Masamune753 38 Posted January 8, 2022 On 6/24/2021 at 3:05 PM, DeathScepter said: a possible idea is that you add a Creature Hide line that reflects the weapon. Carth's hide: Blaster tag(please refer to the Blaster item row there are damage, critical threat and critical mulitiple and AC. Well I was testing on a gauntlet row and use the quarter staff damage tags. it does work. i am tempted to full on Mod with that in mind later down the road. @DeathScepterThat is fascinating, would you be open to sharing the script you made for the gauntlet as an example? Note to the overall thread: I actually had a baby (#2) like 5 days before this post, so it 100% fell off of my radar. 1 Quote Share this post Link to post Share on other sites
DeathScepter 46 Posted January 8, 2022 right now, baseitem.2da needs to get familar with. Each weapon has a number in a column to reflect the associate script. So a quarterstaff will have a different number from lightsabers with baseitem.2da. Baseitem.2da within Kotortool can do a lot for hides and items. congrats to the new baby, all babies are handful. I have been busy with family. 1 Quote Share this post Link to post Share on other sites
Masamune753 38 Posted January 11, 2022 Updated my plan for this mod...it will be too hard to provide differentiated bonuses for each character using the "hide method" because only certain properties can be added to hide items. Instead, I am planning on the completion of a character's questline to have that character level up. This level up would stack on top of some of the hide bonuses I have already planned to help balance out the characters (Jedi vs. Non-jedi). Since levels are always useful, this relieves some of the pressure on the hide bonuses to feel meaningful enough. My only problem now...I still cannot get a non-Jedi character to carry a lightsaber. Does anyone else have insight on why, even with the lightsaber feats added through hide items, the lightsabers keep unequipping when moving between areas? Quote Share this post Link to post Share on other sites
TK-664 69 Posted January 11, 2022 Happens when the character doesn't innately have the required feat - bonus feat property doesn't cut it. Idk if you can do it in K1, but in TSL you can script it in: void main() { GrantFeat(43,GetObjectByTag("Cand")); } Quote Share this post Link to post Share on other sites
18thegamer 2 Posted January 11, 2022 6 hours ago, Masamune753 said: Updated my plan for this mod...it will be too hard to provide differentiated bonuses for each character using the "hide method" because only certain properties can be added to hide items. Instead, I am planning on the completion of a character's questline to have that character level up. This level up would stack on top of some of the hide bonuses I have already planned to help balance out the characters (Jedi vs. Non-jedi). Since levels are always useful, this relieves some of the pressure on the hide bonuses to feel meaningful enough. My only problem now...I still cannot get a non-Jedi character to carry a lightsaber. Does anyone else have insight on why, even with the lightsaber feats added through hide items, the lightsabers keep unequipping when moving between areas? Do you know other Modders, maybe they could help you ^^ Quote Share this post Link to post Share on other sites
Masamune753 38 Posted January 11, 2022 52 minutes ago, 18thegamer said: Do you know other Modders, maybe they could help you ^^ I don't! I have been working on this on my own outside of the help I've had from all the great folks in this thread. @TK-664 I will test this out today and see if it works! Quote Share this post Link to post Share on other sites
DeathScepter 46 Posted January 11, 2022 for lightsaber feat for any class. Go to Feat.2da file, Go to Weapon Profiency: Lightsaber row and change 4 to 3. Next column will be level given. for example, 3 will grant and level 4(it will be your choice) will be appear when leveling up. Quote Share this post Link to post Share on other sites
Masamune753 38 Posted January 11, 2022 @TK-664 Unfortunately that function doesn't exist for K1. Right now, there I have knowledge or can guess at 3 ways to have a non-Jedi character use a lightsaber (without it unequipping): Change the Feat.2da file to allow the class in question to acquire the feat (either at level up or automatically) [Thanks @DeathScepter!] Problem: My goal is to give this bonus to Canderous only. Anything I add to the soldier class would allow Carth to use it as well. This method also doesn't ping off of the completion of a side quest, which is the primary goal for this mod. Re-model/skin a custom vibroblade or create a new weapon type in the baseitem.2da that is essentially a lightsaber for Canderous to use exclusively Problem: The model + animations for lightsabers are likely more complex than what can just be copy pasted onto a vibroblade .uti plus model/texture files in override. If it is possible, I would need to learn a whole lot of stuff to try. Creating a new weapon-type, if it is as easy as appending baseitems.2da and not hardcoded, would be easier but involve new ground to cover. Create some kind of script that re-equips the lightsaber after it is unequipped between areas Problem: I have no idea how I would do this or if it is feasible. Quote Share this post Link to post Share on other sites
TK-664 69 Posted January 12, 2022 3 hours ago, Masamune753 said: @TK-664 Unfortunately that function doesn't exist for K1. Thought that might be the case. I'm not a proficient scripter by any means, so I can't help you there without dedicating some time myself into getting comfortable with scripting for kotor 1. 3 hours ago, Masamune753 said: Re-model/skin a custom vibroblade or create a new weapon type in the baseitem.2da that is essentially a lightsaber for Canderous to use exclusively You should know there are certain features hardcoded by row ID in baseitems.2da but I don't know the full extent of it. 1 Quote Share this post Link to post Share on other sites
Masamune753 38 Posted January 12, 2022 👨🔬Good news everyone! It looks like adding a row to baseitem.2da worked. I copied over the lightsaber row and deleted the required feat. Once I changed a custom lightsaber to that item type, everything else stayed the same but anyone could equip it. I tested it in battle and it worked as expected. Now all I need to do is create a generic feat for Canderous that I can restrict the item. I am debating whether it is worth it though, other mods that interact with his character might not play nice. Quote Share this post Link to post Share on other sites
18thegamer 2 Posted January 12, 2022 23 hours ago, Masamune753 said: I don't! I have been working on this on my own outside of the help I've had from all the great folks in this thread. @TK-664 I will test this out today and see if it works! Ok, thats hard. I know one or 2 Modders, maybe I can ask them, if they could help you... 1 Quote Share this post Link to post Share on other sites