-
Content Count
243 -
Joined
-
Last visited
-
Days Won
11
Content Type
Profiles
Forums
Blogs
Forum & Tracker Requests
Downloads
Gallery
Store
Calendar
Everything posted by AmanoJyaku
-
Exit the ship, then return. If she doesn't spawn, then you have to wait until you finish G0-T0's yacht. The boolean visas_arrives_conv being set to 1 just means Visas will become available at the next opportunity. The problem is that the game locks out events if you're in completing certain story events. It's terrible coding, IMO.
-
@verb8im If you can't leave, then it's not Visas. You may have encountered the bug that thinks you're still fighting the Red Eclipse. Use KoTOR Save Editor to open your saved game, navigate to the Global Numbers, and look for "003_IN_COMBAT". If it's set to 1, set it to 0 then load the game.
-
@verb8im I don't think it has anything to do with Visas, I ran into this problem before. Have you visited all areas of Nar Shaddaa, spoken with everyone with a name, completed their quests, and spoken with the Chadra-Fan named Kaalah-Nah outside of the Pazaak Den to confirm the Exchange loves or hates you? It's also possible you hit a bug, but it's likely just that you missed a trigger.
-
List of files modified in TSLRCM?
AmanoJyaku replied to AmanoJyaku's topic in General Kotor/TSL Modding
@JCarter426 The behavior was standard from the very first version of ANSI C in 1989. I named C99 since the standard draft may have been available when BioWare started NWN. The devs probably read "The C Programming Language" by Brian Kernighan and Dennis Ritchie. The book is clear for experience programmers, but a little ambiguous for novices. I think that's what happened. That, or someone was just sloppy. Ah, well. Fixing this is a problem for a later date. I need to finish the decompiler first! -
List of files modified in TSLRCM?
AmanoJyaku replied to AmanoJyaku's topic in General Kotor/TSL Modding
I don't want to promise anything as I'm testing various ways to reassemble control structures consistently. I am working with k_contain_unlock.ncs, which includes k_inc_treas_k2.nss. Currently, I can detect and reassemble: switch statements if statements if-else statements for loops while loops recursive functions I don't see do-while loops in K2 files, and only one file in K1 has it: k_inc_treasure.nss. I created this topic because of an issue I detected in the logic of sequence points. It doesn't conform to the C99 standard, yet I'm certain it should. I could fix this, but that would require altering every single script in the game. I don't want to, for obvious reasons. But, I may have to. Once I figure out a solution, my to-do list includes: do-while statements detection of vectors (I have a solution, I just haven't coded it yet) detection of structs continue statements break statements I think I know why DrMcCoy's decompiler fails on recursion, and I don't think DeNCS has the same issue since it was able to decompile k_contain_unlock.ncs. My decompiler takes a different approach than what DrMcCoy described, which is due to the fact that I never read DrMcCoy's notes until I had a working solution. 😜 -
List of files modified in TSLRCM?
AmanoJyaku replied to AmanoJyaku's topic in General Kotor/TSL Modding
@JCarter426 Thanks! The script k_contain_unlock.ncs is in scripts.bif. I don't know what the game does with BIFs, so I don't know if it ever calls that script directly. (Honestly, I never wanted to know how the game did anything. Damn you for asking for help, DrMcCoy! I haven't played this game in months because I've been coding this!!! 🤣) Edit: Also, k_inc_treas_k2 is an include. If it has been modified, then the files that depend on it are modified. For example, k_contain_unlock.ncs. So, maybe the bif is different in TSLRCM from the vanilla. On the subject of recursion, I don't see any reason why recursion should trip up decompilation. My code currently doesn't have a problem with them, not sure why DeNCS does... Then again, my code doesn't have a problem with globals initialized via functions, either. Yet another reason to replace DeNCS. -
List of files modified in TSLRCM?
AmanoJyaku replied to AmanoJyaku's topic in General Kotor/TSL Modding
I don't remember, it was back in March that I created a directory with every K1/K2/TSLRCM NCS file I've seen (over 2,400). I think it's from the vanilla BIF, but that's why I'm asking. DeNCS was able to decompile k_contain_unlock.ncs. But it threw the byte-code mismatch warning, which confirms there is something odd in the NCS. Believe it or not, that's worse than not being able to decompile at all! -
Is there a list of the files modified by TSLRCM? There are errors in the NCS files, and I'd like to know if these are errors in the vanilla code or TSLRCM. I already have TSLRCM installed and would like to avoid uninstalling and reinstalling to see what is vanilla and what is modified. For those who don't know, I'm working on an NCS decompiler. If these are errors in the vanilla code then I *may* ignore them and assume they work the way BioWare intended. (Even though it's wrong. I'll spare everyone the details since they only make sense to a programmer.) But if it's TSLRCM we may need an update, and I don't want to be the one to have to do it. 🤣 One file in particular is k_contain_unlock.ncs. I've found two separate errors: one misinterprets the type of the input data, the second is a logic error. Neither of these are game-breaking in this file, but they may produce unintended results if they are present in other files. On the positive side, I may be able to finish this by the end of September! 🎆🎉
-
More specifically, you can enter integers in multiple number systems: Binary - e.g. 0b10101010 (starts with 0b or 0B, valid digits are 0 and 1) Octal - e.g. 0252 (starts with 0, valid digits are 0-7) Decimal - e.g. 170 (starts with 1-9, valid digits are 0-9) Hexadecimal - e.g. 0xAA (starts with 0x or 0X, valid digits are 0-9,A-F,a-f) Remember, all values are 32-bit. Values are signed, with the exception of object types (they are unsigned pointers). I think DeNCS gave you hex output because that is the default value for the last parameter of void ExecuteScript(string sScript, object oTarget, int nScriptVar = -1).
-
That's the goal, yes. I only started this because @DrMcCoymade an appeal on another site I frequent, and I got swept up in the 15th anniversary of KOTOR modding euphoria. 😄 One potential challenge is that xoreos-tools' changelog states a need to update to C++11. My code is written in C++17; xoreos-tools may need a drastic overhaul before it can be integrated with my project. I'll have to use first to see what it does and determine how I might use it. DLLs are a pain to deal with, I try to avoid them whenever possible.
-
Welcome! It's great to meet a fellow victim programmer! I'm unfamiliar with NCSDIS, so I read a man page. As far as I can tell, it produces an assembly-like output, DOT output, stack information, and control structures? My binary does all of that, too. 🤣 Not sure how NCSDIS helps here or can be integrated, but I'm interested in looking at it to see what I might have missed. The documentation is accurate. It says the JSR instruction doesn't modify the stack. However, before you even get to the instruction description the section "Calling Subroutines and Engine Routines (ACTIONS)" states that "Invoking subroutines [Amano: that means JSR] or engine routines [Amano: that means ACTION] is done basically in the same manner. Arguments are placed on the stack in reverse order. The call is then made and the callee removes all the arguments from the stack prior to returning." So, somewhere inside the called function is where the arguments are popped. This makes sense given that NCS was patterned after machine code, and the most common calling convention at that time, stdcall, had the callee clean the stack. No worries, this is my thread to discuss the development of whatever this will be named. I'm not on Discord, but I will send you direct messages here if I run into any issues. You can also subscribe to this thread in case anyone else replies, particularly from DP, Salk, or DrMcCoy since they directly work with NCS files. 😊
-
@DrMcCoy It looks like some of the issues are due to the use of ncsdis for analysis. The binary I'm writing does its own analysis, so these issues might not affect me the same way. I did anticipate these problems, and that's what I'm working on now. I also think I know why ncsdis is failing, but I'll reserve my opinion for when I produce a working solution. 😁
-
@DarthParametric Thanks! This is an easy problem to solve. @DrMcCoy Thanks for letting me know, I'll reach out to them! It is written in C++, so that's done. Once I get a working binary I'll test it against all files in the K1, K2, K1R, and TSLRCM. If it passes, we can work on integration with Xoreos. Full disclosure: I am self-taught, so I cannot guarantee quality code. A few months ago I came across your site and passed on this because it was outside of my skill set!
-
Thanks, I was unaware of this. I've tested exclusively against K2 scripts, and will have to add K1 once I'm done. I assume the differences are visible in the nwscript.nss files? If so, I may not even need a toggle... That's what I'm working on now. The following is from the script "a_other_set.ncs": void main() { string sParam = GetScriptStringParameter(); int nParam = GetScriptParameter( 1 ); int nParam2 = GetScriptParameter( 2 ); int nTRUE; if ( nParam2 == -1 ) nTRUE = FALSE; else nTRUE = TRUE; SetLocalBoolean( GetObjectByTag(sParam),nParam,nTRUE ); } You may recognize the code; the byte code in my previous post is the line "int nParam2 = GetScriptParameter( 2 );". I can decompile from the beginning to "if ( nParam2 == -1 )", stopping at the branch. Simply put, "int nTRUE;" is just a declaration since there is other code between the declaration statement and assignment statement: //Note the lack of semicolons! //These expressions are not yet merged into statements!!! RSADDI [int nTRUE] CPTOPSP -8 4 [<copy nParam2 to top of stack>] CONSTI 1 [<place constant value 1 on top of stack>] NEGI [<negate value on top of stack, 1 becomes -1>] EQUALII [nParam2 == -1] JZ 32 [if (true)] The jump-if-zero is what prevents nTRUE from becoming a definition. From now on, any value assigned to nTRUE is just assignment. Branching isn't a problem. That reminds me, if I ever get around to writing the compiler I'll have to create a programming language. NWScript isn't fully documented enough to be usable. Which declarations are valid, and why? int i; int I; int 0; int i0; int I0; int _i; int _I; int _0; int _i0; int _I0;
-
It's been a while! I hope all is well. First, as you can tell I'm not dead. (But, I may be a zombie.) Most important, I am still working on the decompiler and have been since the last update! Back in May I was preparing a status update, but stopped because I didn't like the code. I couldn't say why, exactly. It worked, it was fast. But, for some reason I wasn't satisfied. So, I scrapped the code and started over. And I finally saw what the problem was: the original code wasn't written to be easily extended. Which was important, since it still needed features. (If I had to guess, I would say it was 5%-10% complete.) Since then, I've made significant progress: To do: Embedding NWScript function declarations into the binary Complete (Yes, all 877! No nwscript.nss needed!!!) Identifying simple expressions (e.g. addition, assignment, bitwise operations, and function calls) Complete Fixed handling of STORE_STATE op code Identifying statements Declarations Complete Assignment Complete Iteration, selection and jump statements Still working Operator associativity and precedence This is irrelevant at the byte code level Type conversions This does not appear to exist in NWScript Byte code conversion to source code Still working Source code conversion to byte code Not started GUI Not started Analysis of NCS file bugs Still working Given what I've learned over the last few months, I would say progress is now 30%. Here's an example of what the decompiler currently does: 02 03 [RSADDI, create a named variable of type int on the stack] 04 03 00000002 [CONSTI, Place a constant (i.e. temporary) value of type int onto the stack] 05 00 0300 01 [Action, Call the function 0x300, popping 1 argument off the stack] 01 01 FFFFFFF8 0004 [CPDOWNSP, Copy the result from the top of the stack to an existing variable] This series of four operations is represented by the following psuedo-NWScript: 02 03 int I0; 04 03 00000002 2; 05 00 0300 01 int GetScriptParameter(int nIndex); [Function 0x300 (768) returns an int onto the top of the stack!!!] 01 01 FFFFFFF8 0004 <some variable -8 bytes from the top of the stack> = <value at top of stack>; Continued evaluation: int I0; I0 = GetScriptParameter(2); We have a variable declaration, and then assignment of the function result to the declared variable. In C terminology, that's a variable definition: int I0 = GetScriptParameter(2); Some of the steps are omitted, but we see the following: Some NCS op codes translate directly to NWScript statements (e.g. RSADDx results in a named variable) Some NCS op codes translate directly to expressions (e.g. CONSTx places a constant, or literal, into the script, ADDxx places addition into the script) Multiple NCS op codes will need to be combined to make complex NWScript statements, as in the example above At the moment, I have partially decompiled scripts. And, the binary does not choke on global variables initialized by functions the way DeNCS does! @Salk and @DarthParametric should be happy, since this means the swoop race scripts from Manaan and Tatooine can finally be decompiled! I'm also tallying errors I've found in scripts. Here's one in pseudo-code: string S1 = "Blah"; string S2 = "Meh"; object(S1) == object(S2); NWScript does not have casts! Casts added to illustrate the problem! What's wrong with this? NWScript is based on C, and C is a strongly-typed language. This means an entity of type string is different from an entity of type object! So, when NWScript is told to test for equality, it needs to compare the entities using their type information. That means strings should be compared byte by byte, up to the length of the shortest string. But, we told NWScript that S1 and S2 are object types, which are pointers! The pointers are compared, but not the strings to which they point! Thus, they will likely never test correctly even when the strings have the same contents! This is a real bug I found, and while I don't think it breaks the script I found it in, it could explain weird issues I've had with the game over the years. (I once tried to leave Peragus, only to find the Ebon Hawk surrounded by 30-40 robots. There're supposed to be two or three!!!) That's all for now. Hopefully, I'll have more progress by next week.
-
I don't have a problem with it. Gamorreans are supposed to be formidable fighters, and it can be assumed that a leader of the GenoHaradan would be one of the stronger ones. Besides, maybe he used mines like we did.
-
@JediArchivist Like @Effix said, check the VDF to see if "PublishFileId" is present. If the value is "2075761409" and it's failing, then change it to "0" or remove the line entirely.
- 26 replies
-
- 1
-
- steam workshop
- mods
-
(and 1 more)
Tagged with:
-
Yes, try that. Also, you may need to wait. During my testing a few days ago I uploaded the VDF, but it failed because I deliberately didn't put any content in. Today, I logged into https://steamcommunity.com and saw a workshop item for the first time! So, even if it fails, if you get a PublishFileId (which I got despite the failure) then you have an item in the Workshop! You will find your mod at "Workshop Items" to the bottom-right. The direct link is https://steamcommunity.com/id/<custom_id>/myworkshopfiles/, where <custom_id> is your custom URL ID. Custom URL IDs are set in the "Edit Profile" section. The direct link to your mod should be at https://steamcommunity.com/sharedfiles/filedetails/?id=2075761409
- 26 replies
-
- 1
-
- steam workshop
- mods
-
(and 1 more)
Tagged with:
-
@JediArchivist I don't believe there is moderation unless people complain about ToS violations. Setting "visibility" to "0" makes it visible to everyone. It's also a different field than the one you see in your screenshot. Yes, there are two visibility properties. Very weird. If you need to activate Steam Guard you will get an email with a Steam Guard code automatically. Various theories range from having to accept EULAs in the Steam website, to having to put $5 into your Steam Account (Steam says this limits fake mods).
- 26 replies
-
- 1
-
- steam workshop
- mods
-
(and 1 more)
Tagged with:
-
@JediArchivist Well, whatever it is, it's not the contents of the script. I just made a VDF and saved in the directory structure you created. It gives me a workshop item ID and everything. Steam>login hodgel Logging in user 'hodgel' to Steam Public ... Logged in OK Waiting for user info...OK Steam>workshop_build_item C:\Mods\VDF\MiraRomance.vdf Create new workshop item ( PublishFileID 2075413754). Preparing update... Preparing content...ERROR! Failed to update workshop item (Failure). The error is because I never created any of the mod's files. But, I was able to replicate your error: Steam>workshop_build_item C:\Mods\VDF\MiraRomancw.vdf ERROR! Failed to load build config file "C:\Mods\VDF\MiraRomancw.vdf". So... you have a problem with the path. Check the file name properties. Since you created it in Notepad, you may have saved it as a text file due to the way Notepad works. The filename may be "MiraRomance.vdf.txt"
- 26 replies
-
- 1
-
- steam workshop
- mods
-
(and 1 more)
Tagged with:
-
@Effix According to Steam's documentation, "publishedfileid" "0" tells Steam to create a new Workshop mod. After creation, "publishedfileid" in the VFD is modified with whatever value Steam gives your mod. Updates to the mod then use the modified "publishedfileid" value in order to find the mod to update. The documentation does say that "publishedfileid" can be left "unset" to create the mod, but I'm unclear as to what that means. For example, leave out "publishedfileid" entirely, or just write "publishedfileid" without a corresponding value? It can't hurt to try the full syntax, especially since everything else looks ok. @JediArchivist I would ensure this is being run with administrator rights since it modifies the VDF file. I would also check stderr.txt to see if it gives more information on the error.
- 26 replies
-
- 1
-
- steam workshop
- mods
-
(and 1 more)
Tagged with:
-
@JediArchivist I think you're missing a field. Try adding "publishedfileid" "0", e.g. "workshopitem" { "appid" "208580" "publishedfileid" "0" "contentfolder" "C:\\Mods\\Mira Romance 2.0" "previewfile" "C:\\Mods\\Previews\\1.jpg" "visibility" "0" "title" "Mira Romance Mod 2.0" "description" "This Mod enables the Male Exile to romance Mira! It adds new conversation lines, a new movie, and a new outfit for Mira" "changenote" "Version 2.0.0" }
- 26 replies
-
- 1
-
- steam workshop
- mods
-
(and 1 more)
Tagged with:
-
[Help!] KOTORBlender Can't Select .mdl File
AmanoJyaku replied to uwadmin12's topic in General Kotor/TSL Modding
It says you can't use KotorBlender while NeverBlender is enabled. Did you disable or remove NeverBlender? -
[K1] Modding Sneak Attack to apply on Range
AmanoJyaku replied to Skurrio's topic in General Kotor/TSL Modding
The Feats and Content Mod was implemented using scripts. So, same problem I outlined above.