Leaderboard
Popular Content
Showing content with the highest reputation on 10/18/2021 in Posts
-
1 pointNWScript is C-like - https://en.wikipedia.org/wiki/NWScript#Syntax As to my scripting abilities, they are fairly meagre, but enough to brute force a solution most of the time. To my own regret, I avoided scripting for most of the time I have been modding. I dabbled on the odd occasion when scripting was the only solution, but typically relied heavily on outside assistance for even the most basic of tasks. It wasn't until I got involved with K1CP that I really started to wrap my head around how scripting works. Almost entirely out of necessity, since probably 80-90% of the content is partially or entirely script-based. I owe a lot to JCarter426 for shepherding me along and answering all my noobish questions along the way. You could say I now know enough to be dangerous. The best way to wrap your head around things is to just look at vanilla scripts and examine how and why they do what they do to achieve their desired outcome. Obviously only global scripts have original source available, and most of those aren't commented particularly well, so initially it can be a bit overwhelming when looking at decompiled module scripts. But eventually you'll start to recognise familiar Include functions and drill down to the meat of a given script. And K1CP has all its source available to peruse, so it's worth having a look at some of those to see how we went about fixing things.
-
1 point
-
1 pointIf you want to gate via a specific skill rank, then you need to check for that instead: // 315: Get the number of ranks that oTarget has in nSkill. // - nSkill: SKILL_* // - oTarget // * Returns -1 if oTarget doesn't have nSkill. // * Returns 0 if nSkill is untrained. int GetSkillRank(int nSkill, object oTarget=OBJECT_SELF); By the way, your script is bloated because of the Include guff. The cleaned up original script is: #include "k_inc_end" void main() { if (GetIsPC(GetEnteringObject())) { if (HasNeverTriggered()) { SetGlobalFadeOut(); PlayMovie("01A"); SetReturnStrref(FALSE, 32228, 0); //String 32228 is "Return To Hideout". Should instead be 38550, "Transit Disabled". SetGlobalNumber("K_CURRENT_PLANET", 5); SpawnStartingEquipment(); SetGlobalFadeOut(); SetGlobalFadeIn(3.0, 1.5); DelayCommand(0.1, AssignCommand(GetTrask(), ActionStartConversation(GetFirstPC(), "m01aa_c01", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE))); SetMinOneHP(GetFirstPC(), TRUE); } } } You just want to replace the SpawnStartingEquipment function with your own custom one, but presumably the rest can be pulled from the Includes at compile. However, K1CP made some minor adjustments to the script to fix the player being visible before the first cutscene starts, so I would suggest using that version as a basis instead - https://github.com/KOTORCommunityPatches/K1_Community_Patch/blob/master/Source/k_pend_area01.nss
-
1 point
-
1 pointInside the models.bif as part of the BIF section of Kotor Tool. No texture exists for this alien, just the model. Here are some more screenshots of the alien from different angles. I had a look through a bunch of Star Wars aliens, could not find one which matched the model. If I'm able to reskin it and still can't find it's species, I might consider allowing the community to submit name proposals and we'll all vote on the species new name. I was thinking something like that, the Bulky Jacket does feel like a biker gang type of NPC... though I don't think it's a Devaronian per say. I agree with you on this one! The body of this alien looks similar to the K1 Quarren, though look closely at the arms. Notice how the Gands arms are sticking out in a T-Pose? That's usually how NPC models look like when viewed from a model viewing program. Here's an example: Assuming the NPC has NO animations in-game (like, none at all, no breathing, no idle animations etc), it will appear in-game as a T-Pose and if it was moving across the map then it simply glides along the ground in that T-Pose because the leg's aren't animated either. If this Gand was a very early draft alien, then it could be assumed that it was never animated and thus appears as a T-Pose in the image here: Unlikely, it looks more like a fly then whatever this is supposed to be: And as we both know, the Gand do look like flies. That could be possible. You see, I don't think Obsidian would've selected their new aliens based on one unused sprite in the game files of K1. Inside the alien VO 2da file exists an entry for an alien species called a "Gotal": https://starwars.fandom.com/wiki/Gotal Only the name is ever mentioned, there is absolutely no evidence of Gotal's being a thing for K2 other than that one name mention in a 2da. It can safely be assumed the Gotal's probably became Devaronian's in the end and that the decision to make the K2 aliens were totally independent from K1. That's because it IS. That mouse alien is called a Chadra-Fan, though in the game files it's only ever referred to as N_alien03_low as I wrote on the image. In K2, the N_alien02_low Gran was replaced with the actual Gran alien and the N_alien05_low Quarren was replaced by an actual Quarren. But N_alien03_low was unchanged, why? That is because N_alien03_low, the Chadra-Fan, was never used in K1 despite it existing in the game files. Oh, and an interesting thought: The reason why I suspect the Chadra-Fan was unused in K1 was because the Quarren, Gran and Chadra-Fan were supposed to be "Lite" NPCs. And since they were just designated as "aliens" they simply existed to be background characters, that is why you only see 1 Quarren with Bith VO (Pre-release screens from early 2003 show more Quarren background NPCs on Tatooine who were cut), the Gran simply exist as two swoop fans on Manaan with Duro VO and a has a small role as a GenoHaradan target with Gamorrean VO (Inconsistent) so the Chadra-Fan were probably intended to be background unimportant NPCs with Jawa VO most likely. It's a good thing Obsidian used them and gave them unique VO though.
-
1 pointI mean you could do something as simple as void main() { object oPC = GetFirstPC(); object oStore = GetObjectByTag("STORE_TAG_HERE", 0); int nPersuade = GetSkillRank(SKILL_PERSUADE, oPC); int nBonusMarkUp = -nPersuade; OpenStore(oStore, oPC, nBonusMarkUp); } Looking at the scripts for Yavin Station in K1, it seems like Suvam's discounts are either -5 or -20, so using the negative value of the PC's Persuade total as-is could work. Although you could modify it using if statements like I said before, perhaps something like: void main() { object oPC = GetFirstPC(); object oStore = GetObjectByTag("STORE_TAG_HERE", 0); int nPersuade = GetSkillRank(SKILL_PERSUADE, oPC); int nBonusMarkUp; int nPersuadeAdj; if (nPersuade <= 5) { nPersuadeAdj = 2; } else if (nPersuade > 5 && nPersuade <= 10) { nPersuadeAdj = 5; } else if (nPersuade > 10 && nPersuade <= 15) { nPersuadeAdj = 7; } else if (nPersuade > 15) { nPersuadeAdj = 10; } nBonusMarkUp = -nPersuadeAdj; OpenStore(oStore, oPC, nBonusMarkUp); } You can use whatever mathematical operations you like to scale the values as you require. Google the C formatting for whatever operations you want to do if you are unfamiliar with the syntax. You'll need to check each individual module. Check the merchant's DLG file to find out what script/s fire when they open the store. You'll then need to decompile the binary script (NCS), since only the global scripts have included source. You can pull the Tag of the store from the UTM file, although the scripts you'll be editing will already have it. You'll need DeNCS (requires Java) to decompile the scripts. You'll want DLGEditor to browse the DLGs (don't use KTool's included editor - it doesn't work properly with TSL DLGs). You can use KTool or KGFF to examine the various GFF files like UTCs, UTIs, UTMs, etc.