Ordeiberon Posted February 4, 2018 Share Posted February 4, 2018 I've heard you just can't use custom teleport spells meant for use in Cyrodiil when you are in the in the Shivering Isles and Vice Versa. I had planned just to make it a warning in my mod but then noticed a custom SI portal had a check to ensure you transported back and forth cleanly. So I wanted to know if I could easily just add a check to see if the player was in the Isles and cancel the spell. So here is the script that made think it is possible. SCN AASHhome3QS float fQuestDelayTime short button short onece short start short Idou begin gamemode if onece== 0 set fQuestDelayTime to 0.2 set onece to 1 endif if(start==1) MessageBox "AraWelMathi Mad Escape Teleport Activated. Destination Mistress?","AraWelMathi - Private Floor", "AraWelMathi - Outer Court","AraWelMathi - Madness Room","[Cancel Spell]" set start to 0 endif set button to getbuttonpressed if button == 0 set Idou to 1 endif if button == 1 set Idou to 2 endif if button == 2 set Idou to 3 endif if button == 3 set Idou to 0 endif If ( idou == 1 ) Set idou to 0 playSound DRSOblivionGateOpen if ( GetPlayerInSEWorld == 1 ) if ( GetStage SE14 >= 6 ) ;Player.RemoveSpell SE14RezSpell ;Player.RemoveSpell SE14WeatherSpell ;Player.RemoveSpell SELpSummonHaskill endif Player.SCAOnActor setPlayerInSEWorld 0 SEJailMarkerParentTamriel.Enable ; turns ON jail markers in Tamriel, turns OFF jail markers in SE SEJailMarkerCrucible.Disable SEJailMarkerBliss.Disable SEPrisonMarkerAichan.Disable SEPrisonMarkerCorpserot.Disable ReleaseWeatherOverride If Player.GetEquipped TGGrayFoxCowl == 1 Set SECrime.LeftSECowlOn to 1 EndIf endif player.MoveTo AASHMarker11 endif If ( idou == 2 ) Set idou to 0 playSound DRSOblivionGateOpen if ( GetPlayerInSEWorld == 1 ) if ( GetStage SE14 >= 6 ) ;Player.RemoveSpell SE14RezSpell ;Player.RemoveSpell SE14WeatherSpell ;Player.RemoveSpell SELpSummonHaskill endif Player.SCAOnActor setPlayerInSEWorld 0 SEJailMarkerParentTamriel.Enable ; turns ON jail markers in Tamriel, turns OFF jail markers in SE SEJailMarkerCrucible.Disable SEJailMarkerBliss.Disable SEPrisonMarkerAichan.Disable SEPrisonMarkerCorpserot.Disable ReleaseWeatherOverride If Player.GetEquipped TGGrayFoxCowl == 1 Set SECrime.LeftSECowlOn to 1 EndIf endif player.MoveTo AASHMarker12 endif If ( idou == 3 ) Set idou to 0 playSound DRSOblivionGateOpen if ( GetPlayerInSEWorld == 1 ) if ( GetStage SE14 >= 6 ) ;Player.RemoveSpell SE14RezSpell ;Player.RemoveSpell SE14WeatherSpell ;Player.RemoveSpell SELpSummonHaskill endif Player.SCAOnActor setPlayerInSEWorld 0 SEJailMarkerParentTamriel.Enable ; turns ON jail markers in Tamriel, turns OFF jail markers in SE SEJailMarkerCrucible.Disable SEJailMarkerBliss.Disable SEPrisonMarkerAichan.Disable SEPrisonMarkerCorpserot.Disable ReleaseWeatherOverride If Player.GetEquipped TGGrayFoxCowl == 1 Set SECrime.LeftSECowlOn to 1 EndIf endif player.MoveTo AASHmadnessmarker endif end And this was my 2nd attempt. It breaks the teleport function while in Cyrodiil (causing a messagebox loop) so not working. Not sure how to fix SCN AASHhomeQS float fQuestDelayTime short button short onece short start short Idou begin gamemode if onece== 0 set fQuestDelayTime to 0.2 set onece to 1 player.addspell AASHhomespell endif if(start==1) if (GetPlayerInSEWorld == 1) MessageBox "You are in Realm of Sheogorath, and must return to Cyrodiil first.", "I'll find a way back" Set Idou to 0 endif elseif (GetPlayerInSEWorld == 0) MessageBox "AraSelMathi Estates Teleport Activated, Destination, Mistress?", "AraSelMathi - Private Chambers", "AraWelMathi - Outer Court", "AraWelNand - Front Yard", "AraWelAlasilHame - Penthouse", "[Cancel Spell]" set start to 0 endif set button to getbuttonpressed if button == 0 set Idou to 1 endif if button == 1 set Idou to 2 endif if button == 2 set Idou to 3 endif if button == 3 set Idou to 4 endif if button == 4 set Idou to 0 endif If ( idou == 1 ) Set idou to 0 playSound DRSOblivionGateOpen player.MoveTo ORDIzCEsBedMarkerX endif If ( idou == 2 ) Set idou to 0 playSound DRSOblivionGateOpen player.MoveTo AASHMarker12 endif If ( idou == 3 ) Set idou to 0 playSound DRSOblivionGateOpen player.MoveTo ORDWelnandMarkerX endif If ( idou == 4 ) Set idou to 0 playSound DRSOblivionGateOpen player.MoveTo aaORDXmarkerPenthouseRef endif end Link to comment Share on other sites More sharing options...
Ordeiberon Posted February 7, 2018 Author Share Posted February 7, 2018 Still trying to work this out. Any ideas? Link to comment Share on other sites More sharing options...
Moktah Posted February 8, 2018 Share Posted February 8, 2018 (edited) if(start==1) if (GetPlayerInSEWorld == 1) MessageBox "You are in Realm of Sheogorath, and must return to Cyrodiil first.", "I'll find a way back" Set Idou to 0 endif elseif (GetPlayerInSEWorld == 0) MessageBox "AraSelMathi Estates Teleport Activated, Destination, Mistress?", "AraSelMathi - Private Chambers", "AraWelMathi - Outer Court", "AraWelNand - Front Yard", "AraWelAlasilHame - Penthouse", "[Cancel Spell]"set start to 0endif Remove the 'endif' in the middleI'd write it like so... if start if GetPlayerInSEWorld MessageBox "You are in Realm of Sheogorath, and must return to Cyrodiil first.", "I'll find a way back" Set Idou to 0 else MessageBox "AraSelMathi Estates Teleport Activated, Destination, Mistress?", "AraSelMathi - Private Chambers", "AraWelMathi - Outer Court", "AraWelNand - Front Yard", "AraWelAlasilHame - Penthouse", "[Cancel Spell]" set start to 0endif Not sure where your variable "start" was set to one thoughassuming its either a one or zerothats why I changed to code to...if startwhich is the same as sayingif start == 1 Need to know more about that variable to fix your messageloopI see where the loop is, and haven't fixed that part just yet.Is this a script attached to an object/activator?IF you want to tinker round with it based on my guess as to how your script is meant to work.you can try moving the..set start to 0to after the endif just keep in mind, I'm only guessing at what you are trying to do. also on a side note:changed to an 'else' rather than an elseifsince you are either there or you are not. Edited February 8, 2018 by Moktah Link to comment Share on other sites More sharing options...
Ordeiberon Posted February 8, 2018 Author Share Posted February 8, 2018 if(start==1) if (GetPlayerInSEWorld == 1) MessageBox "You are in Realm of Sheogorath, and must return to Cyrodiil first.", "I'll find a way back" Set Idou to 0 endif elseif (GetPlayerInSEWorld == 0) MessageBox "AraSelMathi Estates Teleport Activated, Destination, Mistress?", "AraSelMathi - Private Chambers", "AraWelMathi - Outer Court", "AraWelNand - Front Yard", "AraWelAlasilHame - Penthouse", "[Cancel Spell]"set start to 0endif Remove the 'endif' in the middleI'd write it like so... if start if GetPlayerInSEWorld MessageBox "You are in Realm of Sheogorath, and must return to Cyrodiil first.", "I'll find a way back" Set Idou to 0 else MessageBox "AraSelMathi Estates Teleport Activated, Destination, Mistress?", "AraSelMathi - Private Chambers", "AraWelMathi - Outer Court", "AraWelNand - Front Yard", "AraWelAlasilHame - Penthouse", "[Cancel Spell]" set start to 0endif Not sure where your variable "start" was set to one thoughassuming its either a one or zerothats why I changed to code to...if startwhich is the same as sayingif start == 1 Need to know more about that variable to fix your messageloopI see where the loop is, and haven't fixed that part just yet.Is this a script attached to an object/activator?IF you want to tinker round with it based on my guess as to how your script is meant to work.you can try moving the..set start to 0to after theendif just keep in mind, I'm only guessing at what you are trying to do. also on a side note:changed to an 'else' rather than an elseifsince you are either there or you are not. Tried yours but the loop remains. This is a quest script that is start enabled. So not sure why it seems the use of the else statement breaks the remaining script (selecting a destination does nothing) and it just runs the first if statement over and over again (like it does with all start game enabled scripts). Why it doesn't just run once or only run when cast I do not know. Maybe such a choice can't be done in game mode? Current attempt with loop. If I ; out the first choice it works again. SCN AASHhomeQS float fQuestDelayTime short button short onece short start short Idou begin gamemode if onece== 0 set fQuestDelayTime to 0.2 set onece to 1 player.addspell AASHhomespell endif if(start==1) if (GetPlayerInSEWorld == 1) Message "You are in the Realm of Sheogorath. You must return to Cyrodiil first." Set Idou to 0 endif else MessageBox "AraSelMathi Estates Teleport Activated, Destination, Mistress?", "AraSelMathi - Private Chambers", "AraWelMathi - Outer Court", "AraWelNand - Front Yard", "AraWelAlasilHame - Penthouse", "[Cancel Spell]" set start to 0 endif set button to getbuttonpressed if button == 0 set Idou to 1 endif if button == 1 set Idou to 2 endif if button == 2 set Idou to 3 endif if button == 3 set Idou to 4 endif if button == 4 set Idou to 0 endif If ( idou == 1 ) Set idou to 0 playSound DRSOblivionGateOpen player.MoveTo ORDIzCEsBedMarkerX endif If ( idou == 2 ) Set idou to 0 playSound DRSOblivionGateOpen player.MoveTo AASHMarker12 endif If ( idou == 3 ) Set idou to 0 playSound DRSOblivionGateOpen player.MoveTo ORDWelnandMarkerX endif If ( idou == 4 ) Set idou to 0 playSound DRSOblivionGateOpen player.MoveTo aaORDXmarkerPenthouseRef endif end I also found this other teleport script that works as a magic script that uses different script blocks, and seems to stall the character for a second on walking. Scriptname aaORDAraSelMathiTeleportScript Short Choosing Short Choice Begin ScriptEffectStart ;if ( player.IsInCombat == 1 ) ;message "You cannot cast this spell during combat" ;Set Choosing to 0 if (GetPlayerInSEWorld) message "Sheogorath likes it when people use his door" Set Choosing to 0 else Set Choosing to -1 endif End Begin ScriptEffectUpdate If (Choosing == -1) ;Display your menu Messagebox "AraSelMathi Within Teleport activated. Destination, Mistress?", "AuraSel - Throne Hall", "RielleSel - Beauties' Hall", "RielleAraSel - Private Queen's Hall", "Ageasel - Mages' Hall", "PelinSel - Fighters' Hall", "Lorsel - Storage Hall", "[Cancel Spell]" Set Choosing to 1 Set Choice to GetButtonPressed Elseif (Choosing == 1) If (Choice == -1) ;No choice yet Set Choice to GetButtonPressed Elseif (Choice == 0) ;Throne room Player.MoveTo HTBAranmathiAuraselMarker Set Choosing to 0 Elseif (Choice == 1) ;Treasury Player.MoveTo HTBAranmathiRielleselMarker Set Choosing to 0 Elseif (Choice == 2) ;Private Player.MoveTo HTBAranmathiRelleselMarker Set Choosing to 0 Elseif (Choice == 3) ;Mages Player.MoveTo HTBAranmathiAgeaselMarker Set Choosing to 0 Elseif (Choice == 4) ;Warriors Player.MoveTo HTBAranmathiNagaselMarker Set Choosing to 0 Elseif (Choice == 5) ;Storage Player.MoveTo HTBAranmathiLorselMarker Set Choosing to 0 Elseif (Choice == 6) ;Cancel Set Choosing to 0 EndIf ElseIf (Choosing == 0) Player.Dispel HTBAranmathiTeleportSpell; Endif End Link to comment Share on other sites More sharing options...
Moktah Posted February 8, 2018 Share Posted February 8, 2018 (edited) the variable 'start' defaults to a value of zero if(start==1) <- this IF statement is FALSE so it starts reading code and looking for an ENDIF, ELSEIF, ELSE or another IF statement if (GetPlayerInSEWorld == 1) <- it finds this IF statement and starts looking for an ENDIF, ELSEIF, ELSE (to close the IF/ENDIF statement) or another IF statement (which we don't have) Message "You are in the Realm of Sheogorath. You must return to Cyrodiil first." <-this gets read, but not acted upon. Still looking for the end of the IF statement Set Idou to 0 <- this gets read, but ignored endif <- alright, it found the end of the IF statement. Now it goes back to acting upon code else <- Since the first IF failed its test. We are going to do the next code. MessageBox "AraSelMathi Estates..... " <- It shows you the MessageBoxset start to 0 <- the 'start' variable still equals zeroendif <- and we find the ENDIF that closes out our IF/ENDIF statement Since this is a quest script. we run again, again, again, again.and show the same messagebox over and over and over adjusting the spacing of the code can help in viewing these multiple IF/ENDIF statements if(start==1) if (GetPlayerInSEWorld == 1) Message "You are in the Realm of Sheogorath. You must return to Cyrodiil first." Set Idou to 0 endif else MessageBox "AraSelMathi Estates..... " set start to 0endif Here's the originalif(start==1) if (GetPlayerInSEWorld == 1) Message "You are in the Realm of Sheogorath. You must return to Cyrodiil first." Set Idou to 0 endif elseif (GetPlayerInSEWorld == 0) MessageBox "AraSelMathi Estates..... " set start to 0endif Edited February 8, 2018 by Moktah Link to comment Share on other sites More sharing options...
Ordeiberon Posted February 9, 2018 Author Share Posted February 9, 2018 Ah so If I understand, the double if statements are the problem. The start quest enabled forces the script to run. Normally it runs, finds a false if, set start to 0 anyway and ends. By adding the second if I gave a another loop it could keep running and not finishing properly. So perhaps if I make the qualifiers on the same line? like this? EDIT: Yes this solves the issue and the loop is no longer a problem. I have my fix. Thank you All! SCN AASHhomeQS float fQuestDelayTime short button short onece short start short Idou begin gamemode if onece== 0 set fQuestDelayTime to 0.2 set onece to 1 player.addspell AASHhomespell player.addspell HTBAranmathiTeleportSpell endif if(start==1) && (GetPlayerInSEWorld == 1) Message "You are in the Realm of Sheogorath. You must return to Cyrodiil first." set start to 0 elseif (start==1) && (GetPlayerInSEWorld == 0) MessageBox "AraSelMathi Estates Teleport Activated, Destination, Mistress?", "AraSelMathi - Private Chambers", "AraWelMathi - Outer Court", "AraWelNand - Front Yard", "AraWelAlasilHame - Penthouse", "[Cancel Spell]" set start to 0 endif set button to getbuttonpressed if button == 0 set Idou to 1 endif if button == 1 set Idou to 2 endif if button == 2 set Idou to 3 endif if button == 3 set Idou to 4 endif if button == 4 set Idou to 0 endif If ( idou == 1 ) Set idou to 0 playSound DRSOblivionGateOpen player.MoveTo ORDIzCEsBedMarkerX endif If ( idou == 2 ) Set idou to 0 playSound DRSOblivionGateOpen player.MoveTo AASHMarker12 endif If ( idou == 3 ) Set idou to 0 playSound DRSOblivionGateOpen player.MoveTo ORDWelnandMarkerX endif If ( idou == 4 ) Set idou to 0 playSound DRSOblivionGateOpen player.MoveTo aaORDXmarkerPenthouseRef endif end the variable 'start' defaults to a value of zero if(start==1) <- this IF statement is FALSE so it starts reading code and looking for an ENDIF, ELSEIF, ELSE or another IF statement if (GetPlayerInSEWorld == 1) <- it finds this IF statement and starts looking for an ENDIF, ELSEIF, ELSE (to close the IF/ENDIF statement) or another IF statement (which we don't have) Message "You are in the Realm of Sheogorath. You must return to Cyrodiil first." <-this gets read, but not acted upon. Still looking for the end of the IF statement Set Idou to 0 <- this gets read, but ignored endif <- alright, it found the end of the IF statement. Now it goes back to acting upon code else <- Since the first IF failed its test. We are going to do the next code. MessageBox "AraSelMathi Estates..... " <- It shows you the MessageBoxset start to 0 <- the 'start' variable still equals zeroendif <- and we find the ENDIF that closes out our IF/ENDIF statement Since this is a quest script. we run again, again, again, again.and show the same messagebox over and over and over adjusting the spacing of the code can help in viewing these multiple IF/ENDIF statements if(start==1) if (GetPlayerInSEWorld == 1) Message "You are in the Realm of Sheogorath. You must return to Cyrodiil first." Set Idou to 0 endif else MessageBox "AraSelMathi Estates..... " set start to 0endif Here's the originalif(start==1) if (GetPlayerInSEWorld == 1) Message "You are in the Realm of Sheogorath. You must return to Cyrodiil first." Set Idou to 0 endif elseif (GetPlayerInSEWorld == 0) MessageBox "AraSelMathi Estates..... " set start to 0endif Link to comment Share on other sites More sharing options...
Moktah Posted February 9, 2018 Share Posted February 9, 2018 apologieswas a bit quick to rush to an answernow that I'm looking at it a bit closergonna take a stab at it and you can see if it works out. when you use a magic script, it does like what you mentioned about the pauseI call it studder stepWhat you could do is set it up for a token.lets say a magic stone in your inventoryI've seen the tutorial for it but haven't played around with it myself.Maybe the following changes to your code might help open up the possibilities for ya.((its all just a rough draft and I haven't tested it. I normally have to do a ton of trial anderror after thinking the code looks perfectly fine))Here's that tutorial by the way.https://cs.elderscrolls.com/index.php?title=MessageBox_Tutorial/Token_Scripts SCN AASHhomeQSfloat fQuestDelayTimeshort buttonshort oneceshort start begin onadd set start to 1endbegin gamemode if onece== 0 ; <- this section will need to be moved to a quest script though. don't think it would use the fQuestDelayTime if you did the 'token script' set fQuestDelayTime to 0.2 set onece to 1 player.addspell AASHhomespell endif ;Display appropriate messagebox if start if GetPlayerInSEWorld MessageBox "You are in Realm of Sheogorath, and must return to Cyrodiil first.", "I'll find a way back" set start to 0 return else MessageBox "AraSelMathi Estates Teleport Activated, Destination, Mistress?", "AraSelMathi - Private Chambers", "AraWelMathi - Outer Court", "AraWelNand - Front Yard", "AraWelAlasilHame - Penthouse", "[Cancel Spell]" set start to 2 endif endif ;Watch for button pressed in messagebox if start == 2 set button to getbuttonpressed if button == -1 ;no button pushed yet. keep watching for it return elseif button == 4 ;cancelled spell set start to 0 return else set start to 3 endif endif ;A spell was selected. Lets stop watching for buttons being pressed in the messagebox and focus on firing off the teleport sounds and destination if start == 3 playSound DRSOblivionGateOpen If button == 0 player.MoveTo ORDIzCEsBedMarkerX elseif button == 1 player.MoveTo AASHMarker12 esleIf button == 2 player.MoveTo ORDWelnandMarkerX elseIf button == 3 player.MoveTo aaORDXmarkerPenthouseRef endif set start to 0 endifend Link to comment Share on other sites More sharing options...
Ordeiberon Posted February 9, 2018 Author Share Posted February 9, 2018 Thanks. Your original insight was enough to solve it. See my revised script above. Also I realize one of the examples I posted above (aaORDAraSelMathiTeleportScript) would have solved the issue within a magic script but would have involved rewriting the original script to match the new format. Not sure which is more stable. The magic script seems more efficient, but most of the spells i've worked with use quest scripts. EDIT: I reread and understand your mention of the shudder step with magic scripts. Guess, all the more reason to leave the quest scripts alone. apologieswas a bit quick to rush to an answernow that I'm looking at it a bit closergonna take a stab at it and you can see if it works out. when you use a magic script, it does like what you mentioned about the pauseI call it studder stepWhat you could do is set it up for a token.lets say a magic stone in your inventoryI've seen the tutorial for it but haven't played around with it myself.Maybe the following changes to your code might help open up the possibilities for ya.((its all just a rough draft and I haven't tested it. I normally have to do a ton of trial anderror after thinking the code looks perfectly fine))Here's that tutorial by the way.https://cs.elderscrolls.com/index.php?title=MessageBox_Tutorial/Token_Scripts SCN AASHhomeQSfloat fQuestDelayTimeshort buttonshort oneceshort start begin onadd set start to 1endbegin gamemode if onece== 0 ; <- this section will need to be moved to a quest script though. don't think it would use the fQuestDelayTime if you did the 'token script' set fQuestDelayTime to 0.2 set onece to 1 player.addspell AASHhomespell endif ;Display appropriate messagebox if start if GetPlayerInSEWorld MessageBox "You are in Realm of Sheogorath, and must return to Cyrodiil first.", "I'll find a way back" set start to 0 return else MessageBox "AraSelMathi Estates Teleport Activated, Destination, Mistress?", "AraSelMathi - Private Chambers", "AraWelMathi - Outer Court", "AraWelNand - Front Yard", "AraWelAlasilHame - Penthouse", "[Cancel Spell]" set start to 2 endif endif ;Watch for button pressed in messagebox if start == 2 set button to getbuttonpressed if button == -1 ;no button pushed yet. keep watching for it return elseif button == 4 ;cancelled spell set start to 0 return else set start to 3 endif endif ;A spell was selected. Lets stop watching for buttons being pressed in the messagebox and focus on firing off the teleport sounds and destination if start == 3 playSound DRSOblivionGateOpen If button == 0 player.MoveTo ORDIzCEsBedMarkerX elseif button == 1 player.MoveTo AASHMarker12 esleIf button == 2 player.MoveTo ORDWelnandMarkerX elseIf button == 3 player.MoveTo aaORDXmarkerPenthouseRef endif set start to 0 endifend Link to comment Share on other sites More sharing options...
Moktah Posted February 9, 2018 Share Posted February 9, 2018 Glad to have helped ya out. by the way.... now that I proofread that last little bit of codeI see a mistake I madehere's the correction if start == 1 ; <- If Start would have worked fine if it was just going to be equal to one or zero, but since I changed it to hold different values, it needed to watch for a particular value. if GetPlayerInSEWorld MessageBox "You are in Realm of Sheogorath, and must return to Cyrodiil first.", "I'll find a way back" set start to 0 return else MessageBox "AraSelMathi Estates Teleport Activated, Destination, Mistress?", "AraSelMathi - Private Chambers", "AraWelMathi - Outer Court", "AraWelNand - Front Yard", "AraWelAlasilHame - Penthouse", "[Cancel Spell]" set start to 2 endif endif Link to comment Share on other sites More sharing options...
Ordeiberon Posted February 9, 2018 Author Share Posted February 9, 2018 Very cool, thanks. Glad to have helped ya out. by the way.... now that I proofread that last little bit of codeI see a mistake I madehere's the correction if start == 1 ; <- If Start would have worked fine if it was just going to be equal to one or zero, but since I changed it to hold different values, it needed to watch for a particular value. if GetPlayerInSEWorld MessageBox "You are in Realm of Sheogorath, and must return to Cyrodiil first.", "I'll find a way back" set start to 0 return else MessageBox "AraSelMathi Estates Teleport Activated, Destination, Mistress?", "AraSelMathi - Private Chambers", "AraWelMathi - Outer Court", "AraWelNand - Front Yard", "AraWelAlasilHame - Penthouse", "[Cancel Spell]" set start to 2 endif endif Link to comment Share on other sites More sharing options...
Recommended Posts