Code just not working. I have no clue why.

Post » Wed Jun 20, 2012 2:11 am

I've been really frustrated over the past couple of hours because it feels like the CK just isn't doing what it should.

One example:

On Quest Stage two, I have the following papyrus fragment:

SetObjectiveDisplayed(2);Player has encountered Hooded Man

When I use the SetStage console command, or the stage gets set to 2 the proper reason, the Objective is just not displayed.


This has been happing for all sorts of lines of code. I don't know why. I know the code is right. It compiles. It just refuses to execute. Any ideas anyone?
User avatar
Marcin Tomkow
 
Posts: 3399
Joined: Sun Aug 05, 2007 12:31 pm

Post » Wed Jun 20, 2012 2:03 pm

Even papyrus fragments are scripts and thus must also have any properties they have defined. Try double-checking the script (or selecting and clicking properties) for the fragment.
User avatar
IM NOT EASY
 
Posts: 3419
Joined: Mon Aug 13, 2007 10:48 pm

Post » Wed Jun 20, 2012 9:45 am

Even papyrus fragments are scripts and thus must also have any properties they have defined. Try double-checking the script (or selecting and clicking properties) for the fragment.

All properties are filled and accounted for. If that's what you're asking.
User avatar
Talitha Kukk
 
Posts: 3477
Joined: Sun Oct 08, 2006 1:14 am

Post » Tue Jun 19, 2012 9:45 pm

Is your syntax correct?

SetObjectiveDisplayed MyQuest 10 1

1 will automatically start it, if Quest not already running

http://www.creationkit.com/SetObjectiveDisplayed
User avatar
Jerry Jr. Ortiz
 
Posts: 3457
Joined: Fri Nov 23, 2007 12:39 pm

Post » Wed Jun 20, 2012 10:56 am

Is your syntax correct?

SetObjectiveDisplayed MyQuest 10 1

1 will automatically start it, if Quest not already running

http://www.creationkit.com/SetObjectiveDisplayed

I will try that syntax, but the syntax I am using is DIRECTLY in Bethesda's quest tutorial on the CK wiki.

EDIT: I get a Starting 1 compile threads for 1 files...
Compiling "QF_MOD1QPart1_01002991"...
c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\QF_MOD1QPart1_01002991.psc(127,33): required (...)+ loop did not match anything at input '2'
c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\QF_MOD1QPart1_01002991.psc(127,35): required (...)+ loop did not match anything at input '1'
No output generated for QF_MOD1QPart1_01002991, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on QF_MOD1QPart1_01002991


when using that Syntax
SetObjectiveDisplayed MOD1QPart1 2 1;Player has encountered Hooded Man 
User avatar
Chad Holloway
 
Posts: 3388
Joined: Wed Nov 21, 2007 5:21 am

Post » Tue Jun 19, 2012 10:01 pm

The problem is that this is happening for nearly every bit of my code. Even code that worked a couple of hours ago.
User avatar
Elisha KIng
 
Posts: 3285
Joined: Sat Aug 18, 2007 12:18 am

Post » Wed Jun 20, 2012 10:42 am

With fragments, look at the http://www.creationkit.com/Quest_Stage_Fragments to see what 'special variables' are set for you.

You were almost right to begin with.
kmyQuest.SetObjectiveDisplayed(2)

The later bits are failing to complie as they're console commands.
User avatar
sophie
 
Posts: 3482
Joined: Fri Apr 20, 2007 7:31 pm

Post » Tue Jun 19, 2012 11:51 pm

Tuna, Not sure I get what you're saying, how are the later bits console command? They are papyrus script.
User avatar
Lisa Robb
 
Posts: 3542
Joined: Mon Nov 27, 2006 9:13 pm

Post » Wed Jun 20, 2012 10:20 am

H4Vent gave you console commands. They are not Papyrus script.

What is the objective with index 2 that isn't displaying? I can't see your screen, so I can't check that for you.


Keep in mind that though it is good practice for an objective index to match the stage index, it isn't necessarily so. You could have an objective with an index of 200 and still display it during stage 2 of your quest.
User avatar
Dalia
 
Posts: 3488
Joined: Mon Oct 23, 2006 12:29 pm

Post » Wed Jun 20, 2012 4:03 am

H4Vent gave you console commands. They are not Papyrus script.

What is the objective with index 2 that isn't displaying? I can't see your screen, so I can't check that for you.


Keep in mind that though it is good practice for an objective index to match the stage index, it isn't necessarily so. You could have an objective with an index of 200 and still display it during stage 2 of your quest.
OH I see what you're saying. H4's stuff was a console command, which is why that syntax doesn't compile. Gotcha. the objective with index 2 is "Investigate The Invitation". Also, there are NO CONDITIONs on this objective, so that definitely isn't the issue.
User avatar
maddison
 
Posts: 3498
Joined: Sat Mar 10, 2007 9:22 pm

Post » Wed Jun 20, 2012 10:04 am

Sorry for the confusion.
Did you add the kmyQuest prefix to your code?
That would have been the issue as without it the fragment doesn't know which quest to set the stage objective on.
User avatar
Paula Rose
 
Posts: 3305
Joined: Fri Feb 16, 2007 8:12 am

Post » Wed Jun 20, 2012 9:34 am

Tuna: My original script did not have the kmyQuest Prefix, however, I have tried both. Neither work.
User avatar
John Moore
 
Posts: 3294
Joined: Sun Jun 10, 2007 8:18 am

Post » Wed Jun 20, 2012 2:16 pm

Sorry for the confusion.
Did you add the kmyQuest prefix to your code?
That would have been the issue as without it the fragment doesn't know which quest to set the stage objective on.

From what I've seen, it defaults to "This quest" - Kmyquest is there so you can refer to another quest's stuff with "KmyQuest.Setstage()" and so on without having to set a script property and typing that out. It's a shorthand way of setting a local property to a quest in a particular stage's fragment
User avatar
Alexandra Ryan
 
Posts: 3438
Joined: Mon Jul 31, 2006 9:01 am

Post » Wed Jun 20, 2012 12:57 pm

I've been really frustrated over the past couple of hours because it feels like the CK just isn't doing what it should.

One example:

On Quest Stage two, I have the following papyrus fragment:

SetObjectiveDisplayed(2);Player has encountered Hooded Man

When I use the SetStage console command, or the stage gets set to 2 the proper reason, the Objective is just not displayed.


This has been happing for all sorts of lines of code. I don't know why. I know the code is right. It compiles. It just refuses to execute. Any ideas anyone?

This should, as you say work. In the Papyrus fragments for the Quest Stages you don't need to use kmyQuest or GetOwningQuest or anything like that.
Back to basics - is there a stage 2 in the Quest Objectives? Does this have a Display Text? Dunno if this would cause it to fail but perhaps the stage points to an invalid Target Alias?

If it still isn't working try:
SetObjectiveDisplayed(2)Debug.MessageBox("Stage 2 objective triggered!!!");Player has encountered Hooded Man
Does the message box appear?
User avatar
Ashley Tamen
 
Posts: 3477
Joined: Sun Apr 08, 2007 6:17 am

Post » Wed Jun 20, 2012 11:35 am

This should, as you say work. In the Papyrus fragments for the Quest Stages you don't need to use kmyQuest or GetOwningQuest or anything like that.
Back to basics - is there a stage 2 in the Quest Objectives? Does this have a Display Text? Dunno if this would cause it to fail but perhaps the stage points to an invalid Target Alias?

If it still isn't working try:
SetObjectiveDisplayed(2)Debug.MessageBox("Stage 2 objective triggered!!!");Player has encountered Hooded Man
Does the message box appear?

Very good Idea for where to place a debug box. I'll try it. To answer your questions, Yes, there is an objective with Index '2' and it has text "Investigate the Invitation"

Been having so much problem with code, I enabled logging last night, and been trying it this morning to see if it helps. Gonna try putting that debug box in first. I'll let you know what I find.


EDIT: Neither the ObjectiveDisplayed was changed, or the Message box popped up. I double checked the Quest Vars. Using SQV, AFTER I set the stage to 2. It shows that the quest stage is indeed 2. For some reason though, my code is not being executed. Brb. Imma go look at the logs from the last run.

EDIT EDIT: Log Tells me nothing.

EDIT X3: Added a Debug.Trace() to the code with same text as debug box. Gonna run it again.

EDIT X4: The code in the quest stage fragment is clearly just not executing. There is something underlying in the engine. Something the got changed somehow, which is rendering all of my code useless. The Debug.Trace() function didn't write to the log either. There are only a few things that could be happening here:

a) The stage is set, and the engine cannot read the code (for some reason)
B) The stage is set, and the engine fails to initiate the quest script (with all the fragments on it)
c) The stage is set, and the engine fails to initiate this fragment of the quest script.


As I was saying before this problem is running throughout my mod right not. I have lines of code at various places in my mod which worked fine a day a go. They compile properly, and have worked properly in the past, but something has changed, and while the code still compiles correctly, it is no longer executed in game.
User avatar
marina
 
Posts: 3401
Joined: Tue Mar 13, 2007 10:02 pm

Post » Wed Jun 20, 2012 11:12 am

This is odd...the code fragment at the stage level should be run every time that stage is set, right? Not just the first time?

Just to check, have you got a savegame that has never seen this quest before? Maybe an old save before you started making it? Try loading one up and see if it behaves the same way.
User avatar
Robert Jackson
 
Posts: 3385
Joined: Tue Nov 20, 2007 12:39 am

Post » Wed Jun 20, 2012 4:33 am

This is odd...the code fragment at the stage level should be run every time that stage is set, right? Not just the first time?

Just to check, have you got a savegame that has never seen this quest before? Maybe an old save before you started making it? Try loading one up and see if it behaves the same way.

Will do.

EDIT: It seemed to work, testing another old save to see if I get similar results.

2Edit: It didn't work at all on my other old save.
3EDIT: Tried a lot of different saves. Getting terribly mixed results. Sometimes it works, sometimes it doesn't appears almost random.
User avatar
Joanne
 
Posts: 3357
Joined: Fri Oct 27, 2006 1:25 pm

Post » Wed Jun 20, 2012 10:43 am

Yeah, I gave the console command ... I is stupid ... sorry :(

Saves
Ignore results you get from Saves. You're just confusing yourself. Saved games include lots of "state" information, so the results from each one may well differ from another.

Always test from a New Game (or a guaranteed clean saved game) if you possibly can.
User avatar
djimi
 
Posts: 3519
Joined: Mon Oct 23, 2006 6:44 am


Return to V - Skyrim