trustnoone 0 Posted Saturday at 04:40 PM Hi all, hope its okay to post it here as I think Jade Empire is set up similar to KOTOR? In terms of modding? I want to make a mod to update the romance option you have set. I saw from another mod that someone used the "SetGlobalBoolean" value, so I'm trying to learn too. I have a nss file and my code is simple, just: void main(){ SetGlobalBoolean("J00_SILKFOX_ROMANCE", TRUE); } But it doesn't seem to work, I compile it to a .ncs file, and I just name it something generic and unique like SFRomance.ncs but it doesn't seem to change anything? As far as I understand, this should be a variable available? And I guess it comes from the Globas.2da (though I don't think I see it in there) https://jadeempire-modding.fandom.com/wiki/Globals.2da Thanks! I've also tried using "J00_SILKFOX_ROMANCE_DONE" Quote Share this post Link to post Share on other sites
OzilsEyes 32 Posted Saturday at 07:34 PM 2 hours ago, trustnoone said: Hi all, hope its okay to post it here as I think Jade Empire is set up similar to KOTOR? In terms of modding? I want to make a mod to update the romance option you have set. I saw from another mod that someone used the "SetGlobalBoolean" value, so I'm trying to learn too. I have a nss file and my code is simple, just: void main(){ SetGlobalBoolean("J00_SILKFOX_ROMANCE", TRUE); } But it doesn't seem to work, I compile it to a .ncs file, and I just name it something generic and unique like SFRomance.ncs but it doesn't seem to change anything? As far as I understand, this should be a variable available? And I guess it comes from the Globas.2da (though I don't think I see it in there) https://jadeempire-modding.fandom.com/wiki/Globals.2da Thanks! I've also tried using "J00_SILKFOX_ROMANCE_DONE" Hello, You're quite right it will be in globals.2da, what are you using to execute the script you're making? Is it through dialogue, a trigger, other? 1 Quote Share this post Link to post Share on other sites
trustnoone 0 Posted Sunday at 12:17 AM 4 hours ago, OzilsEyes said: Hello, You're quite right it will be in globals.2da, what are you using to execute the script you're making? Is it through dialogue, a trigger, other? Cheers for the reply mate , I didn't know you had to execute the script some how. I guess because I'm just setting the global variable I just want it to be set anywhere haha, as my save state is just before the end part of the game maybe around there. Is there a simple way to trigger it? Or will I have to try to get it triggered through another way? initial research looks like I have to maybe find a dlg around that area and maybe use the kgff editor? Is that the right track? Thanks! Quote Share this post Link to post Share on other sites
DarthParametric 3,790 Posted Sunday at 03:25 AM Easiest way is probably just to attach it to a dialogue. 1 Quote Share this post Link to post Share on other sites
trustnoone 0 Posted Sunday at 06:01 AM 2 hours ago, DarthParametric said: Easiest way is probably just to attach it to a dialogue. Thank you! I feel like I'm getting close. I found the exact string I need using "TalkEd" I want to set it at sound reference: 189216 or Entry Text 125244 I've got JE DLGEditor working, but having trouble obtaining the dlg file to that I can add the script. I tried searching for the entry text / sound reference in "JEFindRes" but I don't see it. Would you know how best I can search for the dlg that has the above? Then I can inject the script. Quote Share this post Link to post Share on other sites
DarthParametric 3,790 Posted Sunday at 06:12 AM Just edit any DLG that you can quickly access in-game. One of the companion DLGs would be the easiest. I haven't looked at JE's file structure for years, so I couldn't tell you where to look. The easiest solution would be to just find a mod that already edits one of those DLGs and steal it as a basis. You only need to keep it long enough to execute your script once. 1 Quote Share this post Link to post Share on other sites
OzilsEyes 32 Posted Sunday at 10:27 AM 9 hours ago, trustnoone said: Cheers for the reply mate , I didn't know you had to execute the script some how. I guess because I'm just setting the global variable I just want it to be set anywhere haha, as my save state is just before the end part of the game maybe around there. Is there a simple way to trigger it? Or will I have to try to get it triggered through another way? initial research looks like I have to maybe find a dlg around that area and maybe use the kgff editor? Is that the right track? Thanks! I’m not 100% how Jade Empire works but with kotor we have a few ways a script can be executed. These include dialogue (as DarthParametric advised), triggers that the player can walk into, actions with objects/npcs such as on death, on spawn etc. I suppose it makes sense to know exactly *how* & *when* you want it to execute, do you just want it to be something that executes randomly after an event or during a specific event? 1 Quote Share this post Link to post Share on other sites
trustnoone 0 Posted Sunday at 11:30 AM Awesome! Thanks both, I feel I'm super close now. I found the "JadeDlg.exe" which helped me find all the dlg files, and I think I found one just before the part I need. I extracted it with "JE ERF RIM Editor v0.3.6a" and I opened the dialog file in "jedlgeditor" (there are sooooo many apps haha). I added the following script: void main(){ SetGlobalBoolean("J00_SILKFOX_ROMANCE", TRUE); SetGlobalBoolean("J00_SILKFOX_ROMANCE_DONE", TRUE); } titled "SFRom" for both the nss/ncs files. I copied all three into the override. But it doesn't seem to change my romance. I wonder if the issue is I need to change it and then reload? I included an image of the change of the dlg file below. Thanks again all, I'll be honest, I didn't know people were still helping people learn modding. So its so cool getting help. Cheers! 1 hour ago, OzilsEyes said: do you just want it to be something that executes randomly after an event or during a specific event? Thanks mate, I'm trying to force the relationship status on Jade Empire, as they do this odd thing where they place straight relationships over gay/lesbian even if your further along in the lesbian relationship. I'm up to the part where you find out which you got and I can see I missed it. So was hoping to enforce it myself (this is me just refusing to accept what I got). But I also think it would be awesome to have it available for others for other options as I feel Jade Empire doesn't make it as straight forward as KOTOR Spoiler Then again I always choose the Bastilla romance on KOTOR because <33333 ahhh Quote Share this post Link to post Share on other sites
DarthParametric 3,790 Posted Sunday at 11:37 AM You only need to add it in the Script field. That will automatically execute it when the line plays. You can try adding some debug feedback. I'm not sure if JE still has all the same script functions. Does it even have a combat log? Been a while since I played. Anyway, try adding the following to the script: SendMessageToPC(GetFirstPC(), "SCRIPT FIRING"); 1 Quote Share this post Link to post Share on other sites
OzilsEyes 32 Posted Sunday at 06:35 PM 6 hours ago, trustnoone said: I added the following script: void main(){ SetGlobalBoolean("J00_SILKFOX_ROMANCE", TRUE); SetGlobalBoolean("J00_SILKFOX_ROMANCE_DONE", TRUE); } Is there a difference between the two globals? / Are both required (Are they both created by you)? 6 hours ago, trustnoone said: Thanks again all, I'll be honest, I didn't know people were still helping people learn modding. So its so cool getting help. Cheers! This is what is wrong with the modern community, it's a free-for-all or some 'old timers' don't want to make room for fresh blood! That's how a community dies eventually. Had my fair share over the years on other forums but I ran into one when I started with Kotor modding unfortunately, although I couldn't care less & I just do my own thing 😅. 6 hours ago, trustnoone said: I added the following script: titled "SFRom" for both the nss/ncs files. I copied all three into the override. But it doesn't seem to change my romance. I wonder if the issue is I need to change it and then reload? I included an image of the change of the dlg file below. I'm assuming the .dlg file & .ncs files are the ones you copied to override right (You don't need to .nss)? You will need to reload the game after doing that so the game loads the new files in your override folder, then find the npc/object that starts that dialogue & it should execute the script. As DP said, it would be worth also adding some sort of debugging to see if the script is actually being executed. I'm not familiar with Jade Empire, it's not something I've ever played before so can't help on that front! 1 Quote Share this post Link to post Share on other sites
trustnoone 0 Posted yesterday at 08:56 AM Thanks both, I think I'm super close, I found another place of someone asking the same thing in 2007 haha, https://forums.mixnmojo.com/topic/160582-jade-empire-modding-see-first-post-for-info-summary/page/6/ And they use a similar script: void main() { SetGlobalBoolean("J00_SILKFOX_ROMANCE_DONE", FALSE); SetGlobalBoolean("J00_SILKFOX_ROMANCE", TRUE); SetGlobalBoolean("J00_SKY_ROMANCE", FALSE); } So I'm totally in the right trackk! haha. Guessing the _DONE is used for after. I've removed the enemy script from another part of the dlg file above, and the enemy doesn't appear. So I think the dlg is indeed overwriting, but the script must maybe not be firing? Unfortunately I tried SendMessageToPC(GetFirstPC(), "SCRIPT FIRING"); There isn't a combat section but there is a dialog section, but don't see much. and also tried destroying myself but didn't see anything come up: DelayCommand(2.5, DestroyObject(GetFirstPC(), 0.0, TRUE, 0.0)); With the script do I need the .ncs at the end when referencing it? Does the script have to already exist? As I just created a new one, I didn't like write over another script or similar? I feel like its the script itself that maybe isn't firing? SFRom.ncs SFRom.nss j00_wdragon_c7.dlg Quote Share this post Link to post Share on other sites
DarthParametric 3,790 Posted yesterday at 10:04 AM 1 hour ago, trustnoone said: With the script do I need the .ncs at the end when referencing it? No, you don't use an extension, just the base script name. 1 hour ago, trustnoone said: There isn't a combat section but there is a dialog section, but don't see much. Seems like that function was cut, along with a bunch of others. You can check nwscript.nss in the Override folder to see the available functions. It's what your script is compiled against. There are some functions that would display floaty text: void DisplayFloatyFeedback(object oObject, int nStrref); void ShowHint(int nMessageStrRef, float fDurationInSeconds); void ShowDialogBox(int nMessageStrRef, int nShowCancel, string sOkScript, string sCancelScript); But they requires a StrRef (i.e. a string in dialog.tlk) which is kind of a pain in the ass. There are also the various debug Print functions for outputting to a log file, but just like KOTOR they presumably won't work in the release version. Talking about cut functions, it seems GetPlayer() is the replacement for GetFirstPC(). One thing you could do to determine if the script is working is have the player do an animation, or apply some VFX. You could also use this as a sort of half-assed alternative to a log file. Do some checks of the global states after you have changed them and play various animations based on whether they return the value you want or not. But even random StrRefs from the TLK would work as well I guess if you want to use DisplayFloatyFeedback. Choose StrRef 375 for a laugh. 1 Quote Share this post Link to post Share on other sites
trustnoone 0 Posted yesterday at 12:06 PM AHHHHHHHHHH OMG IT WORKKKKSSS AHHHHHHHH You are both amazing, Thank you, thank you, thank you!!! Your comment: 1 hour ago, DarthParametric said: You can check nwscript.nss in the Override folder to see the available functions. It's what your script is compiled against. Was what I was missing, i didn't realise they were different, so i was compiling against the KOTOR II nwscript.nss as it was already packaged in the application (and was running) (I did have to comment out two functions in nwscript.nss that were giving the compiler some issues). I didn't know about this file and was wondering whether people were just figuring it out based on decompiled OP Codes lol. Ahhhhhh I can't believe its working. I got the flag to trigger and the character wants to romance now. I think I spent more time on this romance then any IRL but at the same time payoff is huge haha! Thank you! I don't know if anyone ever stumbles here, but attaching the files, and trigger is in the dialogue after the most recent auto-save that Jade Empire does before this point. So just reload to that one (its before the demons appear). SFRom.ncs SFRom.nss j00_wdragon_c7.dlg 2 hours ago, DarthParametric said: Choose StrRef 375 for a laugh. LMAO I used TalkEd to look up the String Ref, absolutely hilarious!!! Quote Share this post Link to post Share on other sites
DarthParametric 3,790 Posted yesterday at 12:17 PM 11 minutes ago, trustnoone said: I think I spent more time on this romance then any IRL And after all that you didn't go for the threesome? 1 Quote Share this post Link to post Share on other sites