Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

LinkedRefChain causes CTD on re-enter cell !! :(


Leianne
 Share

Recommended Posts

My script works beautifully - however once I leave the cell where I've implemented the script and then re-enter the cell I get a CTD every time.  I've narrowed it down to this one script I wrote - :(  I've tried debugging it - however it doesn't show any abnormal persistence so I can't find what's causing the crash.  I was thinking it's a memory problem with possible script run-on but I can't see any loops that aren't closed.

Please, please if someone could help me?  I've re-written any number of ways using DisableLinkRef / EnableLinkRef - using each object ref in an if/else ... still gives me CTD on re-enter cell.

 

Here's my script:

 

 

Scriptname OVQShowerActivater extends ObjectReference 
Actor Property PlayerREF Auto ; Most efficient way to refer to the player
ObjectReference Property ShowerPuddle Auto
ObjectReference Property ShowerFX Auto 
ObjectReference Property ShowerWater Auto 
ObjectReference Property ShowerSound Auto 
ObjectReference Property ShowerLight Auto
ObjectReference Property ShowerButton Auto 
 
Event OnActivate(ObjectReference akActionRef)
     if akActionRef == PlayerREF 
        ObjectReference TempRef = GetLinkedRef()
        while (TempRef != Self && TempRef != None)
            PerformActionOn(TempRef)
            TempRef = TempRef.GetLinkedRef()
        endwhile
        TempRef = None
    endif
EndEvent
 
Function PerformActionOn(ObjectReference Target)
     if Target.IsEnabled()
         Target.Disable()
     else
         Target.Enable()
    endif
EndFunction
Edited by InsanitySorrow
added codebox
Link to comment
Share on other sites

Its my uninformed thoughts that the script you have above would not cause the game to CTD when entering the cell.

It simply will not run until its 'activated'. Unless its still running when you activated it the first time. You do have a 'while' loop in there.

And I thought 'self' did not work, so it would always be '!='.

And since your defining 'tempref' in the event instead of after the scriptname, it may have problems on re-entering the cell?

 

It looks to me like your trying to make the script more complex than it needs to be. Why have a loop, and why call a function?

 

Just place an xmarker, and parent linkage all the items you want to enable or disable to the xmarker. Then in your script, just enable or disable the xmarker and all the items parented to the xmarker will automatically enable or disable, depending on how you linked it to the xmarker.

Link to comment
Share on other sites

I apologize for the delay in responding - I just got home from work.

I really appreciate your response!  Thank you.  I tried what you suggested (see script below) and again, it works just like my script; in that it enables/disables all objects exactly as it should.  The script below, sorry to say - ALSO causes a CTD upon re-entering the cell after having activated the script at least once.  I do know it's this script - because if I remove it, there are NO CTD's no matter how many times I enter/exit the cell.  Also if I DO NOT activate the script - again, I can enter/exit the cell many many times with no CTD. 

As soon as I have activated this script ONCE I get a CTD upon trying to RE-ENTER this cell.

If you have any other ideas, I would welcome them gladly!

 

Scriptname OVQShowerActivater extends ObjectReference

Actor Property PlayerREF Auto

ObjectReference Property OVXMarker Auto ;xmarker as parent

ObjectReference Property ShowerButton Auto ;button activator

 

Event OnActivate(ObjectReference akActionRef)

     if akActionRef == PlayerREF

          if OVXMarker.IsDisabled() ;if the xmarker is disabled

             OVXMarker.Enable() ;enable it and it's children

          else

             OVXMarker.Disable() ;if enabled - disable and it's children

          endif

     endif

EndEvent

Link to comment
Share on other sites

Comment out this line and try again. (comment out the endif as well)

 if akActionRef == PlayerREF

You may not have PlayerREF linked correctly.

 

Plus, are you sure your using a clean save game? If your using a dirty save game, that would override the change you just did to the script, and it could try to run the old and the new script.

Link to comment
Share on other sites

LOL okay, I commented out my playerREF - and ran in and out of the cell mutiple times ... it took at least 5 times, but it did CTD LOL .. I do test my stuff extensively. ... any other ideas at all?  It's SUCH a simple script!!!! arrrghhh.

Link to comment
Share on other sites

Okay, tried a new character - ran in and out of the 'room' multiple time (8) activated the script twice during the trial and it CTD'd on the 8th entrance to the cell.  So far, that's the longest it's held out.  I have actively been able to enter/exit the cell with no CTD 20+ times successively.  Starting to think I can't have the shower turn on and off :(

Link to comment
Share on other sites

Moving between cells quickly can also cause CTD issues.

Having a lot of mods (10+) can cause CTD issues.

 

The script simply cannot be the problem. It runs once, with no loops and will not run again until you activate it.

It could be one of the objects. Are you using any non-vanilla objects?

Link to comment
Share on other sites

Yes, in the cell I have 90 + new objects - however, the CTD completely disappears when I disable that ONE script :(  I use formlists for those other objects and I've added functioning objects/formlists to that cell that work AFTER having the shower script in there ... so am not sure why this one item can cause a problem unless there is a memory leak somehow - even went so far as to change my page size on my computer to allow unbelievably large memory allotments

Link to comment
Share on other sites

I think I'm going to try changing the memory allocation in the ini file ... see if that helps - if it does, I won't be able to use the script, as I can't very well ask users to change their ini files as well :( so am almost hoping it doesn't work.

Link to comment
Share on other sites

Well WilleSea - I certainly appreciate all the help you've tried giving me ... I agree with you completely that it doesn't make any sense for this script to have memory problems .. but it IS somehow the root of the problem here. *sigh*  I may have to settle for a shower I can never turn off - hate wasting water!!  silly of me.  I've made a crafting butter churn (you can make cream, cheese and butter) with no difficulties - I've made a goat you can milk and over 100 original containers/items with no problems.  It's a shame this one may not work out.

Link to comment
Share on other sites

I have a shower that is enabled and disabled with a trigger zone.

As for CTD, I seriously would not worry about it. The game crashes, often.

And testing 'entering' the cell multiple times until it does crash in my mind does not prove anything, especially after 10 times. People know the game crashes, you just restart the game and continue on with playing. If it were a consistent CTD every time you entered the cell, that would be different. I could probably enter that cell 100 times with no CTD with my minimal game setup.

Link to comment
Share on other sites

This is my first mod, it's version three and I've learned papyrus, nifscope, blender, gimp and creation kit manipulation in three weeks - so a lot of work has gone into overcoming the learning curve and getting things right.  My mannequins do NOT leave their pedestals and are not glitchy at all .. my navmeshes and bindings are a thing of beauty (lol) .. I have collision barriers to prevent wildlife and stable occupants from getting stuck in the stable walls ... every one of my containers are havok proof, I even shot arrows into my bee hive and set it on fire to see if it would stay in the tree :)

 

I have a trigger zone for milking the goat (and limited his wandering radius) and a trigger zone for setting up this room addition's decor specific for every race in Skyrim (which is SO cool!) - however, I have about 45 mods I use - and my game never ... never crashes. I feel it would negate a lot of these accomplishments releasing something I knew was inferior/faulty. *sigh* .. 'A' type personality thing I think.  As a programmer I know the only way a program fails to run perfectly every time, is because it's written poorly/incorrectly or the machine's capablilites are too limited for the processing/threads required - and even that can be programmed to accomodate.

 

Soooo ... no shower button.  I even tried using a global variable in case the cell was 'looking' for the default state of each of the components on cell load - suggested by one of my colleagues from work.  Didn't work. It's something I will re-visit at a later date when I've learnt more of the subtleties of the creation kit.

 

I've created a perfect 'master' file from my original mod so that I could create triggers in the master that affect my room addition cell (my new, 2nd mod) and so I could add additional 'family history' (journals / quests etc) to it's existing contents at any time.  I considered merging the mods (original and room addition) however it would limit adding to it later.

 

Thank you SO very much for all your efforts and your consideration!!!  It is greatly appreciated!  If you have any suggestions regarding other this or other aspects of the work mentioned above, I would gladly hear them!!! :)

 

with great respect and regards,

Leianne

Link to comment
Share on other sites

You may find that if you release the mod, that other people will complain about your mod crashing their game, even if it does not for you. That is why I said, your shower button would probably never crash my game. (But it 'sometimes' does yours, which proves its not a programming issue of yours, otherwise it would crash your game every single time.)

 

I have a bit of OCD but over 10+ years of modding the ES games, I have learned its an imperfect game engine and sometimes there is nothing you can do about it. Except perhaps never release or make mods.

 

But this is all my opinion gained through the years of modding the games. What is important is that you have fun and enjoy the experience.

So happy modding. :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...