Starting a New Thread: Scripts Running Properly... only 12 t

Post » Tue Jun 19, 2012 9:14 pm

Notice: I normally do not disclose a large amount of info about my project to prevent spoilers, but This is driving me nuts. Really hope someone can help.

So...I've been play-testing my mod for about 5 hours now.For some reason my scripts don't always execute. Need some serious help here. About to provide a lot of information



------------------Code----------------------

The entirety of my Quest Source Code:
Spoiler
;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment;NEXT FRAGMENT INDEX 28Scriptname QF_MOD1QPart1_01002991 Extends Quest Hidden;BEGIN ALIAS PROPERTY Player;ALIAS PROPERTY TYPE ReferenceAliasReferenceAlias Property Alias_Player Auto;END ALIAS PROPERTY;BEGIN ALIAS PROPERTY HoodedDude;ALIAS PROPERTY TYPE ReferenceAliasReferenceAlias Property Alias_HoodedDude Auto;END ALIAS PROPERTY;BEGIN ALIAS PROPERTY Citizen_1;ALIAS PROPERTY TYPE ReferenceAliasReferenceAlias Property Alias_Citizen_1 Auto;END ALIAS PROPERTY;BEGIN ALIAS PROPERTY Citizen_3;ALIAS PROPERTY TYPE ReferenceAliasReferenceAlias Property Alias_Citizen_3 Auto;END ALIAS PROPERTY;BEGIN ALIAS PROPERTY Citizen_2;ALIAS PROPERTY TYPE ReferenceAliasReferenceAlias Property Alias_Citizen_2 Auto;END ALIAS PROPERTY;BEGIN ALIAS PROPERTY Giddeon;ALIAS PROPERTY TYPE ReferenceAliasReferenceAlias Property Alias_Giddeon Auto;END ALIAS PROPERTY;BEGIN ALIAS PROPERTY Citizen_4;ALIAS PROPERTY TYPE ReferenceAliasReferenceAlias Property Alias_Citizen_4 Auto;END ALIAS PROPERTY;BEGIN ALIAS PROPERTY Reginald;ALIAS PROPERTY TYPE ReferenceAliasReferenceAlias Property Alias_Reginald Auto;END ALIAS PROPERTY;BEGIN FRAGMENT Fragment_0Function Fragment_0();BEGIN AUTOCAST TYPE QF_MOD1QPart1_01002991Quest __temp = self as QuestQF_MOD1QPart1_01002991 kmyQuest = __temp as QF_MOD1QPart1_01002991;END AUTOCAST;BEGIN CODE;InitilizationIf (MQ305.GetStageDone(200) == true)		Mod1Qpart1. SetStage(1)EndIf;END CODEEndFunction;END FRAGMENT;BEGIN FRAGMENT Fragment_6Function Fragment_6();BEGIN CODE;player has killed Alduin and Hooded Man appearsAlias_HoodedDude.GetReference().Enable();END CODEEndFunction;END FRAGMENT;BEGIN FRAGMENT Fragment_27Function Fragment_27();BEGIN CODE;Cultists Activated, and Scene avaliable;END CODEEndFunction;END FRAGMENT;BEGIN FRAGMENT Fragment_17Function Fragment_17();BEGIN CODE;Upon entering the hideout;END CODEEndFunction;END FRAGMENT;BEGIN FRAGMENT Fragment_25Function Fragment_25();BEGIN CODE;Cultists Flee;END CODEEndFunction;END FRAGMENT;BEGIN FRAGMENT Fragment_8Function Fragment_8();BEGIN CODE;Disables Hooded ManAlias_HoodedDude.GetReference().Disable();END CODEEndFunction;END FRAGMENT;BEGIN FRAGMENT Fragment_20Function Fragment_20();BEGIN CODE;Player Has Speaken to Gideon YuroSetObjectiveCompleted(15)SetObjectiveDisplayed(17);END CODEEndFunction;END FRAGMENT;BEGIN FRAGMENT Fragment_7Function Fragment_7();BEGIN CODE;Player has encountered Hooded ManSetObjectiveDisplayed(2);END CODEEndFunction;END FRAGMENT;BEGIN FRAGMENT Fragment_21Function Fragment_21();BEGIN CODE;Player has Reached Dragon's Rest Sanctum;END CODEEndFunction;END FRAGMENT;BEGIN FRAGMENT Fragment_19Function Fragment_19();BEGIN CODE;After cave Scene, Before Speaking to Gideon YuroSetObjectiveCompleted(10)SetObjectiveDisplayed(15);END CODEEndFunction;END FRAGMENT;BEGIN FRAGMENT Fragment_14Function Fragment_14();BEGIN CODESetObjectiveCompleted(2)SetObjectiveDisplayed(10);Player Has Read InvitationAlias_Citizen_1.GetReference().Enable()Alias_Citizen_2.GetReference().Enable()Alias_Citizen_3.GetReference().Enable()Alias_Citizen_4.GetReference().Enable();END CODEEndFunction;END FRAGMENT;END FRAGMENT CODE - Do not edit anything between this and the begin comment;Event OnInit();If (MOD1QPart1.GetStage() == 0); If (MQ305.GetStageDone(200) == true);		 Mod1Qpart1.SetStage(1); EndIf;EndIf;EndEventQuest Property MQ305 AutoQuest Property MOD1QPart1  Auto




My Book Script:

Scriptname Mod1QPart1LetterScript extends ObjectReference  Quest Property MOD1QPart1  Auto  Event OnRead()	 MOD1QPart1.SetStage(10)endEvent


Alias_HoodedDude Dialogue Script (The Papyrus Fragment from the Dialogue Info of the HoodedDude Alias Actor.):

Spoiler

;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment;NEXT FRAGMENT INDEX 3Scriptname TIF__01002F00 Extends TopicInfo Hidden;BEGIN FRAGMENT Fragment_0Function Fragment_0(ObjectReference akSpeakerRef)Actor akSpeaker = akSpeakerRef as Actor;BEGIN CODEActorBase PlayerBase = Game.GetPlayer().GetBaseObject() as ActorBaseRace PlayerRace = Game.GetPlayer().GetRace()If (PlayerRace == RedguardRace || PlayerRace == BretonRace || PlayerRace == NordRace || PlayerRace == ImperialRace)  Game.GetPlayer().AddItem(MOD1SecretInvitationHU)ElseIf (PlayerRace == WoodElfRace || PlayerRace == HighElfRace || PlayerRace == DarkElfRace)			   Game.GetPlayer().AddItem(MOD1SecretInvitationElv)ElseIf (PlayerRace == ArgonianRace)			   Game.GetPlayer().AddItem(MOD1SecretInvitationAr)ElseIf (PlayerRace == KhajiitRace)  Game.GetPlayer().AddItem(MOD1SecretInvitationKj)ElseIf (PlayerRace == OrcRace)  Game.GetPlayer().AddItem(MOD1SecretInvitationOc)Else				 Debug.MessageBox("Player Race not found")EndIfGetOwningQuest().SetStage(2);END CODEEndFunction;END FRAGMENT;BEGIN FRAGMENT Fragment_2Function Fragment_2(ObjectReference akSpeakerRef)Actor akSpeaker = akSpeakerRef as Actor;BEGIN CODEakSpeaker.EvaluatePackage();END CODEEndFunction;END FRAGMENT;END FRAGMENT CODE - Do not edit anything between this and the begin commentBook Property MOD1SecretInvitationHU  AutoBook Property MOD1SecretInvitationElv  AutoBook Property MOD1SecretInvitationKj  AutoBook Property MOD1SecretInvitationAr  AutoBook Property MOD1SecretInvitationOc  AutoRace Property ImperialRace  AutoRace Property NordRace  AutoRace Property RedguardRace  AutoRace Property BretonRace  AutoRace Property WoodElfRace  AutoRace Property DarkElfRace  AutoRace Property HighElfRace  AutoRace Property ArgonianRace  AutoRace Property KhajiitRace  AutoRace Property OrcRace  AutoQuest Property MOD1QPart1  Auto




----The Problem--------------------

My scripts all work, but only half the time. I can't figure out why. The HoodedDude alias points to a unique actor called MOD1LetterDude. What I mean by only half the time is this:

The player is supposed to begin the quest by encountering the hoodeddude, the Alias has 2 packages. A forcegreet package, and a run away package (the second package happens when the quest stage > 1). Sometimes the forcegreet dialogue works, other times it doesn't. When it doesn't work, it causes problems, because the dialogue is supposed to set the quest stage to 2 (which is >1) and make the actor run away. Therefore when this dialogue doesn't run, the quest is frozen at stage 1. Which is bad.

AGAIN, it's important to remember that it's not completely broken. out of 50 trials this has happend approx 20 times. Sometimes the code executes fine, other times it doesn't. The weird thing is all quest variables (SQV) are the same before the code fails to execute, as they are when it executes properly. Have no idea why this is.


The same goes for the book script. It is attached to the letter that the player recieves. *Take this time to refer to the code*

This code only executes about 50% of the time also. Don't understand it.

Before anyone asks all of my Properties are defined, filled, and Quest Stages Created.

SQV Shows that all aliases are being filled.

Any help?
I'd appreciate it.
User avatar
Judy Lynch
 
Posts: 3504
Joined: Fri Oct 20, 2006 8:31 am

Post » Tue Jun 19, 2012 11:04 pm

So high elves, Nords, and Imperials won't get the note?
User avatar
Bonnie Clyde
 
Posts: 3409
Joined: Thu Jun 22, 2006 10:02 pm

Post » Wed Jun 20, 2012 6:08 am

So high elves, Nords, and Imperials won't get the note?

Yes they will.
User avatar
Christine Pane
 
Posts: 3306
Joined: Mon Apr 23, 2007 2:14 am

Post » Wed Jun 20, 2012 1:30 pm

So high elves, Nords, and Imperials won't get the note?
If (PlayerRace == RedguardRace || PlayerRace == BretonRace ||[color=#ff0000] PlayerRace == NordRace || PlayerRace == ImperialRace)[/color]  Game.GetPlayer().AddItem(MOD1SecretInvitationHU)ElseIf (PlayerRace == WoodElfRace || [color=#ff0000]PlayerRace == HighElfRace[/color] || PlayerRace == DarkElfRace)                           Game.GetPlayer().AddItem(MOD1SecretInvitationElv)ElseIf (PlayerRace == ArgonianRace)                           Game.GetPlayer().AddItem(MOD1SecretInvitationAr)ElseIf (PlayerRace == KhajiitRace)  Game.GetPlayer().AddItem(MOD1SecretInvitationKj)ElseIf (PlayerRace == OrcRace)  Game.GetPlayer().AddItem(MOD1SecretInvitationOc)Else
User avatar
Taylor Tifany
 
Posts: 3555
Joined: Sun Jun 25, 2006 7:22 am

Post » Tue Jun 19, 2012 10:19 pm

Ah, OK, I was counting the ifs, but missed the Or cases above...I hate fragmented code, it's 90% harder to read than normal code...which is hard enough as it is...OK, I think I see what you're after here...the book sets stage 10, which seems to correspond to Frament 14? Except it's not always doing it?
User avatar
christelle047
 
Posts: 3407
Joined: Mon Apr 09, 2007 12:50 pm

Post » Wed Jun 20, 2012 12:44 pm

The code may not be the problem...are there any conditions set in the dialogs or stages that might be preventing some things from happening?

Some others have reported having trouble getting NPCs to properly evaluate AI packages in quests - having the NPC ignore the quest packages and fall back on their default packages is a common complaint.

Have you tried removing all AI packages from the base character to see if that has any effect?
User avatar
matt
 
Posts: 3267
Joined: Wed May 30, 2007 10:17 am

Post » Wed Jun 20, 2012 1:03 pm

The code may not be the problem...are there any conditions set in the dialogs or stages that might be preventing some things from happening?

Some others have reported having trouble getting NPCs to properly evaluate AI packages in quests - having the NPC ignore the quest packages and fall back on their default packages is a common complaint.

Have you tried removing all AI packages from the base character to see if that has any effect?


A) The only conditions are on:
the "ForceGreet" Package (GetStage MOD1QPart1 == 1)
the Dialogue (GetIsID MOD1LetterDude == 1)

B) My Base Actors have no packages. At all.
User avatar
xemmybx
 
Posts: 3372
Joined: Thu Jun 22, 2006 2:01 pm

Post » Tue Jun 19, 2012 11:12 pm

Hmn...I've also seen some people complaining that GetStage conditions aren't working right. Try using (GetStageCompleted MOD1QPart1 == 0) and see if that helps?
User avatar
darnell waddington
 
Posts: 3448
Joined: Wed Oct 17, 2007 10:43 pm

Post » Wed Jun 20, 2012 8:37 am

Ah, OK, I was counting the ifs, but missed the Or cases above...I hate fragmented code, it's 90% harder to read than normal code...which is hard enough as it is...OK, I think I see what you're after here...the book sets stage 10, which seems to correspond to Frament 14? Except it's not always doing it?

And yes. The book should set the stage to 10, which should execute the Quest script fragment #14, Which enables the 4 citizen actors, and Sets objective 10 to be displayed.
User avatar
ANaIs GRelot
 
Posts: 3401
Joined: Tue Dec 12, 2006 6:19 pm

Post » Wed Jun 20, 2012 12:39 pm

Hmn...I've also seen some people complaining that GetStage conditions aren't working right. Try using (GetStageCompleted MOD1QPart1 == 0) and see if that helps?

Likewise. I'll try that as soon as CK loads again.


EDIT: Same problem. Didn't fix anything.
User avatar
Catherine Harte
 
Posts: 3379
Joined: Sat Aug 26, 2006 12:58 pm

Post » Wed Jun 20, 2012 10:58 am

Still works, but only some of the time eh?

Hmn...maybe the scene isn't starting or something? I'd put Debug.Notifications everywhere so you can trace what's really going on, displaying any relevant variables and so on...Like "Starting Stage X", "Launching Scene", "Entered Dialog" and so on...
User avatar
NO suckers In Here
 
Posts: 3449
Joined: Thu Jul 13, 2006 2:05 am

Post » Wed Jun 20, 2012 11:59 am

Still works, but only some of the time eh?

Hmn...maybe the scene isn't starting or something? I'd put Debug.Notifications everywhere so you can trace what's really going on, displaying any relevant variables and so on...Like "Starting Stage X", "Launching Scene", "Entered Dialog" and so on...

Well, it's not a scene. It's just an Aliased actor with a forcegreet package, and then a Book that only executes it's OnRead() event at random times.

Just to clarify: The book OnRead() event script only works about 1/2 the time. The dialogue only runs 1/2 the time. Well, both slightly more often than 1/2.
User avatar
Kellymarie Heppell
 
Posts: 3456
Joined: Mon Jul 24, 2006 4:37 am

Post » Wed Jun 20, 2012 5:22 am

So basically he's acting ilke a courier, without the actual courier quest and script? I really should write a small "Custom Courier" mod and do a write up on how to do it for situations like this...
User avatar
GabiiE Liiziiouz
 
Posts: 3360
Joined: Mon Jan 22, 2007 3:20 am

Post » Wed Jun 20, 2012 6:35 am

So basically he's acting ilke a courier, without the actual courier quest and script? I really should write a small "Custom Courier" mod and do a write up on how to do it for situations like this...

Basically, in a sense it is. The dude just stands around until the player gets in range.


EDIT: Okay, so I've done some testing with debug messages. It appears that on the Begin Dialogue Fragment, the code nearly always executes, which gives the player the letter, however, the "GetOwningQuest().SetStage(2)" isn't executing every time. I added a debug message just above the "GetOwningQuest().SetStage(2)". The debug Message activates every time, but the quest stage isn't set every time. Have no clue what gives.
User avatar
cosmo valerga
 
Posts: 3477
Joined: Sat Oct 13, 2007 10:21 am

Post » Tue Jun 19, 2012 11:38 pm

Try increasing the radius on the Forcegreet and see if that does anything.
User avatar
Laurenn Doylee
 
Posts: 3427
Joined: Sun Dec 03, 2006 11:48 am

Post » Wed Jun 20, 2012 10:36 am

Try this:
While !GetOwningQuest.SetStage(2)   Wait(0.5)EndWhile

That will keep looping until it succeeds

(When all else fails, whack it with a big stick)
User avatar
Carlitos Avila
 
Posts: 3438
Joined: Fri Sep 21, 2007 3:05 pm

Post » Wed Jun 20, 2012 11:34 am

Doesn't help.
User avatar
Ridhwan Hemsome
 
Posts: 3501
Joined: Sun May 06, 2007 2:13 pm

Post » Wed Jun 20, 2012 9:32 am

Hmn...put a notification in the loop, something like

Debug.Notification("Looping Stage = " + GetOwningQuest.GetStage()) and see what shows up.

If it stays at 1, then something is preventing the stage from changing (No idea what) if it changes to 2, then you will need to check the second stage and see if there's something there that's preventing it from working.
User avatar
bonita mathews
 
Posts: 3405
Joined: Sun Aug 06, 2006 5:04 am

Post » Tue Jun 19, 2012 11:28 pm

Did you get this working, or is your other thread a related issue?
User avatar
bonita mathews
 
Posts: 3405
Joined: Sun Aug 06, 2006 5:04 am

Post » Wed Jun 20, 2012 3:03 am

Pretty much all my threads are related issues.
User avatar
Eduardo Rosas
 
Posts: 3381
Joined: Thu Oct 18, 2007 3:15 pm


Return to V - Skyrim