• Content Count

  • Joined

  • Last visited

  • Days Won


AmanoJyaku last won the day on October 3 2020

AmanoJyaku had the most liked content!

Community Reputation

106 Jedi Grand Master


About AmanoJyaku

  • Rank
    Jedi Knight

Recent Profile Visitors

1,329 profile views
  1. As far as I know, anything you can do in a DOS prompt you can do in a PowerShell prompt. And PowerShell is way better in other ways. So, no need to make changes to the Registry. Also, I try to avoid downloading things from websites as I can't trust the downloads are free of malware, or that the REG files won't do something I don't expect. No, I'm not saying I have proof of anything wrong with the link or the files posted there. I'm just saying be paranoid, because 30ish years of using the Internet says that's the best approach. And, yeah, I recognize how that sounds on a mod site. 😁
  2. I just discovered Windows 10 virtual desktops...

    How have I lived without them all this time???

  3. I honestly don't know, but that's the original author's decision to make. No matter how nonsensical something might seem, you still have to respect other people's wishes. Yes, it does. And there was never any bad blood on my part. I was simply concerned darthbdaman didn't understand the consequences: years of your work was wasted, people looking forward to the mod are left without, and a rift was created with some modders. Fortunately, you can create something else in its place. To you, as well, friend! I'm writing a tool that's even more proprietary than a mod, and I plan to release its source freely along with a detailed explanation of its design methodology. So, I agree with you in spirit. Still, if someone else has restrictions on their work I will respect those restrictions. If you think that's wrong then you need to discuss that with folks. That's just how life is.
  4. Glad I'm not the only one who thinks the series is overrated. I'll even say it's not good, being full of plot holes and silliness. Why did someone punch Mando in his beskar helmet, scream in pain, then try to punch him in the helmet again? Why does the series show beskar as nigh invulnerable, but has Mando hiding behind pillars to avoid being shot? Why do they make a point of explaining the reason a transport can't move quickly, then have Mando demand the transport speed up? Why the hell are they camping out in the open when there are man-eating pterodactyl things flying around?
  5. Yeah, @InSidious could have just said "no, piss off" and risked looking like a selfish jerk. But they chose to explain why they were telling @Salk to stop. Next time, Salk will be more careful to respect the traditions of the mod community since they have a clear explanation of what they did wrong. I looked at the ModDB page, Salk was beyond talking and work was under way. Worse, they gave the impression they were working with all mod authors. A lot of people who were looking forward to this release are going to be let down.
  6. Often, documentation is written with the assumption that the reader has some familiarity with the topic and is simply looking for a reference as a refresher on minutae. For example, the C# link shows a class definition A with an unassigned static scalar variable x, and unassigned instance scalar variable y. This is valid because it states: The default value of an int is 0. This is achieved by the compiler writing the assignment code for you, so the initialization occurs. In contrast: With the exception of the section "Try-catch-finally statements", the remainder of the document specifically uses uninitialized variables to point out their dangers. The "Try-catch-finally statements" section demonstrates a contrived (meaning, unrealistic) example of "safe" use of uninitialized variables. Documentation and tutorials use contrived examples to demonstrate how something works, but often caution such examples are not acceptable in production code. I should point out Microsoft's documentation is mostly filled contrived examples. Post one of their examples on StackOverflow and prepare to be burned. tl;dr: never assume uninitialized variables are safe. There's a mantra you should repeat to yourself: code for correctness, worry about performance later. Modern CPUs are fast, and compilers are good at optimizing your code for those CPUs. A CPU that operates at 3 billion cycles per second does not benefit from saving a few dozen cycles by omitting a single variable initialization. If the compiler thinks you can benefit, it will often make the change for you. For example, creating variables inside of loops is considered a bad practice because you're just going to create and destroy that variable repeatedly. Which is why compilers perform variable hoisting, meaning the variable is taken out of the loop and placed before it. So: int Count = 10; while (Count > 0) { int i = 0; //Do something with i --Count; } Becomes: int Count = 10; int i = 0; while (Count > 0) { //Do something with i --Count; } But, you should probably just use a for loop: for (int i = 0, Count = 10; Count > 0; --Count) { //Do something with i } Readability is a concern, yes. But, it's more readable when you give a variable a descriptive name, initialize it with an appropriate starting value, and place it where you intend to use it. In the example, I can guess Count is the number of times to execute the loop. But, I should give i a better name. Maybe it should be Meters, or Years, or Euros? Both variables are created once, and destroyed once the loop completes. See how much we can learn from this simple code fragment? I'm not sure I know what you mean by hiding variables, but if you place them where you use them then they aren't hidden. Conflicts can easily be avoided by using descriptive names. And a function should only be as large as the single task it performs. And, please, no global variables. I don't think there is ever a reason for global variables. As for memory, that's only a problem with embedded systems and some 32-bit platforms. No matter how little RAM a computer has it still has access to virtual memory. It won't crash, but it will be slow. That's the plan. I have no idea, I only learned about these tools when I answered your request for help. It's embarrassing, because I have two copies of NWN, I just need to find them...
  7. My concern with nwnnsscomp is that we now know its output differs from that of the original compiler. That leads to three possibilities: The output files are fully reversible, even if they differ slightly from the source. This is acceptable. The output files are fully reversible, but require additional code to detect and handle the differences from the original compiler. This will be very annoying. The output files are not reversible. This is unacceptable. At the moment, I have no idea which of these is the case. With over 2,500 files, there is no reasonable way I can develop a reverse compiler while inspecting each script in a timely fashion. I feel it's something to take note of, and look into once the reverse compiler is complete. I don't know who taught you this, but it's a practice that's frowned upon even with modern compilers. We try to learn good habits rather than relying on the compiler to handle things we could easily do ourselves. It's not uncommon for bugs to creep into compilers, and you can track these down more readily with proper code. This advice comes from the best programmers at places like Apple, Google, and Microsoft, and even the ISO C and C++ committees. Why not create variables local to the else branch's scope? That's the whole point of having scopes, to create variables only where they're needed. Variables placed in too high a scope, e.g. the global scope, are at risk of being overwritten erroneously. As for the compiler knowing better than we do, that's true of professionally written compilers. Which nwnnsscomp is not. I've already listed some of the basic things it fails to optimize, e.g. failing to remove empty functions. To be fair, the original compiler from BioWare has an even bigger problem in that logical AND and logical OR are incorrect. Which nwnnsscomp doesn't fix...
  8. I'm confident they can be, and I'm currently in the process of confirming that. What I believe will happen is that vanilla game files can be reversed perfectly, but anything that was compiled by nwnnsscomp will be altered from its original source. As DrMcoy said, the result, while syntactically different, should functionally be the same as the original source. For example, the source of k_contain_unlock from TSLRCM contains the following: string GetTreasureBundle (int nItemLevel, int nItemType = 0) { string sTemplate = ""; if (nItemType == 0) {} else { if((nItemType % 100) == 0) {} else if((nItemType % 10) == 0) {} else {} } return sTemplate; } But, the NCS file is written like this: string GetTreasureBundle (int nItemLevel, int nItemType = 0) { string sTemplate = ""; if () {} else if (){} else if() {} else {} return sTemplate; } The number of branches is the same across both, so the two forms should behave the same when executed by the game. If this proves to be true, then it won't matter if the reverse compiler produces the second form even if the first is the original. If I understand correctly, the original intent of the reverse compiler was to retrieve the sources for vanilla game scripts. Those are not compiled with nwnnsscomp. Which means the only files that are of concern are mods. I don't know what the policy is for reverse engineering mods, but I assume that's frowned upon?
  9. Happy Life Day!!! The Last Problem The Sub Awakens The Rise of Subwalker tl;dr The reverse compiler is on its way to being complete. I was honestly about to give up, but I'm glad I didn't!
  10. @Red Hessian I think it's k_inc_treas_k2, which is an include file for other scripts. For example, k_def_spn_t_jedi includes it and creates treasure on Jedi opponents when they spawn. (In theory, as I never confirmed.) If you look through k_inc_treas_k2 you can find which scripts call its subroutines and then confirm which enemies and quests call those scripts.
  11. Time for an update! Now that I've recovered from the nwnnsscomp-induced heart attack, I'm back to solving the last of the reverse compiler challenges. (When I complete the reverse compiler, I'll provide a detailed explanation of NCS, how NCS maps to NWScript, how the reverse compiler works, and why I'm so critical of nwnnsscomp.) The current problem I'm working on looks rather simple: RSADDx JSR JSR We see a reservation on the stack, followed by two subroutines. NCS rules for subroutines are as follows: Optionally, reserve one or more values on the stack Optionally, place subroutine arguments on the stack Call the subroutine You can see the disaster coming: it's those optional bits. In the example, the first subroutine might return a value. If so, that value is the argument of the second subroutine. But, RSADDx is also used to create uninitialized named variables in NWScript, for example: int i; //RSADDI float f; //RSADDF string s; //RSADDS You should never create uninitialized variables, but it was once a common practice. Numerous examples exist in NCS files, and that means the example code can also be read as an uninitialized variable, followed by two subroutines that do not take parameters and return void. In other words: Sub1(Sub0()); //vs int i; Sub0(); Sub1(); So, how do we figure this out? Unfortunately, we have to look inside each of the JSR calls. Which means yet another rewrite of my reverse compiler. It's not the worst thing in the world since the purpose of a reverse compiler is to reconstruct JSR calls. But more work must be done to determine dependencies, change the order in which things are analyzed, and store the resulting information for later use. I don't work this hard in my paying job...
  12. AmanoJyaku

    HD PFHB03

    The original head was one of the worst. This is such an improvement. Incredible, really!!!
  13. I use a wireless Xbox controller without any problems, not sure why yours doesn't work. What controller do you have? Additionally, I almost always kill 100% of the soldiers. I can do it with a controller or keyboard, so you just need to practice. I don't think you'll find a mod to alter the turret behavior as I believe it is hard-coded into the game engine. Meaning, someone would have to rewrite the game.
  14. I believe the point was that, if possible, you should uninstall your Steam mods and use the non-Steam versions. Mods that use TSL Patcher correctly do all the work for you, no need to muck around with the Registry. They also have better support here as the community is more familiar with using mods outside of Steam. And in case it's not clear, you can use the game that's installed from Steam. It's just the mods that you want to get outside of Steam.