AmanoJyaku

Members
  • Content Count

    243
  • Joined

  • Last visited

  • Days Won

    11

Everything posted by AmanoJyaku

  1. It's been quite interesting these last few weeks, eh? I hope you are all doing well. There's been progress in analyzing the NCS byte code. Graphviz has been invaluable in producing the maps necessary to visualize the program flow. At the moment, one script has been reverse engineered. By no means is a decompilier close to being ready, but it is a significant step in analyzing the program flow. At the moment, several NCS code patterns have been identified that map back to NWScript: Dead code (e.g. perfectly valid code that never gets called, and theoretically could be removed) Assignment (e.g. i = 5) Named variable declaration (e.g. int i, float f, string s, object o) initialized from constant (e.g. int i = 5, float f = 0.0, string s = "Jello, World!") initialized from engine routine (object o = GetFirstPC()) initialized from subroutine (bool b = IsItTrue()) initialized from named variable (int i = integer_i ) Selection If (GetLocalBoolean(55)) If (!GetLocalBoolean(55)) If (IsItTrue()) If (!IsItTrue() Switch (i) {case 0: break; default: break;} Attached is a control flow diagram of the script k_sup_galaxymap.ncs. Red blocks are dead code. There are three switch statements in the code. Can you find them? Expect more updates in the next few weeks!
  2. I don't think you'll be hearing from Ӄhrizby. They said they aren't active, and their profile shows they haven't logged in for over a year. That being said, have you tried a search? https://www.youtube.com/channel/UC8VyY5xlo_-BDGOn8It7-qA https://www.bing.com/videos/search?q=NWMax&qpvt=NWMax&FORM=VDRE
  3. There's your next project: Hanharr Romance Mod
  4. Yes, they are bugged. I've received other achievements erroneously, as well. It's likely the bugs are the result of existing game and/or script bugs.
  5. It can't find the video. I think you need to put it in the "Movies" directory. As an example, if you have vanilla TSL from Steam you put it in: C:\Program Files (x86)\Steam\steamapps\common\Knights of the Old Republic II\Movies If you have TLSRCM from Steam: C:\Program Files (x86)\Steam\steamapps\workshop\content\208580\1402798020\movies Edit: DP is more experienced at this than I am. Try their advice first, then try mine. Let us know how it goes.
  6. The name of the script file is what goes into Script #1. This file would be: Written in NWScript Saved as filename.nss (just a plain text file like *.txt) Compiled into filename.ncs Placed into a game directory (probably the Override directory?) Entered into the Script #1 field as "filename" without the .ncs extention The contents of filename.nss would be something like: void main() { if (SexyTime) { PlayMovie("MakeOutWithExtraTongue", 0); } The movie file would be MakeOutWithExtraTongue.bik. I opened TSLRCM credits video in VLC, and the resolution is 1920x1080. And, yes.
  7. I think you just need to attach a script to the dialog line. After the line is spoken/printed to screen, the script fires automatically. Inside the script you'll execute the PlayMovie() engine function. Use DLGEditor to attach the script to the dialog (for K2 scripts you will fill in the field "Script #1") Here's an example of the script:
  8. It's been a month, so here's a progress report: Completed decoding of opcodes, data types, header fields Validating basic fields and generating (helpful?) error messages Embedded NWScript engine calls into program code No need for modders to provide nwscript.nss Created call graphs of subroutines Generating graph description files for Graphviz renderer Created control-flow graphs of basic blocks Generating graph description files for Graphviz renderer Created call stack simulator Keeping track of which variables are modified To do: Identifying iteration, selection and jump statements Operator associativity and precedence Type conversions Byte code conversion to source code Source code conversion to byte code GUI Setup new dev laptop (dropped current laptop last night, awaiting delivery of new one) 😢 Probably more stuff, but I don't know what I don't know, you know?
  9. You could always try the cheat console. Just warp to the module where you want to test. It's how I test my end-game mods without playing the whole game. Of course, this isn't guaranteed to work if there are prerequisite globals that need to be set. But, those globals are documented in various places, and you can get your answer in a few minutes compared to waiting hours for forum responses.
  10. Found by entering "color" into the search field, and selecting "Files" from "Search In". There may be others, have fun searching.
  11. First, check to see if there are existing mods that do what you want (or something similar to it). Next, read the tutorials section. Here is an example that might help.
  12. The ini is looking for "xae Knights of the Old Republic\xae COLLECTION". Your game is not installed there. Change it to match your install path: K1_Path=C:\Program Files (x86)\LucasArts\Star Wars® Knights of the Old Republic® COLLECTION K1_SavePath=C:\Program Files (x86)\LucasArts\Star Wars® Knights of the Old Republic® COLLECTION\saves
  13. I put my original mod on hold since someone else is making it. And, wow, does it look good! So, on to the most neglected project: a new DeNCS. It's currently able to interpret op codes and arguments, so the next step is the higher-level control flow. Here's where you can help: Byte Code - I obtained a list of op codes from here. I need to make sure it's complete and correct. NWScript - I am compiling a list of operators, punctuators, and keywords from here, and here. I need to make sure it's complete and correct. Mapping - This is the big one, making sure script converts to byte code, and vice versa. 100% identical conversion, every time. No pressure. DOT Diagram - I need a program that can make diagrams from DOT DOT Generator - I can generate the DOT from my code, but it would be helpful if something could do this for me, as well. Name - Right now, it's called DeNCS 2020. Narrowly edging out NewNCS. Please, give it a good name. A couple of things I want to address. DeNCS sometimes reports a partial-byte mismatch. At first, I ignored this just like every other modder. However, while testing this tool I compared the output of an NCS file straight from the game to the output DeNCS generated... Well, it looks like DeNCS attempts to convert the NCS to source code, then attempts to convert the source code back to an NCS file. Then, it compares the original NCS to the new one. And, if they don't match? Partial-byte mismatch. I don't know why DeNCS doesn't always perform a perfect conversion, but it's something to investigate. Particularly, since there are reports that even NCS files generated by Bioware and Obsidian had bugs in them. Troubleshooting the NCS files will make this longer since I have no way of knowing what the original files should have looked like. (But, I can guess just like DeNCS seems to do.) This is command-line only. There was never any intention to make this a stand-alone tool. However, development will take longer than I expected, which means a GUI is the least of my priorities. At some point, I want to merge this into a toolset, maybe even the one up above. So, no GUI. (That also means the stand-alone tool won't be around for very long.) Got any feedback? Thanks! Edit: I just downloaded Graphviz, so I am covered with DOT diagrams. I think the included library will allow me to generate DOT, too.
  14. Correct. For enemies that have that script, you have a 100% chance of getting loot. I've never tested this, but this is what I read from the script code. You have a 50% chance of getting one or more items of a single type (returns 1, e.g. 1 or more med packs), and a 50% chance of getting one or more items of two (potentially different) types (returns 2, e.g. 1 or more med packs, and 1 or more blaster pistols). To test this properly, you'll either: 1) Want to be on Telos or later. As far as I know, most of the enemies on Peragus and the Harbinger have the no-treasure script attached. 2) Modify the early enemies. But, that requires modifying every enemy's UTC file. 3) Modify the no-treasure script itself. But, that can be confusing if you aren't good at keeping track of your files. Whichever option you choose is up to you.
  15. I believe that is correct. Random(4) can return any value from 0-4. If it returns 0, 1, or 2, the value passed to PlaceCritterTreasure() would be 0 or less after subtracting 2. This will prevent treasure drops since that is the quantity to be dropped (e.g. -2, -1, 0, 1 or 2 items). So, whatever value is passed as a second argument (i.e. replacing the expression Random(4)-2) needs to evaluate to 1 or greater. Note that drops are extremely random, and are partially based on your level. You may be better off with the cheat console.
  16. I'm in agreement, and I'm hoping I'm wrong about the bonuses being hard-coded. It would help with a mod I have in mind... Still, a thread on another forum gives a good reason why bonuses are problematic: what if you want to be grey? There's nothing for you. Even the personal crystal in KOTOR2 is crappy for grey Jedi. And this is important, given that the game is all about challenging the notion of light/dark.
  17. I looked through the save files and can't find my alignment bonus in the stats. I can't find my Wisdom bonus from T3 in KOTOR II, either. So, I think it's hard-coded. My guess is the bonus is recalculated from global variables each time you load a module, as I've seen a few stats do this. The game isn't challenging even without the bonuses. That being said, the Poison Immunity bonus is OK. IIRC, it can prevent Plague which weakens you. Of course, I never let my enemies live long enough to cast it...
  18. Can't say for sure, but it looks like it modifies important things. So, I would start with a new game. You might be able to get by with a save early in the game if you haven't visited any worlds, but I'm guessing. I know, you want to skip Peragus and Telos... No love for the opening game.
  19. To expand, there's a thread about this: https://deadlystream.com/topic/7321-why-not-to-use-the-steam-workshop/ Specifically: tl;dr You want to mutli-mod, so you can't shouldn't use the Workshop.
  20. It's the sonic imprint sensor from Peragus. And, you don't need to have it in your inventory. Instructions (with spoilers) can be found here: https://steamcommunity.com/app/208580/discussions/0/350542145693737069/
  21. Is it possible those mods "cheated" by placing a UTC into the SAV file? That's pretty much what the game does, anyway.
  22. Most quests don't have "Smarter" solutions than persuade, just different solutions. It also helps to know which game you're referring to. In K1, all [Persuade] options use the persuade skill. However, in K2, various features can persuade. For example, in Nar Shadaa there are at least two encounters (both in the Refugee section) where successful [Persuade] is based on the Strength attribute! [Persuade] compares against Skills, Attributes, and/or global variables. Finally, not everything is listed as [Persuade]. In Peragus, a high [Intelligence] attribute helps with the dormitory holo recorder console (computer consoles are just dialog with a computer). In conversation with Kreia, [Awareness], [Intelligence] and [Wisdom] can make certain options appear. The real kick is that [Persuade] isn't always to your advantage. Atton gets angry if you try to [Persuade] him to talk about his Ecchani training.
  23. Dope. I haven't played this game since it first came out, so I never knew there was a modding scene. In an ideal world, yes. But, I only have a Windows machine, and no interest in installing Linux or buying a Mac again. lol The initial focus is making a program that works correctly. After that I can make an API so the source can be ported. I prefer as pure a C++ implementation as possible, with only the GUI using non-portable code. For Windows that's DirectX, and then whatever equivalents exist on Mac and Linux (Metal and OpenGL?). Since it will have an API, it can easily have any front-end, even QT. I feel the same, and I've been coding for two years now. 🤣 Eventually, you'll realize you don't know sh#t and will never know sh#t, yet somehow a pot of coffee and a box of donuts gets something decent enough out the door the morning of a release. Mm, donuts...
  24. StrategyWiki has a nice chart of XP gained for killing enemies in KOTOR1. Is there a chart anywhere for KOTOR2? Even a formula is fine. Additionally, does anyone know of a way to alter creature details like level, attributes, etc... after a creature has spawned? Since most enemies are spawned when you enter a module, you get less experience per kill each time you reach an XP-level threshold. I could use triggers and/or encounters to spawn new enemies to reflect any levels gained after entering, but I would rather just fire a script. Something like: object oMe = GetFirstPC(); int iXP = GetXP(oMe); int iCR = RecalculateLevel(OBJECT_SELF, iXP); SetChallengeRating(OBJECT_SELF, iCR); Where OBJECT_SELF is the enemy creature.