Script partially not working.

Post » Wed Jun 20, 2012 2:20 am

I have tried absolutely everything I can to get this particular piece of the script to trigger:

Spoiler
            ELSEIF(!bMage && Guardian == "Mage")                debug.MessageBox("The Stone does not respond to your touch")                utility.wait(2)                                doOnce = TRUE            ELSEIF(!bThief && Guardian == "Thief")                debug.MessageBox("The Stone does not respond to your touch")                utility.wait(2)                                doOnce = TRUE            ELSEIF(!bWarrior && Guardian == "Warrior")                debug.MessageBox("The Stone does not respond to your touch")                utility.wait(2)                                doOnce = TRUE

But no matter what I try, it keeps getting skipped. The String I'm checking for is being set properly and the If statements above these three work just fine, so why do these ones never fire at all?


Spoiler
scriptName doomTKGuardianShrineScript extends ObjectReferenceimport gameimport utilityString property graphVariable auto; //which stone are weBOOL PROPERTY bMage AUTOBOOL PROPERTY bThief AUTOBOOL PROPERTY bWarrior AUTO; //list of the effectsSPELL PROPERTY pDoomMageAbility AUTOSPELL PROPERTY pDoomThiefAbility AUTOSPELL PROPERTY pDoomWarriorAbility AUTOSPELL PROPERTY pDoomMageAbility2 AUTOSPELL PROPERTY pDoomThiefAbility2 AUTOSPELL PROPERTY pDoomWarriorAbility2 AUTOSPELL PROPERTY pDoomMageAbility3 AUTOSPELL PROPERTY pDoomThiefAbility3 AUTOSPELL PROPERTY pDoomWarriorAbility3 AUTO; //list of the messagesMESSAGE PROPERTY pDoomMageMSG AUTOMESSAGE PROPERTY pDoomThiefMSG AUTOMESSAGE PROPERTY pDoomWarriorMSG AUTO; //the already have messageMESSAGE PROPERTY pDoomAlreadyHaveMSG AUTOSTRING PROPERTY Guardian AUTO;************************************BOOL DOONCE=TRUEInt Response = -1Auto State base        EVENT onACTIVATE(OBJECTREFERENCE obj)                ; //check to see if the player is the activator and we havent already activated        IF(doOnce && obj AS ACTOR == game.getPlayer())                        doOnce = FALSE                        ; //if we already have the power and this is the stone then kick the player out            ; //if the player's stone selection is not a Charge of their guardian, kick him out            ; //if the player has already selected a Guardian and tries to take another, kick him out            ; //finally, disallow player interaction altogether if he has taken the Serpent            IF(bMage && Guardian == "Mage")                pDoomAlreadyHaveMSG.show()                utility.wait(2)                                doOnce = TRUE            ELSEIF(bThief && Guardian == "Thief")                pDoomAlreadyHaveMSG.show()                utility.wait(2)                                doOnce = TRUE            ELSEIF(bWarrior && Guardian == "Warrior")                pDoomAlreadyHaveMSG.show()                utility.wait(2)                                doOnce = TRUE            ELSEIF(!bMage && Guardian == "Mage")                debug.MessageBox("The Stone does not respond to your touch")                utility.wait(2)                                doOnce = TRUE            ELSEIF(!bThief && Guardian == "Thief")                debug.MessageBox("The Stone does not respond to your touch")                utility.wait(2)                                doOnce = TRUE            ELSEIF(!bWarrior && Guardian == "Warrior")                debug.MessageBox("The Stone does not respond to your touch")                utility.wait(2)                                doOnce = TRUE            ELSE                                    ; // present them with the choice                ; // Items 1, 2, 3 == Accept, Item 4 == Decline                IF(bMage)                                    Response = pDoomMageMSG.Show()                                        IF Response == 0                        addSign1()                                            SELF.playAnimation("playanim01")                                            utility.wait(15)                                            doOnce = TRUE                                        ELSEIF Response == 1                        addSign2()                                            SELF.playAnimation("playanim01")                                            utility.wait(15)                                            DoOnce = TRUE                                        ELSEIF Response == 2                        addSign3()                        SELF.playAnimation("playanim01")                                            utility.wait(15)                                            doOnce = TRUE                                        ELSE                        utility.wait(2)                        doOnce = TRUE                    ENDIF                                    ELSEIF(bThief)                                    Response = pDoomThiefMSG.Show()                                        IF Response == 0                        addSign1()                                            SELF.playAnimation("playanim01")                                            utility.wait(15)                                            doOnce = TRUE                                        ELSEIF Response == 1                        addSign2()                                            SELF.playAnimation("playanim01")                                            utility.wait(15)                                            DoOnce = TRUE                                        ELSEIF Response == 2                        addSign3()                                            SELF.playAnimation("playanim01")                                            utility.wait(15)                                            doOnce = TRUE                                        ELSE                        utility.wait(2)                        doOnce = TRUE                    ENDIF                                    ELSEIF(bWarrior)                                    Response = pDoomWarriorMSG.Show()                                        IF Response == 0                        addSign1()                                            SELF.playAnimation("playanim01")                                            utility.wait(15)                                            doOnce = TRUE                                        ELSEIF Response == 1                        addSign2()                                            SELF.playAnimation("playanim01")                                            utility.wait(15)                                            DoOnce = TRUE                                        ELSEIF Response == 2                        addSign3()                                            SELF.playAnimation("playanim01")                                            utility.wait(15)                                            doOnce = TRUE                                        ELSE                        utility.wait(2)                        doOnce = TRUE                    ENDIF                                    ENDIF                        ENDIF                    ENDIF    endEVENT    endState; //FUNCTION: addSign; //; // adds the sign of the stone to the playerFUNCTION addSign1()    game.AddAchievement(29)    ; // Standard signs    IF(bMage)        game.getPlayer().addSpell(pDoomMageAbility)        Guardian = "Mage"        Debug.Notification("You have taken " + Guardian)    ELSEIF(bThief)        game.getPlayer().addSpell(pDoomThiefAbility)        Guardian = "Thief"        Debug.Notification("You have taken " + Guardian)    ELSEIF(bWarrior)        game.getPlayer().addSpell(pDoomWarriorAbility)        Debug.Notification("You have taken " + Guardian)    ENDIF    endFUNCTION    FUNCTION addSign2()    game.AddAchievement(29)    ; // Standard signs    IF(bMage)        game.getPlayer().addSpell(pDoomMageAbility2)        Guardian = "Mage"        Debug.Notification("You have taken " + Guardian)    ELSEIF(bThief)        game.getPlayer().addSpell(pDoomThiefAbility2)        Guardian = "Thief"        Debug.Notification("You have taken " + Guardian)    ELSEIF(bWarrior)        game.getPlayer().addSpell(pDoomWarriorAbility2)        Guardian = "Warrior"        Debug.Notification("You have taken " + Guardian)    ENDIF    endFUNCTION    FUNCTION addSign3()    game.AddAchievement(29)    ; // Standard signs    IF(bMage)        game.getPlayer().addSpell(pDoomMageAbility3)        Guardian = "Mage"        Debug.Notification("You have taken " + Guardian)    ELSEIF(bThief)        game.getPlayer().addSpell(pDoomThiefAbility3)        Guardian = "Thief"        Debug.Notification("You have taken " + Guardian)    ELSEIF(bWarrior)        game.getPlayer().addSpell(pDoomWarriorAbility3)        Guardian = "Warrior"        Debug.Notification("You have taken " + Guardian)    ENDIF    endFUNCTION;************************************State waiting    ;do nothingendState;************************************
User avatar
liz barnes
 
Posts: 3387
Joined: Tue Oct 31, 2006 4:10 am

Post » Wed Jun 20, 2012 6:58 am

Instead of using !bmage, !bthief, and !bwarrior, use bmage == false, bthief == false, and bwarrior == false. It's just a feeling, but the best I can come up with.
User avatar
mollypop
 
Posts: 3420
Joined: Fri Jan 05, 2007 1:47 am

Post » Wed Jun 20, 2012 2:16 pm

Well, I finally managed to get it working by using a REALLY long If statement (which I would object to if the script was not an OnActivate script, but since it is, I don't care). Not extremely elegant, but it works.

Spoiler
scriptName doomTKGuardianShrineScript extends ObjectReferenceimport gameimport utilityString property graphVariable auto; //which stone are weBOOL PROPERTY bMage AUTOBOOL PROPERTY bThief AUTOBOOL PROPERTY bWarrior AUTO; //list of the effectsSPELL PROPERTY pDoomMageAbility AUTOSPELL PROPERTY pDoomThiefAbility AUTOSPELL PROPERTY pDoomWarriorAbility AUTOSPELL PROPERTY pDoomMageAbility2 AUTOSPELL PROPERTY pDoomThiefAbility2 AUTOSPELL PROPERTY pDoomWarriorAbility2 AUTOSPELL PROPERTY pDoomMageAbility3 AUTOSPELL PROPERTY pDoomThiefAbility3 AUTOSPELL PROPERTY pDoomWarriorAbility3 AUTO; //list of the messagesMESSAGE PROPERTY pDoomMageMSG AUTOMESSAGE PROPERTY pDoomThiefMSG AUTOMESSAGE PROPERTY pDoomWarriorMSG AUTO; //the already have messageMESSAGE PROPERTY pDoomAlreadyHaveMSG AUTOSTRING PROPERTY Guardian AUTO;************************************BOOL DOONCE=TRUEBOOL GUARDIANTAKEN = FALSEInt Response = -1Auto State base        EVENT onACTIVATE(OBJECTREFERENCE obj)                ; //check to see if the player is the activator and we havent already activated        IF(doOnce && obj AS ACTOR == game.getPlayer())                        doOnce = FALSE                        ; //if we already have the power and this is the stone then kick the player out            ; //if the player's stone selection is not a Charge of their guardian, kick him out            ; //if the player has already selected a Guardian and tries to take another, kick him out            IF(bMage && Guardian == "Mage")                pDoomAlreadyHaveMSG.show()                utility.wait(2)                                doOnce = TRUE            ELSEIF(bThief && Guardian == "Thief")                pDoomAlreadyHaveMSG.show()                utility.wait(2)                                doOnce = TRUE            ELSEIF(bWarrior && Guardian == "Warrior")                pDoomAlreadyHaveMSG.show()                utility.wait(2)                                doOnce = TRUE                            ELSEIF(bMage && game.getPlayer().hasSpell(pDoomWarriorAbility))                debug.MessageBox("The Stone does not respond to your touch")                utility.wait(2)                                doOnce = TRUE            ELSEIF(bMage && game.getPlayer().hasSpell(pDoomWarriorAbility2))                debug.MessageBox("The Stone does not respond to your touch")                utility.wait(2)                                doOnce = TRUE            ELSEIF(bMage && game.getPlayer().hasSpell(pDoomWarriorAbility3))                debug.MessageBox("The Stone does not respond to your touch")                utility.wait(2)                                doOnce = TRUE            ELSEIF(bMage && game.getPlayer().hasSpell(pDoomThiefAbility))                debug.MessageBox("The Stone does not respond to your touch")                utility.wait(2)                                doOnce = TRUE            ELSEIF(bMage && game.getPlayer().hasSpell(pDoomThiefAbility2))                debug.MessageBox("The Stone does not respond to your touch")                utility.wait(2)                                doOnce = TRUE            ELSEIF(bMage && game.getPlayer().hasSpell(pDoomThiefAbility3))                debug.MessageBox("The Stone does not respond to your touch")                utility.wait(2)                                doOnce = TRUE                            ELSEIF(bThief && game.getPlayer().hasSpell(pdoomMageAbility))                debug.MessageBox("The Stone does not respond to your touch")                utility.wait(2)                                doOnce = TRUE            ELSEIF(bThief && game.getPlayer().hasSpell(pdoomMageAbility2))                debug.MessageBox("The Stone does not respond to your touch")                utility.wait(2)                                doOnce = TRUE            ELSEIF(bThief && game.getPlayer().hasSpell(pdoomMageAbility3))                debug.MessageBox("The Stone does not respond to your touch")                utility.wait(2)                                doOnce = TRUE            ELSEIF(bThief && game.getPlayer().hasSpell(pdoomWarriorAbility))                debug.MessageBox("The Stone does not respond to your touch")                utility.wait(2)                                doOnce = TRUE            ELSEIF(bThief && game.getPlayer().hasSpell(pdoomWarriorAbility2))                debug.MessageBox("The Stone does not respond to your touch")                utility.wait(2)                                doOnce = TRUE            ELSEIF(bThief && game.getPlayer().hasSpell(pdoomWarriorAbility3))                debug.MessageBox("The Stone does not respond to your touch")                utility.wait(2)                                doOnce = TRUE                            ELSEIF(bWarrior && game.getPlayer().hasSpell(pDoomMageAbility))                debug.MessageBox("The Stone does not respond to your touch")                utility.wait(2)                                doOnce = TRUE            ELSEIF(bWarrior && game.getPlayer().hasSpell(pDoomMageAbility2))                debug.MessageBox("The Stone does not respond to your touch")                utility.wait(2)                                doOnce = TRUE            ELSEIF(bWarrior && game.getPlayer().hasSpell(pDoomMageAbility3))                debug.MessageBox("The Stone does not respond to your touch")                utility.wait(2)                                doOnce = TRUE            ELSEIF(bWarrior && game.getPlayer().hasSpell(pDoomThiefAbility))                debug.MessageBox("The Stone does not respond to your touch")                utility.wait(2)                                doOnce = TRUE            ELSEIF(bWarrior && game.getPlayer().hasSpell(pDoomThiefAbility2))                debug.MessageBox("The Stone does not respond to your touch")                utility.wait(2)                                doOnce = TRUE            ELSEIF(bWarrior && game.getPlayer().hasSpell(pDoomThiefAbility3))                debug.MessageBox("The Stone does not respond to your touch")                utility.wait(2)                                doOnce = TRUE            ELSE                                                            ; // present them with the choice                ; // Items 1, 2, 3 == Accept, Item 4 == Decline            IF(bMage)                                Response = pDoomMageMSG.Show()                                    IF Response == 0                    addSign1()                                        SELF.playAnimation("playanim01")                                        utility.wait(15)                                        doOnce = TRUE                                    ELSEIF Response == 1                    addSign2()                                        SELF.playAnimation("playanim01")                                        utility.wait(15)                                        DoOnce = TRUE                                    ELSEIF Response == 2                    addSign3()                    SELF.playAnimation("playanim01")                                        utility.wait(15)                                        doOnce = TRUE                                    ELSE                    utility.wait(2)                    doOnce = TRUE                ENDIF                                ELSEIF(bThief)                                Response = pDoomThiefMSG.Show()                                    IF Response == 0                    addSign1()                                        SELF.playAnimation("playanim01")                                        utility.wait(15)                                        doOnce = TRUE                                    ELSEIF Response == 1                    addSign2()                                        SELF.playAnimation("playanim01")                                        utility.wait(15)                                        DoOnce = TRUE                                    ELSEIF Response == 2                    addSign3()                                        SELF.playAnimation("playanim01")                                        utility.wait(15)                                        doOnce = TRUE                                    ELSE                    utility.wait(2)                    doOnce = TRUE                ENDIF                                ELSEIF(bWarrior)                                Response = pDoomWarriorMSG.Show()                                    IF Response == 0                    addSign1()                                        SELF.playAnimation("playanim01")                                        utility.wait(15)                                        doOnce = TRUE                                    ELSEIF Response == 1                    addSign2()                                        SELF.playAnimation("playanim01")                                        utility.wait(15)                                        DoOnce = TRUE                                    ELSEIF Response == 2                    addSign3()                                        SELF.playAnimation("playanim01")                                        utility.wait(15)                                        doOnce = TRUE                                    ELSE                    utility.wait(2)                    doOnce = TRUE                ENDIF                                            ENDIF                    ENDIF    EndIf    endEVENT    endState; //FUNCTION: addSign; //; // adds the sign of the stone to the playerFUNCTION addSign1()    game.AddAchievement(29)    ; // Standard signs    IF(bMage)        game.getPlayer().addSpell(pDoomMageAbility)        Guardian = "Mage"        Debug.Notification("You have taken " + Guardian)    ELSEIF(bThief)        game.getPlayer().addSpell(pDoomThiefAbility)        Guardian = "Thief"        Debug.Notification("You have taken " + Guardian)    ELSEIF(bWarrior)        game.getPlayer().addSpell(pDoomWarriorAbility)        Debug.Notification("You have taken " + Guardian)    ENDIF    endFUNCTION    FUNCTION addSign2()    game.AddAchievement(29)    ; // Standard signs    IF(bMage)        game.getPlayer().addSpell(pDoomMageAbility2)        Guardian = "Mage"        Debug.Notification("You have taken " + Guardian)    ELSEIF(bThief)        game.getPlayer().addSpell(pDoomThiefAbility2)        Guardian = "Thief"        Debug.Notification("You have taken " + Guardian)    ELSEIF(bWarrior)        game.getPlayer().addSpell(pDoomWarriorAbility2)        Guardian = "Warrior"        Debug.Notification("You have taken " + Guardian)    ENDIF    endFUNCTION    FUNCTION addSign3()    game.AddAchievement(29)    ; // Standard signs    IF(bMage)        game.getPlayer().addSpell(pDoomMageAbility3)        Guardian = "Mage"        Debug.Notification("You have taken " + Guardian)    ELSEIF(bThief)        game.getPlayer().addSpell(pDoomThiefAbility3)        Guardian = "Thief"        Debug.Notification("You have taken " + Guardian)    ELSEIF(bWarrior)        game.getPlayer().addSpell(pDoomWarriorAbility3)        Guardian = "Warrior"        Debug.Notification("You have taken " + Guardian)    ENDIF    endFUNCTION;************************************State waiting    ;do nothingendState;************************************
User avatar
Oscar Vazquez
 
Posts: 3418
Joined: Sun Sep 30, 2007 12:08 pm


Return to V - Skyrim