Angahran Posted November 3, 2022 Posted November 3, 2022 I'm trying to do something that sounds simple but it's apparently not because I can't get it to work I have a script from a mod that teleports the player to a cell when an item is equipped and returns them to their original location when it is unequipped. Haven Bag Campsite Scriptname HavenBagTeleport extends activemagiceffect ObjectReference Property Marking Auto ObjectReference Property HavenBagMarker Auto Cell Property HavenBag Auto objectReference property BagItem auto {Point explicity to the unique, placed reference of the bag in the world} EVENT OnEffectStart ( Actor Target, Actor Caster ) if (Caster.GetParentCell() != HavenBag) Marking.MoveTo (Caster) Caster.MoveTo (HavenBagMarker) Endif EndEvent EVENT onEffectFinish ( Actor Target, Actor Caster ) if (Caster.GetParentCell() == HavenBag) Caster.Moveto (Marking) if caster.getItemCount(BagItem) < 1 ; safety catch - if the player dropped the bag in the sanctuary, add it to inventory so it doesn't get lost. caster.addItem(BagItem) endif endif EndEvent I'm trying to simply change the cell this teleports to to be the Magical Dollhouse from this mod, https://www.nexusmods.com/skyrimspecialedition/mods/54109 This is the 'teleport' script from the dollhouse mod. I thought it would be relatively simple to find where this mod was teleporting to and paste that into the bag script but it doesn't appear to work. scriptName JLTeleportPlayer extends ActiveMagicEffect objectreference property DollhouseActiRef auto Bool Ready = true function OnEffectStart(Actor akTarget, Actor akCaster) if Ready Ready = false game.GetPlayer().MoveTo(DollhouseActiRef, 100 as Float, 100 as Float, 10 as Float, true) utility.Wait(1.00000) Ready = true endIf endFunction If anyone could help me with what I'm doing wrong it would be appreciated. Thank you.
traison Posted November 3, 2022 Posted November 3, 2022 (edited) 2 hours ago, Angahran said: can't get it to work Have you tried turning it off, and back on again? Edit: What do you mean doesn't work? Does it teleport you somewhere, but not where you expected? Did your character turn purple and grow bunny ears and fluffy tail? Nothing happened? When in doubt, add more debug notifications: Scriptname HavenBagTeleport extends activemagiceffect ObjectReference Property Marking Auto ObjectReference Property HavenBagMarker Auto Cell Property HavenBag Auto objectReference property BagItem auto {Point explicity to the unique, placed reference of the bag in the world} EVENT OnEffectStart ( Actor Target, Actor Caster ) Debug.Notification("OnEffectStart") EndEvent EVENT onEffectFinish ( Actor Target, Actor Caster ) Debug.Notification("onEffectFinish") EndEvent Edited November 3, 2022 by traison 1
Angahran Posted November 11, 2022 Author Posted November 11, 2022 1. Yes I tried turning it off and on again 2. When I tried equipping/unequipping the item the script was attached to nothing happened. I did finally figure it out. The fact that 'properties' for the script are not actually stored in the script is what threw me Once I dug into creation kit to look at how the existing script was working I found the properties and that gave me enough of a hint to figure out how to get mine working. So, now I have a handy dandy 'Dollhouse Doll' that teleports me to the dollhouse when I equip it and returns me to where I came from when I unequip it. Scriptname JLDollHouseTeleport extends activemagiceffect ObjectReference Property Marking Auto ObjectReference Property DollHouseMarker Auto Cell Property DollHouse Auto objectReference property DollHouseItem auto EVENT OnEffectStart ( Actor Target, Actor Caster ) if (Caster.GetParentCell() != DollHouse) Marking.MoveTo (Caster) Caster.MoveTo (DollHouseMarker) Endif EndEvent EVENT onEffectFinish ( Actor Target, Actor Caster ) if (Caster.GetParentCell() == DollHouse) Caster.Moveto (Marking) if caster.getItemCount(DollHouseItem) < 1 caster.addItem(DollHouseItem) endif endif EndEvent MGKDH.esp jldollhouseteleport.pex
traison Posted November 11, 2022 Posted November 11, 2022 To get properties to refresh on scripts, one bruteforce way is to delete the script instance from the save file using something like ReSaver. I've recently used that to "reset" properties on trigger boxes in a cell I've created. Good idea? dunno, works well during development though.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now