Another Code Problem.

Post » Tue Jun 19, 2012 9:28 pm

Hoping Someone Can Help Me Here.


;Irrelevant Code AboveEvent OnInit()    registerForUpdate(1);EndEventEvent OnUpdate()If (MOD1QPart1.GetStage() == 29)    ;self.say()    Debug.SendAnimationEvent(Self, "IdlePray")    Debug.MessageBox("OnUpdate Event Done:SendAnimationEventSent");ElseIf (MOD1QPart1.GetStage() > 29)    unregisterForUpdate();Else    debug.MessageBox("Else");EndifEndEvent;Property Declarations Below

I have MOD1QPart1 set up as a quest property for this script. I am entering a room with the actor this script is attached to. Before I enter, I used the console command "SetStage MOD1QPart1 29" to set the quest stage to 29, then I enter. For some reason though, even though I know for absolute certain that the Quest stage is 29, I keep getting the "Else" message at every update. Can anyone identify the problem?
User avatar
Jack
 
Posts: 3483
Joined: Sat Oct 20, 2007 8:08 am

Post » Wed Jun 20, 2012 7:24 am

29 is NOT greater than 29. It's doing what you ask.
User avatar
Len swann
 
Posts: 3466
Joined: Mon Jun 18, 2007 5:02 pm

Post » Tue Jun 19, 2012 10:01 pm

Well, the OnUpdate is firing before the Console Command is entered (because your script itself seems OK) - I guess it depends what object the script is attached to and when that object receives it's onupdate event?

I don't know how your quest works, but if you can, setstage 28 via the console, do that stage, then enter your room and see if you get the right message.
User avatar
R.I.P
 
Posts: 3370
Joined: Sat Dec 01, 2007 8:11 pm

Post » Wed Jun 20, 2012 6:00 am

29 is NOT greater than 29. It's doing what you ask.

Well, on every update, it should check to see if the quest state is 29. If it is, the actor that the script is on should do the animation, and the Debug Message should appear, however, I constantly get else, which makes no sense.

Edit, and no. It's not. I'm not wanting or asking it to unregisterforupdate(); at stage 29.
User avatar
Colton Idonthavealastna
 
Posts: 3337
Joined: Sun Sep 30, 2007 2:13 am

Post » Wed Jun 20, 2012 7:10 am

(nvm)


I thought setting the stage to 29 would make that the Active Stage and the first line of the IF should fire? (Am I confused? To be fair, I usually am!)
User avatar
TRIsha FEnnesse
 
Posts: 3369
Joined: Sun Feb 04, 2007 5:59 am

Post » Tue Jun 19, 2012 7:04 pm

Did you remember to fill (or autofill) the MOD1QPart1 property? If you didn't your first if is "if NONE.GetStage() == 29"

I often forget to go into properties and set those dang things.
User avatar
abi
 
Posts: 3405
Joined: Sat Nov 11, 2006 7:17 am

Post » Wed Jun 20, 2012 6:44 am

Did you remember to fill (or autofill) the MOD1QPart1 property? If you didn't your first if is "if NONE.GetStage() == 29"

I often forget to go into properties and set those dang things.

Yep, it's there and filled. Just Double Checked.
User avatar
bimsy
 
Posts: 3541
Joined: Wed Oct 11, 2006 3:04 pm

Post » Tue Jun 19, 2012 11:02 pm

Hmn...change the messageboxes to Notifications so you can get a running list of them, and change the ("Else") to ("Else, Stage = " + MOD1QPart1.GetStage())
User avatar
jesse villaneda
 
Posts: 3359
Joined: Wed Aug 08, 2007 1:37 pm

Post » Tue Jun 19, 2012 8:52 pm

Yea... thanks for posting, haven't tried that yet. I actually need to head to bed. But I'll try that and post tomorrow.
User avatar
Miss K
 
Posts: 3458
Joined: Sat Jan 20, 2007 2:33 pm

Post » Wed Jun 20, 2012 3:23 am

Oops, sorry for the post above. I'd skipped the code to read your Q, and ended up reading backwards. I didn't even notice the '==' condition. My bad.
User avatar
Sunny Under
 
Posts: 3368
Joined: Wed Apr 11, 2007 5:31 pm

Post » Tue Jun 19, 2012 4:55 pm

Strange... Even though the property appears to be set. The "Else, Stage =" Box is showing a value of zero.

After that, I even used the SetStage command in game. Still gave me zero.

This tells me that for some reason, it's not reading the true value of MOD1QPart1. So, I went back and checked the properties again. Everything checks out. Quest Property is filled with the right quest... I have no clue.

EDIT: I also double checked the true value of MOD1QPart1 via "SQV MOD1QPart1" in game. It evaluates to 20 (That is on the save I'm using for testing.) and then to 29 (after I "SetStage MOD1QPart1 29")
User avatar
scorpion972
 
Posts: 3515
Joined: Fri Mar 16, 2007 11:20 am

Post » Wed Jun 20, 2012 4:29 am

Is the quest set to "Start Game Enabled"? (grasping at straws here. lol )
User avatar
Nymph
 
Posts: 3487
Joined: Thu Sep 21, 2006 1:17 pm

Post » Wed Jun 20, 2012 3:21 am

Is the quest set to "Start Game Enabled"? (grasping at straws here. lol )

Yep. Didn't make a silly mistake this time. And stage 29 does exist, as do stages 30-35.
User avatar
Lovingly
 
Posts: 3414
Joined: Fri Sep 15, 2006 6:36 am

Post » Wed Jun 20, 2012 12:55 am

You haven't defined MOD1QPart1

In a quest script you don't need it, the quest refers to itself by default.

If (GetStage() == 29)


If you use it, you need to define it.

Quest Property MOD1QPart1 auto[...]If (MOD1QPart1.GetStage() == 29) 
User avatar
Katie Pollard
 
Posts: 3460
Joined: Thu Nov 09, 2006 11:23 pm

Post » Tue Jun 19, 2012 4:16 pm

You haven't defined MOD1QPart1

In a quest script you don't need it, the quest refers to itself by default.

If (GetStage() == 29)


If you use it, you need to define it.

Quest Property MOD1QPart1 auto[...]If (MOD1QPart1.GetStage() == 29) 

It is defined. ";Property Declarations Below" means that I have my properties defined below. I just didn't feel the need to include them. And before you guys ask. Yes, my properties are spelled and formatted properly. In this case the property is "Quest Property MOD1QPart1 Auto"
User avatar
Mrs. Patton
 
Posts: 3418
Joined: Fri Jan 26, 2007 8:00 am

Post » Tue Jun 19, 2012 9:59 pm

Have you tried to move the declarations above the first time the properties are used?
User avatar
Laura Ellaby
 
Posts: 3355
Joined: Sun Jul 02, 2006 9:59 am

Post » Wed Jun 20, 2012 2:48 am

Have you tried to move the declarations above the first time the properties are used?

Well, I actually had the quest property at the top, but moved it to the bottom because it wasn't working. either way I get the same result,
User avatar
Tracy Byworth
 
Posts: 3403
Joined: Sun Jul 02, 2006 10:09 pm

Post » Tue Jun 19, 2012 11:14 pm

I knows its a pain, Garg, but you may want to post the whole script so we can have a look-see.
User avatar
Harinder Ghag
 
Posts: 3405
Joined: Wed Jan 17, 2007 11:26 am

Post » Wed Jun 20, 2012 6:45 am

I knows its a pain, Garg, but you may want to post the whole script so we can have a look-see.

Imma start posting whole script from now on. So this doesn't happen... 1 sec


Scriptname MOD1DragonCultistScript extends ActorEvent OnLoad ()if (MOD1QPart1.GetStage() == 29)    Self.Enable()else    Self.Disable()endifEndEventEvent OnInit()    registerForUpdate(1);endEventEvent OnUpdate()If (MOD1QPart1.GetStage() == 29)    ;self.say()    Debug.SendAnimationEvent(Self, "IdlePray")    Debug.MessageBox("OnUpdate Event Done:SendAnimationEventSent");elseif (MOD1QPart1.GetStage() > 29)    unregisterForUpdate();else    debug.MessageBox("Else, Stage =" + MOD1QPart1.GetStage());EndifendEventQuest Property MOD1QPart1  Auto
User avatar
sharon
 
Posts: 3449
Joined: Wed Nov 22, 2006 4:59 am

Post » Tue Jun 19, 2012 11:53 pm

Have you tried GetStageDone instead?

What stage does Getstage actually return?
User avatar
Lalla Vu
 
Posts: 3411
Joined: Wed Jul 19, 2006 9:40 am

Post » Tue Jun 19, 2012 4:15 pm

Have you tried GetStageDone instead?

What stage does Getstage actually return?

OK There are a couple of weird things. MOD1QPart1.GetStage() is returning the proper number (29) in the OnLoad Event, Because my actor activates itself properly.
Hoowever, under the on update event it appears to be returning 0, regardless of what the quest's true stage is.
User avatar
A Boy called Marilyn
 
Posts: 3391
Joined: Sat May 26, 2007 7:17 am

Post » Tue Jun 19, 2012 8:32 pm

Does the quest objective for your stage 29 show up in the quest log?

(More straw grasping...maybe it's getting stuck on stage 0 for some reason?)

Try this:

int ReadStageint Counter = 0While Counter < 35   if MOD1QPart1.SetStage(Counter) ; If we successfully changed the stage to Counter (Means stage exists and it worked)	  ReadStage = MOD1QPart1.GetStage() 	  Debug.MessageBox("Stage: "+Counter+" Checked and verified: "+ReadStage)  endif  Counter += 1Endwhile

That should check to see if the stages are reading correctly. SetStage returns a boolean that is true if the stage correctly changed, and false if it wasn't.

It should only pop up ANY text boxes if the quest is, in fact changing, and it will compare what it tried to set with what it's reading from the quest.
User avatar
KiiSsez jdgaf Benzler
 
Posts: 3546
Joined: Fri Mar 16, 2007 7:10 am

Post » Wed Jun 20, 2012 12:41 am

I could have sworn properties needed to be declared at the start of the script, before your events and after the scriptname line
User avatar
Christine
 
Posts: 3442
Joined: Thu Dec 14, 2006 12:52 am

Post » Wed Jun 20, 2012 6:22 am

Does the quest objective for your stage 29 show up in the quest log?

(More straw grasping...maybe it's getting stuck on stage 0 for some reason?)

Try this:

int ReadStageint Counter = 0While Counter < 35   if MOD1QPart1.SetStage(Counter) ; If we successfully changed the stage to Counter (Means stage exists and it worked)	  ReadStage = MOD1QPart1.GetStage()	  Debug.MessageBox("Stage: "+Counter+" Checked and verified: "+ReadStage)  endif  Counter += 1Endwhile

That should check to see if the stages are reading correctly. SetStage returns a boolean that is true if the stage correctly changed, and false if it wasn't.

It should only pop up ANY text boxes if the quest is, in fact changing, and it will compare what it tried to set with what it's reading from the quest.

Well, as I mentioned in my other thread.. I don't have a stage for every number between 0-35. I skip a few numbers at places. I'm going to try declaring my properties at the top again to see if it makes any difference, though I don't think that it will.


Yea, Relocating My Property Declarations did nothing.
User avatar
Daniel Holgate
 
Posts: 3538
Joined: Tue May 29, 2007 1:02 am

Post » Tue Jun 19, 2012 9:28 pm

You can bypass the whole issue like this:

Scriptname MOD1DragonCultistScript extends ActorEvent OnLoad ()  if (MOD1QPart1.GetStage() != 29)    Self.disable()  else    Self.Enable()    While (MOD1QPart1.GetStage() == 29) ; We know it's working here.       ;self.say()       Debug.SendAnimationEvent(Self, "IdlePray")       Debug.MessageBox("OnUpdate Event Done:SendAnimationEventSent");       Utility.Wait(1.0)    EndWhile  endifEndEventEvent OnInit()    ;registerForUpdate(1)endEventQuest Property MOD1QPart1  Auto


But that still doesn't explain the bad return value from the quest...it's still an issue.
User avatar
Andres Lechuga
 
Posts: 3406
Joined: Sun Aug 12, 2007 8:47 pm

Next

Return to V - Skyrim