Kolagon Posted April 3, 2017 Share Posted April 3, 2017 (edited) I'd like for someone to make a spell that teleports you to a random forte, cave, ayleid ruin, etc, vanilla only, no DLCs. Basically, I like adventuring, but it's a bit of a hassle needing to find those places, oh sure I could use console code, but it would be more fun if you don't expect which dungeon you'll end up at via spell. Edited April 3, 2017 by Kolagon Link to comment Share on other sites More sharing options...
Surilindur Posted April 4, 2017 Share Posted April 4, 2017 (edited) Maybe something like this would work (not tested, just an idea). A quest script: scriptname YourPrefixQuestScript array_var TeleportTargetList short ListReady ; <-- set to 0 to rebuild the list on next save load begin _MenuMode 1044 ; I think it was 1044 the main menu if ( GetGameRestarted ) seteventhandler "PostLoadGame" YourPrefixPostLoadGameHandler endif end The OBSE event handler (user-created function script, of type object script, yet not attached to anything): scriptname YourPrefixPostLoadGameHandler short Success begin _Function { Success } if eval !( Success ) || ( YourPrefixQuest.ListReady ) return endif let YourPrefixQuest.ListReady := 1 if eval ( ( ar_Size YourPrefixQuest.TeleportTargetList ) > -1 ) ; the ar_Erase should erase the whole array according to documentation? ar_Erase YourPrefixQuest.TeleportTargetList else let YourPrefixQuest.TeleportTargetList := ar_Construct "Array" endif ; appending the elements ar_Append YourPrefixQuest.TeleportTargetList SomeTeleportMarkerRef ar_Append YourPrefixQuest.TeleportTargetList OtherTeleportMarkerRef .... ar_Append YourPrefixQuest.TeleportTargetList FinalTeleportMarkerRef end The spell script which would select a random marker from the list: scriptname YourPrefixSpellScript short i begin _ScriptEffectFinish ; the one below should pick a random integer from [0, <size-of-list> - 1] ; also, the call to "Floor" might be unnecessary when/if Oblivion ; discards the part 'after the dot' in the float let i := Floor ( Rand 0 ( ar_Size YourQuestPrefix.TeleportTargetList ) ) PlayerRef.MoveTo YourQuestPrefix.TeleportTargetList[i] end It is obviously not the best possible solution, and I have not tested if it compiles (it should, as far as I know), but to give you some sort of an idea of what it could maybe look like. Another option is to use a group of if-elseif-elseif-...-else-endif statements only in the spell itself, although that one already sounds a bit too heavy (as in, too much writing). Hopefully that helps a bit. If you have any questions, feel free to ask. I will try to answer when I have the time. :thumbsup: Edit: Also, if someone has a better idea on how to do it, just post it. The simpler, the better (and less prone to errors). :smile: Edit 2: I wanted to put them in spoilers, not quotes. :facepalm: Fixed that. Edited April 4, 2017 by Contrathetix Link to comment Share on other sites More sharing options...
Kolagon Posted September 8 Author Share Posted September 8 On 4/4/2017 at 11:04 AM, Surilindur said: Maybe something like this would work (not tested, just an idea). A quest script: Reveal hidden contents scriptname YourPrefixQuestScript array_var TeleportTargetList short ListReady ; <-- set to 0 to rebuild the list on next save load begin _MenuMode 1044 ; I think it was 1044 the main menu if ( GetGameRestarted ) seteventhandler "PostLoadGame" YourPrefixPostLoadGameHandler endif end The OBSE event handler (user-created function script, of type object script, yet not attached to anything): Reveal hidden contents scriptname YourPrefixPostLoadGameHandler short Success begin _Function { Success } if eval !( Success ) || ( YourPrefixQuest.ListReady ) return endif let YourPrefixQuest.ListReady := 1 if eval ( ( ar_Size YourPrefixQuest.TeleportTargetList ) > -1 ) ; the ar_Erase should erase the whole array according to documentation? ar_Erase YourPrefixQuest.TeleportTargetList else let YourPrefixQuest.TeleportTargetList := ar_Construct "Array" endif ; appending the elements ar_Append YourPrefixQuest.TeleportTargetList SomeTeleportMarkerRef ar_Append YourPrefixQuest.TeleportTargetList OtherTeleportMarkerRef .... ar_Append YourPrefixQuest.TeleportTargetList FinalTeleportMarkerRef end The spell script which would select a random marker from the list: Reveal hidden contents scriptname YourPrefixSpellScript short i begin _ScriptEffectFinish ; the one below should pick a random integer from [0, <size-of-list> - 1] ; also, the call to "Floor" might be unnecessary when/if Oblivion ; discards the part 'after the dot' in the float let i := Floor ( Rand 0 ( ar_Size YourQuestPrefix.TeleportTargetList ) ) PlayerRef.MoveTo YourQuestPrefix.TeleportTargetList[i] end It is obviously not the best possible solution, and I have not tested if it compiles (it should, as far as I know), but to give you some sort of an idea of what it could maybe look like. Another option is to use a group of if-elseif-elseif-...-else-endif statements only in the spell itself, although that one already sounds a bit too heavy (as in, too much writing). Hopefully that helps a bit. If you have any questions, feel free to ask. I will try to answer when I have the time. Edit: Also, if someone has a better idea on how to do it, just post it. The simpler, the better (and less prone to errors). Edit 2: I wanted to put them in spoilers, not quotes. :facepalm: Fixed that. GAH! I'm so sorry, I didn't know anyone replied to this old request of mine. As for the idea, it can work as long as it teleports me to a dungeon's entrance so I can explore it, clear it, return to entrance, use the item or spell, and just keep doing it. I just love dungeon exploration, getting treasure, fighting mobs, etc. Link to comment Share on other sites More sharing options...
Surilindur Posted September 8 Share Posted September 8 No problem! I guess the teleport marker would need to be the entrance one, then, or some other way to get the door marker would have to be used. Also, after looking at the scripts I posted years ago, I doubt they will work since the menu mode block uses 'main menu' and I think quests are not even running at that point. Link to comment Share on other sites More sharing options...
Kolagon Posted September 8 Author Share Posted September 8 13 hours ago, Surilindur said: No problem! I guess the teleport marker would need to be the entrance one, then, or some other way to get the door marker would have to be used. Also, after looking at the scripts I posted years ago, I doubt they will work since the menu mode block uses 'main menu' and I think quests are not even running at that point. Considering its been seven years, you may have gotten better at your scripting? Link to comment Share on other sites More sharing options...
Oblivionaddicted Posted September 10 Share Posted September 10 (edited) On 9/8/2024 at 2:44 AM, Kolagon said: GAH! I'm so sorry, I didn't know anyone replied to this old request of mine. As for the idea, it can work as long as it teleports me to a dungeon's entrance so I can explore it, clear it, return to entrance, use the item or spell, and just keep doing it. I just love dungeon exploration, getting treasure, fighting mobs, etc. You should like Repeatable Oblivion quests then since i notably added a treasure hunt. Edited September 11 by Oblivionaddicted Link to comment Share on other sites More sharing options...
Kolagon Posted September 13 Author Share Posted September 13 Repeatable quests? but will each quest lead to a different dungeon? Link to comment Share on other sites More sharing options...
Oblivionaddicted Posted September 13 Share Posted September 13 12 hours ago, Kolagon said: Repeatable quests? but will each quest lead to a different dungeon? The dungeon is randomly selected among 192 for the treasure hunt. Link to comment Share on other sites More sharing options...
Kolagon Posted September 19 Author Share Posted September 19 Alright awesome, thanks, I'll give it a go. Link to comment Share on other sites More sharing options...
Recommended Posts