Stupid NPC glitch

Post » Wed Jun 20, 2012 5:10 pm

OK, I'm officially stumped. I've been trying to get a custom NPC to work like I want him to and I'm about ready to blow a gasket. This is only the 4th NPC I've set up to enable at a specific quest stage like this and this one absolutely refuses to work. Not only does he not enable when he should, but even if I remove the fragment that enables him, the quest pointer will not point to him either. I can go talk to him which will update the objective in my quest log like it should and the pointed comes back on and points to the next objective perfectly.

I have a Alias set up for him in my quest, he has dialog that works perfectly based on quest conditions and so forth. he even has a follow package that works as well. He simply will NOT enable if I set him as initially disabled. And yes, his alias is set to allow disabled, so that's not it. What would cause an NPC not to enable and a quest pointer not pointing to him like it should?

I even created a new NPC and alias for the new one and it didn't work either. I know the stage is firing as I have a debug message that's showing up like it should. I'm enabling him at stage 60 with this fragment: Alias_KorstNPC.GetReference().Enable()

Here's my quest script if that will do any good:
Spoiler

;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment;NEXT FRAGMENT INDEX 12Scriptname QF_BalokHelgen01_010012CA Extends Quest Hidden;BEGIN ALIAS PROPERTY Valerius;ALIAS PROPERTY TYPE ReferenceAliasReferenceAlias Property Alias_Valerius Auto;END ALIAS PROPERTY;BEGIN ALIAS PROPERTY Marcus;ALIAS PROPERTY TYPE ReferenceAliasReferenceAlias Property Alias_Marcus Auto;END ALIAS PROPERTY;BEGIN ALIAS PROPERTY BalokReunionSceneXmarker;ALIAS PROPERTY TYPE ReferenceAliasReferenceAlias Property Alias_BalokReunionSceneXmarker Auto;END ALIAS PROPERTY;BEGIN ALIAS PROPERTY dunCGHelgenGatesMarker;ALIAS PROPERTY TYPE ReferenceAliasReferenceAlias Property Alias_dunCGHelgenGatesMarker Auto;END ALIAS PROPERTY;BEGIN ALIAS PROPERTY Courier;ALIAS PROPERTY TYPE ReferenceAliasReferenceAlias Property Alias_Courier Auto;END ALIAS PROPERTY;BEGIN ALIAS PROPERTY KorstNPC;ALIAS PROPERTY TYPE ReferenceAliasReferenceAlias Property Alias_KorstNPC Auto;END ALIAS PROPERTY;BEGIN ALIAS PROPERTY PostHelgenEnableRef;ALIAS PROPERTY TYPE ReferenceAliasReferenceAlias Property Alias_PostHelgenEnableRef Auto;END ALIAS PROPERTY;BEGIN FRAGMENT Fragment_6Function Fragment_6();BEGIN CODEAlias_Valerius.GetReference().Enable();END CODEEndFunction;END FRAGMENT;BEGIN FRAGMENT Fragment_0Function Fragment_0();BEGIN CODEAlias_Marcus.GetReference().Enable();END CODEEndFunction;END FRAGMENT;BEGIN FRAGMENT Fragment_8Function Fragment_8();BEGIN CODEAlias_KorstNPC.GetReference().Enable()Debug.Notification("Stage 60 set Korst should be enabled");END CODEEndFunction;END FRAGMENT;BEGIN FRAGMENT Fragment_14Function Fragment_14();BEGIN CODEAlias_Marcus.GetActorRef().SetOutfit(MarcusSteelArmor);END CODEEndFunction;END FRAGMENT;BEGIN FRAGMENT Fragment_3Function Fragment_3();BEGIN CODENorthGate.Setopen(true)EastGate.Setopen(true);END CODEEndFunction;END FRAGMENT;END FRAGMENT CODE - Do not edit anything between this and the begin commentObjectReference Property NorthGate  Auto  ObjectReference Property EastGate  Auto  Outfit Property MarcusSteelArmor  Auto  
User avatar
Ezekiel Macallister
 
Posts: 3493
Joined: Fri Jun 22, 2007 12:08 pm

Post » Thu Jun 21, 2012 12:07 am

Use the "TryTo" on the Aliases so you don't have to check if the reference exists (Which you aren't doing), causing a run-time error if it doesn't.

Alias_KorstNPC.TryToEnable()


What would cause an NPC to not enable would be that the Alias pointing to him isn't pointing to anything, resulting in Enable being executed on a None object... Throwing a run-time error.
User avatar
Dan Endacott
 
Posts: 3419
Joined: Fri Jul 06, 2007 9:12 am

Post » Wed Jun 20, 2012 9:53 pm

Use the "TryTo" on the Aliases so you don't have to check if the reference exists (Which you aren't doing), causing a run-time error if it doesn't.

Alias_KorstNPC.TryToEnable()


What would cause an NPC to not enable would be that the Alias pointing to him isn't pointing to anything, resulting in Enable being executed on a None object... Throwing a run-time error.

OK, just tried the TryToEnable and it still didn't work. But, yes, it acts like the enable alias and quest target aren't pointing to anything when the guy is standing right there in the same cell I'm in. It's maddeing I tell you. I'm about to go insane, because I can't understand a damn reason why this isin't working exactly as it should because all others work perfectly every time.

:swear: :banghead:
User avatar
Javaun Thompson
 
Posts: 3397
Joined: Fri Sep 21, 2007 10:28 am

Post » Wed Jun 20, 2012 10:31 pm

are using specific reference or unique?

if using unique, you may need to specify a persistent location in order for it to fill the alias properly.


you may also need

Alias_KorstNPC.GetActorReference()


since you are enabling the Actor the reference is pointing at
User avatar
joannARRGH
 
Posts: 3431
Joined: Mon Mar 05, 2007 6:09 am

Post » Thu Jun 21, 2012 12:39 am

are using specific reference or unique?

if using unique, you may need to specify a persistent location in order for it to fill the alias properly.


you may also need

Alias_KorstNPC.GetActorReference()


since you are enabling the Actor the reference is pointing at

OK I tried this (in the fragment box of stage 60):

Alias_KorstNPC.GetActorReference().Enable()
Debug.Notification("Stage 60 set Korst should be enabled")

The debug plays, but no Korst. It's like he frigging doesn't exist, but I assure he's right beside me (just initially disabled). I wonder why I didn't have to use the GetActorReference() on my other 3 NPC's? I just used: Alias_Marcus.GetReference().Enable() and they worked fine. Is there a debug I can run somehow to see what the game is doing?
User avatar
cheryl wright
 
Posts: 3382
Joined: Sat Nov 25, 2006 4:43 am

Post » Wed Jun 20, 2012 1:36 pm

you can use a console debug:


open the console in game after your debug message pops up.


type

prid ######## (the #'s represent Korst's ref ID, load order dependent)

GetIsAliasRef KorstNPC


if the value returns 1, the alias is filled properly and i am stumped as to why enable is not working.

if the value returns 0, the alias is not filled, and that is the reason it is not enabling your actor
User avatar
Nikki Lawrence
 
Posts: 3317
Joined: Sat Jul 01, 2006 2:27 am

Post » Wed Jun 20, 2012 1:59 pm

Does the area around the npc have a navmesh?
User avatar
Tanika O'Connell
 
Posts: 3412
Joined: Fri Jan 26, 2007 1:34 am

Post » Wed Jun 20, 2012 9:35 am

type

prid ######## (the #'s represent Korst's ref ID, load order dependent)

GetIsAliasRef KorstNPC


OK maybe narrowing down a culprit. I ran what you said and got:

No owner quest on script for parameter QuestAlias.

@ Darkstalker: I'm Helgen Keep so it's definitely navmeshed.
User avatar
Alister Scott
 
Posts: 3441
Joined: Sun Jul 29, 2007 2:56 am

Post » Wed Jun 20, 2012 11:04 pm

try it again using alias_korstNPC instead of korstNPC

i may be wrong in using the quest's alias name, might need to use the script's alias property
User avatar
Jessica Phoenix
 
Posts: 3420
Joined: Sat Jun 24, 2006 8:49 am

Post » Wed Jun 20, 2012 6:49 pm

try it again using alias_korstNPC instead of korstNPC

i may be wrong in using the quest's alias name, might need to use the script's alias property

tried that and got the same thing.
User avatar
BEl J
 
Posts: 3397
Joined: Tue Feb 13, 2007 8:12 am

Post » Wed Jun 20, 2012 11:07 am

How about putting this in there:

if !Alias_KorstNPC.GetActorReference()   Debug.Notification("Korst Alias Not Filled")elseif Alias_KorstNPC.GetActorReference().Enable()   Debug.Notification("Korst Alias Filled, Enable Returned True.")else   Debug.Notification("Korst Alias Filled, Enable Returned False.")Endif
User avatar
Jhenna lee Lizama
 
Posts: 3344
Joined: Wed Jun 06, 2007 5:39 am

Post » Wed Jun 20, 2012 1:18 pm

How about putting this in there:

if !Alias_KorstNPC.GetActorReference()   Debug.Notification("Korst Alias Not Filled")elseif Alias_KorstNPC.GetActorReference().Enable()   Debug.Notification("Korst Alias Filled, Enable Returned True.")else   Debug.Notification("Korst Alias Filled, Enable Returned False.")Endif

That returned Korst Alias not filled
User avatar
Michael Russ
 
Posts: 3380
Joined: Thu Jul 05, 2007 3:33 am

Post » Wed Jun 20, 2012 10:42 am

OK, since there is no reason for it not to be filled (Not reserved by another quest, not dead, and he's allow disabled) you may have a bad savegame. Try loading the game with your mod disabled and making a new savegame, then loading that savegame with the mod loaded and see what happens. Another guy was having trouble making a dragon enable, and it was just this sort of problem.
User avatar
jenny goodwin
 
Posts: 3461
Joined: Wed Sep 13, 2006 4:57 am

Post » Wed Jun 20, 2012 7:26 pm

what are all your settings on korstNPC alias?

edit: yes, you should always be using a clean save to test
User avatar
Laura Tempel
 
Posts: 3484
Joined: Wed Oct 04, 2006 4:53 pm

Post » Wed Jun 20, 2012 8:51 am

OK, I'm using a save I made as soon as I left the cave in Helgen, and no other mods installed. I did a clean install of the game and CK this weekend to clean out any crap that might cause me trouble. Going to try and clean my save, brb.

Oh yeah, alias settings are allow disabled, essential and set to unique actor "BalokKorst"

brb
User avatar
Naughty not Nice
 
Posts: 3527
Joined: Sat Nov 04, 2006 6:14 am

Post » Wed Jun 20, 2012 10:22 am

OK, thanks guys, that worked! I'll refrain from expressing my true sentiments, lol, as this has been a royal PITA, and I've wasted more time on this than I'd care to admit. Unfortunately, this stage is several stages into my quest which makes it a pain to have to slog through the entire 1st half of my quest to get to this stage every time I want to test something, but I guess you gotta do what you gotta do. What is the Skyrim equivalent of movetoQT like we could use in Fallout 3 & NV? That would help get through the stages quicker.
User avatar
Stat Wrecker
 
Posts: 3511
Joined: Mon Sep 24, 2007 6:14 am

Post » Wed Jun 20, 2012 6:06 pm

You can always use the console Setstage command to go right to the stage you want to test...
User avatar
Tai Scott
 
Posts: 3446
Joined: Sat Jan 20, 2007 6:58 pm

Post » Wed Jun 20, 2012 2:13 pm

You can type "movetoqt "
Also, you can use "sqv " to see a list of quest variables, including Aliases, which allows you to check if they're filled.
User avatar
An Lor
 
Posts: 3439
Joined: Sun Feb 18, 2007 8:46 pm

Post » Wed Jun 20, 2012 3:21 pm

Thanks guys, the help is greatly appreciated. I hate when you KNOW you have something set up correctly, and it simply doesn’t work. As I said earlier, it’s absolutely maddening. The save I was using was 100% vanilla (not even the official hi-res texture pack) and I ran through the entire opening sequence until you leave the cave and Alduin flies over towards Bleak Falls. In fact, “Unbound” would actually complete every time I loaded this save. I thought, “there’s NO way the save can be corrupt” but I guess it was. But it was easy enough to start another new test character.

The funny thing was that I had another glitch this past weekend that led me to completely uninstall my game and the CK, and reinstall everything again from scratch. It was also infuriating because I had a dialog set to only run at a certain quest stage (stage 55) and no matter what I did, it simply would NOT be an available dialog option for my NPC, when I KNEW that I had the condition set correctly and the stage was set correctly as evidenced by a debug message. I finally determined that if I saved just before initiating the dialog, exited the game, and reloaded the save I just made, the dialog would fire as it should have. I still don’t know why that one was happening unless it was another save game issue. I always run through my quests probably 100’s of times during the building process, but these glitches are just insane. It makes me shudder as to what kind of problems users may experience down the road. If I can’t even use the same character – a NEW toon with a clean save – to playtest my mod without getting these glitches, I’d hate to think what headaches I’m in for if I decide to release this mod when it’s done.

And the bad thing is that I haven’t even begun to do anything complicated whatsoever yet. Everything is just standard dialog, setting and completing objectives and stages in dialog fragments and stage fragments. It’s basically questing 101 it’s so simple. God help me if I ever start putting in more complex events.
User avatar
Casey
 
Posts: 3376
Joined: Mon Nov 12, 2007 8:38 am

Post » Wed Jun 20, 2012 11:37 pm

The savegame problem is primarily caused by making some change in the quest or NPC that isn't in the savegame and isn't "reset" when you load the save. For example, if you put a script on an NPC, the OLD version in the savegame may not have the script, and won't fire any OnInit() event, since it's already initialized, etc.

Unless your users will be modifying your mod, they shouldn't have that issue. If they DO modify your mod, then it's their problem if they mess something up...heh.
User avatar
DAVId MArtInez
 
Posts: 3410
Joined: Fri Aug 10, 2007 1:16 am

Post » Wed Jun 20, 2012 11:34 pm

OK, just so I understand, and please forgive me for being slow, lol. The dialog glitch happened like this:

At first I made the new Branch and topics and they were set to fire ONLY after a little scene between 2 of my NPC’s played. It worked, but I didn’t like the flow of the event so I switched it to run the dialog first, then after the dialog ran I used setstage to trigger the scene. I tested, and tested and tested, lol and got the same thing every time. I even used a save from my first character in November that I made as soon as I left Helgen cave. (Yes, I admit I am incredibly OCD about saving my games often – ESPECIALLY Bethesda games, lol. I learned the hard way from Oblivion what can happen if you don’t save your progress and loose hundreds of hours of playing time.)

So you’re saying that since my changes took place after I made a save with the mod already running but BEFORE I actually made the changes, that what was saved in the savegame nullified my new changes? That’s extremely wokny IMO, how the hell can we easily and quickly test for changes we make?

I tell you, I’m really struggling with this whole script management thing. I love the way that fragments work, as it simplifies the scripting for me a lot. (And I’m a beginning scripter at best.) But I wish the actual scripts were saved in the plugin like they used to be. While I have an overall goal and vision for my final completed mod, I’m basically making up how I get to that point as I go, which requires trying something out and if I like it great. But if not, trying something different over and over until I find the right thing I’m looking for. It’s a lot of trial and testing to see how I like stuff. Methinks this is going to be a LONG and painful process, lol.
User avatar
Dalley hussain
 
Posts: 3480
Joined: Sun Jun 18, 2006 2:45 am


Return to V - Skyrim