Qui-Gon Glenn Posted January 29, 2012 Share Posted January 29, 2012 Tis the first thought off the top of my head.... You may be unintentionally overriding an actual game script named "k_ptat18aa_enter02.ncs". Perhaps rename it "kr_tat_18aa_enter.ncs" and of course change the ExecuteScript reference to this. Notice I ditched two chars to match the original filename length. "kr" reminds us who wrote the script, and it doesn't hurt us losing a "p" from "ptat". With the added "02" is too long for the game to read, so it may be ignoring the script altogether. Link to comment Share on other sites More sharing options...
Ӄhrizby Posted January 30, 2012 Author Share Posted January 30, 2012 Thanks for the reply, I tried but no results, but I was thinking and checked the Gate Guard Billan's dialogue to make sure those are the scripts. The script that's fired is actually "k_ptat_dunesea", and I believe that fires "k_ptat18aa" cause I did something and got an endless loop of loading two areas one after another. Oh well, now that I know what the problem is I'll work on it, thanks! Edit: Okay nevermind, that did nothing! Lol I still do need to modify "k_ptat18aa" I think, the dunesea one only launches the new module so I can't do much to it, but could it be part of the problem? Idk much about this subject.. More Edit: Ah it's not even my scripting at all! I deleted the script to see what happened and the problem still persisted, so I deleted my "m18aa.git" and it fixed it! But that should only add a new door.. Link to comment Share on other sites More sharing options...
Qui-Gon Glenn Posted January 30, 2012 Share Posted January 30, 2012 I am going to look at the m18aa.are after typing this.... That will tell you what the correct OnEnter script is for said module. Expect an edit shortly EDIT1: "k_ptat18aa_enter" - that is the script. Very curious, indeed. I will see what DeNCS can do with the script.... look for edit #2 EDIT2: DeNCS blinked, choked, and ran away. I didn't even get a partial. Looking at the hex on it, it seems to be a fairly good-sized OnEnter spawning all the wraids, as well as having conditionals for speeder bikes and Genoharadan... It is the script that should be fired via "script injection" and I do not know why it is failing... Gate Guard Billan's .dlg should only really be setting a global. Do you mind a whole bunch posting your code? Or a portion? I wonder if your script is so big and busy that it is interfering somehow... I have had this issue modifying the Endar Spire. My guess is, somehow, the ExecuteScript is getting ignored and this results in the "reset" of the module. Link to comment Share on other sites More sharing options...
Ӄhrizby Posted February 1, 2012 Author Share Posted February 1, 2012 I am going to look at the m18aa.are after typing this.... That will tell you what the correct OnEnter script is for said module. Expect an edit shortly Thanks EDIT1: "k_ptat18aa_enter" - that is the script. Very curious, indeed. I will see what DeNCS can do with the script.... look for edit #2 EDIT2: DeNCS blinked, choked, and ran away. I didn't even get a partial. Looking at the hex on it, it seems to be a fairly good-sized OnEnter spawning all the wraids, as well as having conditionals for speeder bikes and Genoharadan... It is the script that should be fired via "script injection" and I do not know why it is failing... Gate Guard Billan's .dlg should only really be setting a global. Do you mind a whole bunch posting your code? Or a portion? I wonder if your script is so big and busy that it is interfering somehow... I have had this issue modifying the Endar Spire. My guess is, somehow, the ExecuteScript is getting ignored and this results in the "reset" of the module. Yes, that is curious. I, having never used DeNCS, got it and tried also, but same result. I'd imagine it would be big, but something's happening for it to still run in 'first time' state, idk how that works.. I wonder what the dunesea.ncs does? Alright, here it is. It is a decent size but not huge, and probably not well written lol. Show spoiler (hidden content - requires Javascript to show) void main() { ExecuteScript("kr_tat18aa_enter", OBJECT_SELF); object oEnter = GetEnteringObject(); object oPC=GetFirstPC(); if (GetIsPC(oEnter)) { if (!GetIsObjectValid(GetObjectByTag("plc_shack"))) { object oHuttsHut = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_shack", Location(Vector(85.79, 392.30, 37.07), -135.0)); object oHoloTerm = CreateObject(OBJECT_TYPE_PLACEABLE, "holoterm", Location(Vector(82.51, 389.03, 37.25), -135.0)); object oLocker = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_musiclocker", Location(Vector(85.35, 394.12, 37.12), -70.0)); { if (GetJournalEntry("jawahutt") == 1) { SetGlobalBoolean("Music", FALSE); SetGlobalBoolean("Dance", TRUE); SetGlobalNumber("Holo", 1); object oHoloHutt = CreateObject(OBJECT_TYPE_CREATURE, "HoloHutt", Location(Vector(80.80, 384.12, 37.26), 180.0)); object oJawaHutt = CreateObject(OBJECT_TYPE_CREATURE, "JawaHutt", Location(Vector(83.90, 390.48, 37.17), -135.0)); if (!GetIsObjectValid(GetItemPossessedBy(GetFirstPC(),"holokey"))) object oGuard = CreateObject(OBJECT_TYPE_CREATURE, "jawaguard2", Location(Vector(88.81, 395.15, 36.98), 0.0)); }}} } } I don't think it's too big actually cause I tried it with only the executescript command, nothing else, and it still did the same thing. Maybe it's delaying something that should happen instantly? Do you think there's a better way to initiate the script? I was thinking the trigger that sets off Marlena's conversation could be used to fire the script, as it's just through the gates, and avoid the onenter altogether.. Link to comment Share on other sites More sharing options...
Qui-Gon Glenn Posted February 1, 2012 Share Posted February 1, 2012 I think that, on first reflection, it is that your ExecuteScript will fire every time because it is not the result of your conditional. It should be a consequence of GetIsPC(oEnter). This does not explain everything, but I would start there. EDIT: Try this... it compiles, although I am not sure if it will do as you intend, but it is worth a shot void main() { object oEnter = GetEnteringObject(); object oPC = GetFirstPC(); if (GetIsPC(oEnter)) { if (!GetIsObjectValid(GetObjectByTag("plc_shack"))) { object oHuttsHut = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_shack", Location(Vector(85.79, 392.30, 37.07), -135.0)); object oHoloTerm = CreateObject(OBJECT_TYPE_PLACEABLE, "holoterm", Location(Vector(82.51, 389.03, 37.25), -135.0)); object oLocker = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_musiclocker", Location(Vector(85.35, 394.12, 37.12), -70.0)); [color=darkorange]// ExecuteScript("kr_tat18aa_enter", OBJECT_SELF); <-- Let's try option 2 first, actually [/color] } if (GetJournalEntry("jawahutt") == 1) { SetGlobalBoolean("Music", FALSE); SetGlobalBoolean("Dance", TRUE); SetGlobalNumber("Holo", 1); object oHoloHutt = CreateObject(OBJECT_TYPE_CREATURE, "HoloHutt", Location(Vector(80.80, 384.12, 37.26), 180.0)); object oJawaHutt = CreateObject(OBJECT_TYPE_CREATURE, "JawaHutt", Location(Vector(83.90, 390.48, 37.17), -135.0)); if (!GetIsObjectValid(GetItemPossessedBy(GetFirstPC() ,"holokey"))) { object oGuard = CreateObject(OBJECT_TYPE_CREATURE, "jawaguard2", Location(Vector(88.81, 395.15, 36.98), 0.0)); } } [color=darkorange]ExecuteScript("kr_tat18aa_enter", OBJECT_SELF); //ExecuteScript may need to be here instead, as it seems the script should fire every time[/color] } } What this should do is make the original OnEnter fires only the first time you enter the module, which is as it should be, I think. If the container is not there, it will be spawned and the original OnEnter will fire. The next time you enter the module, the container is there, so the original OnEnter should no longer fire. Hopefully though, this will not have undesired consequences? I may be moving the execute script to the wrong portion of the code... Link to comment Share on other sites More sharing options...
Ӄhrizby Posted February 1, 2012 Author Share Posted February 1, 2012 You know I never even though about that, in retrospect if everything else has to be after the conditional it makes sense. Oh okay, so is the OnEnter only actually meant to fire once, then if you reenter it does something else? That would probably explain the problem, I'll try it out later tonight (I'm at school right now), but thanks for the code! Link to comment Share on other sites More sharing options...
Qui-Gon Glenn Posted February 1, 2012 Share Posted February 1, 2012 Oh okay' date=' so is the OnEnter only actually meant to fire once, then if you reenter it does something else? That would probably explain the problem, I'll try it out later tonight (I'm at school right now), but thanks for the code! [/quote']No, it should fire every time, I would think... so I think ultimately the placement in orange is the one that should work best. I will see if VP can come over here and take a look-see EDIT: I edited the code, try compiling the current structure. EDIT2: Actually, just throw this into override if you like... of course, you will have to rename it! EDIT3: Well, of course, VP added a lil knowledge to the party! I did not add that line, you may (actually probably do) want to! kriz.7z Link to comment Share on other sites More sharing options...
VarsityPuppet Posted February 1, 2012 Share Posted February 1, 2012 OnEnter fires every time the module is loaded for every character that enters the module. Characters 'enter' the module when you, the player, load it for the first time. I think... I'm pretty sure anyways... That being the case, this is why you're using that GetEnteringObject() statement. I think that'd be the correct placement for ExecuteScript() though.. The only thing I would recommend at the moment is adding the code I highlighted in green. This is to stop the onEnter from firing when reloading from a saved game. Show spoiler (hidden content - requires Javascript to show) void main() { object oEnter = GetEnteringObject(); object oPC = GetFirstPC(); if (GetIsPC(oEnter)) { [color="Lime"] if (GetLoadFromSaveGame()) { return; }[/color] if (!GetIsObjectValid(GetObjectByTag("plc_shack"))) { object oHuttsHut = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_shack", Location(Vector(85.79, 392.30, 37.07), -135.0)); object oHoloTerm = CreateObject(OBJECT_TYPE_PLACEABLE, "holoterm", Location(Vector(82.51, 389.03, 37.25), -135.0)); object oLocker = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_musiclocker", Location(Vector(85.35, 394.12, 37.12), -70.0)); [color=darkorange]// ExecuteScript("kr_tat18aa_enter", OBJECT_SELF); <-- Let's try option 2 first, actually [/color] } if (GetJournalEntry("jawahutt") == 1) { SetGlobalBoolean("Music", FALSE); SetGlobalBoolean("Dance", TRUE); SetGlobalNumber("Holo", 1); object oHoloHutt = CreateObject(OBJECT_TYPE_CREATURE, "HoloHutt", Location(Vector(80.80, 384.12, 37.26), 180.0)); object oJawaHutt = CreateObject(OBJECT_TYPE_CREATURE, "JawaHutt", Location(Vector(83.90, 390.48, 37.17), -135.0)); if (!GetIsObjectValid(GetItemPossessedBy(GetFirstPC() ,"holokey"))) { object oGuard = CreateObject(OBJECT_TYPE_CREATURE, "jawaguard2", Location(Vector(88.81, 395.15, 36.98), 0.0)); } } [color=darkorange]ExecuteScript("kr_tat18aa_enter", OBJECT_SELF); //ExecuteScript may need to be here instead, as it seems the script should fire every time[/color] } } Link to comment Share on other sites More sharing options...
Ӄhrizby Posted February 3, 2012 Author Share Posted February 3, 2012 Alright, so with the new executescript placement it works great, thanks a ton! And thanks for the input VP, I would never have thought of that! One question for my understanding though, if you want it to not fire when you're loading a savegame, wouldn't the current code check if it is, just like the GetIsPC? Or is that what the return is for? Just curious, it works fine in the game so I'm not complaining EDIT: Okay, nevermind, looks like we're not done yet. I just remembered I'd taken my .git file out of the override, and so I put it back in. Now I get my doors but it resets the module again. All it was for was a couple doors, and it works without the git. I extracted a completely clean, untouched file with KT and put it in the override and it still didn't work, it seems whenever anything's overwriting the .git it resets, and I don't know how those two things could even be related. Any ideas? EDIT 2: I realized that when I entered the module, exited, then reentered, there were two copies of all the people. Then next time three, etc. Looking at the script it's cause some brackets got moved, and not everything stayed under the !GetIsObjectValid. Not a problem, I slightly modified the code, I moved the executescript to the front, it's in the same placement but it just made it easier for my organization. I also slimmed up some unnecessary wording to make it less messy and easier to read. It still works the same for me so I don't think I did anything too destructively but here it is anyways: (EDIT 3: Apparently the brackets were moved for a good reason cause when they're all under that one !GetIsObjectValid if I entered anytime before my quest was active, when it was nobody would spawn cause the object was already there. I fixed the code below and didn't cut corners with individual !GetIsObjectValids this time.) Show spoiler (hidden content - requires Javascript to show) void main() { if (GetIsPC(GetEnteringObject())) { if (GetLoadFromSaveGame()) { return; } ExecuteScript("kr_tat18aa_enter", OBJECT_SELF); { if (!GetIsObjectValid(GetObjectByTag("plc_shack"))) { CreateObject(OBJECT_TYPE_PLACEABLE, "plc_shack", Location(Vector(85.79, 392.30, 37.07), -135.0)); CreateObject(OBJECT_TYPE_PLACEABLE, "holoterm", Location(Vector(82.51, 389.03, 37.25), -135.0)); CreateObject(OBJECT_TYPE_PLACEABLE, "plc_musiclocker", Location(Vector(85.35, 394.12, 37.12), -60.0)); }} if (GetJournalEntry("jawahutt") == 1) { SetGlobalBoolean("Music", FALSE); SetGlobalBoolean("Dance", TRUE); SetGlobalNumber("Holo", 1); if (!GetIsObjectValid(GetObjectByTag("HoloHutt"))) { CreateObject(OBJECT_TYPE_CREATURE, "HoloHutt", Location(Vector(80.80, 384.12, 37.26), 180.0)); } if (!GetIsObjectValid(GetObjectByTag("JawaHutt"))) { CreateObject(OBJECT_TYPE_CREATURE, "JawaHutt", Location(Vector(83.90, 390.48, 37.17), -135.0)); } if (!GetIsObjectValid(GetItemPossessedBy(GetFirstPC() ,"holokey"))) if (!GetIsObjectValid(GetObjectByTag("jawaguard2"))) { CreateObject(OBJECT_TYPE_CREATURE, "jawaguard2", Location(Vector(88.81, 395.15, 36.98), 0.0)); }}}} Link to comment Share on other sites More sharing options...
Qui-Gon Glenn Posted February 8, 2012 Share Posted February 8, 2012 Glad you have a working solution, although looking back, it is unnecessary to check validity against anything except for "plc_shack". If that is valid, then the other items MUST also be valid ( due to the logical construction of the script ).... However, if it ain't broke, don't fix it Link to comment Share on other sites More sharing options...
Ӄhrizby Posted February 8, 2012 Author Share Posted February 8, 2012 Actually that's why I changed it, that is true for "holoterm" and "plc_musiclocker" but the three creatures were only to spawn if the quest was active. The "plc_shack" is there no matter what. So if I entered and spawned it before activating the quest, when I did activate it the creatures wouldn't show up. I suppose I coulda put those three under one, like "HoloHutt" or something though. But you're right, it works I'm not touching it! Lol Link to comment Share on other sites More sharing options...
VarsityPuppet Posted February 9, 2012 Share Posted February 9, 2012 Glad you got it to work! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.