DarthVarkor 384 Posted March 10, 2019 If I wanted to trigger, say, a thermal detonator explosion at a specific location (which I have the coordinates for). What is the line I'd need to write in the script? The coordinates are: 4.51, 48.57, 14.57. Thanks! Quote Share this post Link to post Share on other sites
DarthParametric 3,777 Posted March 11, 2019 You can either create a waypoint or use the co-ords directly, whichever takes your fancy. To do the latter: location lBlastPoint = Location(Vector(4.51,48.57,14.57), 0.0); Then you'd apply the effect with something like: effect eExplode = EffectVisualEffect(VFX_FNF_GRENADE_THERMAL_DETONATOR); ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eExplode, lBlastPoint); You should look at the Calo Nord cutscene in Javyar's Cantina (TAR_M03AE). It's quite instructive for this sort of thing. In that scene they also have Calo doing a throw animation and spawn a grenade model on the ground. 1 Quote Share this post Link to post Share on other sites
DarthVarkor 384 Posted March 11, 2019 Brilliant, thanks for that, DP. Works like a treat. 4 hours ago, DarthParametric said: You should look at the Calo Nord cutscene in Javyar's Cantina (TAR_M03AE). It's quite instructive for this sort of thing. In that scene they also have Calo doing a throw animation and spawn a grenade model on the ground. That's a good idea I didn't think of that. How do I de-compile the scripts to read them? In KOTOR Tool: RIMS - Tar_M03aE, the scripts are already compiled. Quote Share this post Link to post Share on other sites
DarthParametric 3,777 Posted March 11, 2019 You'll want to use DeNCS (requires Java) - https://web.archive.org/web/20180820120330/http://www.starwarsknights.com/mtools/DeNCS.zip You'll need to supply it with a copy of nwscript.nss in the same folder in order for it to work. I would suggest making two folders with separate copies of DeNCS, and have the nwscript.nss for K1 in one, TSL in the other. I have come across the occasional script in K1 that won't decompile when using TSL's nwscript.nss. If you want to follow along with that cutscene specifically, I'd recommend starting with tar03_calo031.dlg as there are multiple different scripts used for the various shots. Btw, if you want different VFX you can browse through nwscript.nss to see what constant is required for the one you want. 1 Quote Share this post Link to post Share on other sites
DarthVarkor 384 Posted March 11, 2019 3 hours ago, DarthParametric said: You'll want to use DeNCS (requires Java) - https://web.archive.org/web/20180820120330/http://www.starwarsknights.com/mtools/DeNCS.zip You'll need to supply it with a copy of nwscript.nss in the same folder in order for it to work. I would suggest making two folders with separate copies of DeNCS, and have the nwscript.nss for K1 in one, TSL in the other. I have come across the occasional script in K1 that won't decompile when using TSL's nwscript.nss. If you want to follow along with that cutscene specifically, I'd recommend starting with tar03_calo031.dlg as there are multiple different scripts used for the various shots. Btw, if you want different VFX you can browse through nwscript.nss to see what constant is required for the one you want. EDIT: My mistake. So, when I open the ncs file in DeNCS, this is all that happens: Quote Share this post Link to post Share on other sites
DarthParametric 3,777 Posted March 11, 2019 Ah, I thought it included it. Grab it here and copy the exe to the same folder as DeNCS.jar (ignore the included nwscript.nss and use the game-specific versions I mentioned before) - https://web.archive.org/web/20180820120330/http://www.starwarsknights.com/mtools/nwnnsscomp_st.zip Quote Share this post Link to post Share on other sites
DarthVarkor 384 Posted March 11, 2019 2 minutes ago, DarthParametric said: Ah, I thought it included it. Grab it here and copy the exe to the same folder as DeNCS.jar (ignore the included nwscript.nss and use the game-specific versions I mentioned before) - https://web.archive.org/web/20180820120330/http://www.starwarsknights.com/mtools/nwnnsscomp_st.zip Yeah turns out I already had the nwnnsscomp.exe on my PC. Think it came with Fair Stride's KOTOR Toolset. As I edited above, the issue I'm now facing is DeNCS doesn't seem to be de-compiling the ncs script. Quote Share this post Link to post Share on other sites
djh269 264 Posted March 11, 2019 You need either K1 or TSLs nwscript.nss file within the DENCS folder. 1 Quote Share this post Link to post Share on other sites
DarthParametric 3,777 Posted March 11, 2019 It has decompiled it, it is just warning you that its interpretation doesn't match 100% with the original. Generally you can ignore that. You can right click on it and have it show the decompiled code, or just close that tab and say yes when it asks if you want to save it as an NSS. 1 Quote Share this post Link to post Share on other sites
DarthVarkor 384 Posted March 11, 2019 1 minute ago, DarthParametric said: It has decompiled it, it is just warning you that its interpretation doesn't match 100% with the original. Generally you can ignore that. You can right click on it and have it show the decompiled code, or just close that tab and say yes when it asks if you want to save it as an NSS. Ah, gotcha. Funnily enough I literally just opened another ncs script in it and it works perfectly. Thanks for your help! Quote Share this post Link to post Share on other sites
DarthParametric 3,777 Posted March 11, 2019 When it actually fails to decompile, the only thing you'll see is a message in the status window down the bottom. 1 Quote Share this post Link to post Share on other sites
DarthVarkor 384 Posted March 11, 2019 4 minutes ago, DarthParametric said: When it actually fails to decompile, the only thing you'll see is a message in the status window down the bottom. Yeah, interestingly I opened another ncs just to play around and got the error, but I noticed right next to all the lines random numbers from the ncs was the actual script; "AssignCommand", etc. @DarthParametric Sorry, one last question. Going back to my original question on triggering an explosion, I assume you can add a delay to the explosion? I thought it would be: DelayCommand(3.0 ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eExplode, lBlastPoint); -- but that gives me an error when compiling. Quote Share this post Link to post Share on other sites
DarthParametric 3,777 Posted March 11, 2019 That's the byte code - what the actual compiled script looks like to the engine. You can have nwnnsscomp output it I believe (or at least it's an option for scripts that can't be decompiled), and ncsdis from Xoreos Tools will also convert all scripts into byte code. For scripts that can't be decompiled, you can often figure out what it is doing from the byte code and, depending on the complexity, try and recreate it manually. 1 Quote Share this post Link to post Share on other sites
A Future Pilot 161 Posted March 11, 2019 2 hours ago, DarthVarkor said: Yeah, interestingly I opened another ncs just to play around and got the error, but I noticed right next to all the lines random numbers from the ncs was the actual script; "AssignCommand", etc. @DarthParametric Sorry, one last question. Going back to my original question on triggering an explosion, I assume you can add a delay to the explosion? I thought it would be: DelayCommand(3.0 ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eExplode, lBlastPoint); -- but that gives me an error when compiling. You're missing a comma and a parenthesis. It should be DelayCommand(3.0, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eExplode, lBlastPoint)); 1 Quote Share this post Link to post Share on other sites
DarthVarkor 384 Posted March 11, 2019 43 minutes ago, A Future Pilot said: You're missing a comma and a parenthesis. It should be DelayCommand(3.0, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eExplode, lBlastPoint)); Yeah, just spoke to DP on Discord and he showed me where I went wrong - thanks! Quote Share this post Link to post Share on other sites