Asterra Posted August 28, 2018 Share Posted August 28, 2018 (edited) I am having some CTD issues related to the placing and removing of xMarker. Now that I think of it, I had the same issue with a mod in FO3 a few years back, which forced me to abandon it altogether. In a nutshell, I have things set up so that I am placing and then more or less immediately deleting xMarkers fairly regularly (potentially a few times per second). This does not immediately cause a CTD, but eventually, with a few minutes, it will. Disabling all xMarker code makes the CTDs go away. set Bob to Ralph.PlaceAtMe xMarker Bob.MoveToNode Ralph "Fred" Bob.PlaySound3D TSo Bob.Disable Bob.MarkForDelete Conjecture: Does the xMarker need to "load to 3D" before it is safe to MarkForDelete? My original suspicion was that, no, there's no 3D to load, and that even if there were, MarkForDelete, which delays the actual deletion, would suffice to cover that necessity. That's all I can think of, really. I've done precisely this in Skyrim a dozen times with zero issues (difference: I Delete immediately as opposed to MarkForDelete). I'm glad to have pinned down the cause of the CTDs but could use a solution. Edited August 28, 2018 by Asterra Link to comment Share on other sites More sharing options...
dubiousintent Posted August 28, 2018 Share Posted August 28, 2018 From the GECKwiki "PlaceAtMe" page:Trying to run script commands on objects created in the same frame may not work, since it takes some time to place the object in the world. It is advised to wait a few frames or use a timed pause before attempting to manipulate these objects through scripts.You might want to split that script so it processes in multiple frames. -Dubious- Link to comment Share on other sites More sharing options...
Asterra Posted August 28, 2018 Author Share Posted August 28, 2018 From the GECKwiki "PlaceAtMe" page:Trying to run script commands on objects created in the same frame may not work, since it takes some time to place the object in the world. It is advised to wait a few frames or use a timed pause before attempting to manipulate these objects through scripts.You might want to split that script so it processes in multiple frames. So it could be a 3D-loaded thing after all. I tossed in a check for the xMarkers to see if they loaded immediately after being placed. They apparently did, every time. Though I guess it's possible that the function will return 1 100% of the time if the object doesn't even have 3D to load. I wouldn't know how else to ensure the object has indeed made it into the world. Link to comment Share on other sites More sharing options...
rickerhk Posted September 1, 2018 Share Posted September 1, 2018 PlaceAtme is not immediate. So I would skip a few frames. Or loop to check if 'Bob' is valid (not null). Link to comment Share on other sites More sharing options...
Asterra Posted September 5, 2018 Author Share Posted September 5, 2018 PlaceAtme is not immediate. So I would skip a few frames. Or loop to check if 'Bob' is valid (not null). I've beat my head against this problem for probably 30 hours now. I've discovered a few things. If I try to place an xMarker freshly after loading the game, or even several seconds after the player can already move around, the xMarker will not be placed and the ref will not be filled, breaking everything subsequently.If a ref is filled with an xMarker during this timespan of non-functionality, it will nonetheless != 0, confounding matters considerably.If any function is attempted to perform on the non-filled ref, such as gbo, causes the entire script to simply shut down at that moment, skipping every subsequent command.Basically any attempt, at any moment, to move an xMarker with MoveToNode will eventually, usually pretty soon, cause a CTD.The last point may be vaguely subject to my own misinterpretation but even if I plug in a ten-second wait, it's just not good enough. I now have a paranoia when it comes to xMarkers. I have absolutely failed to find the magic formula to make them work. What I have been trying to do is create an xMarker the moment the player is in-game, and put it in place when needed. But because of the above-listed issues, things just never work. The only thing that does work is making an xMarker on-the-spot, moving it in place right then, and playing the sound from it at that moment. Obviously this violates something important because the game will soon CTD afterward. Even if I toss in a multi-second wait after placing the xMarker. Link to comment Share on other sites More sharing options...
rickerhk Posted September 6, 2018 Share Posted September 6, 2018 What I do is place an Xmarker in the Geck somewhere, with a RefID. Then when I need it, I move the xmarker to where I need it, wait a couple frames, then do whatever I need with it. When done, I just leave it where it is till I need it again. An Xmarker placed in the Geck is persistent so it will always be available. A spawned xmarker won't be persistent. I think this may be where the CTD are coming from. MyXMarkerREF.MoveTo Ralph ;then wait a couple frames MyXMarkerREF.Playsound3D TSoYou know you can get the same effect by just doing this: Ralph.Playsound3d TSo Link to comment Share on other sites More sharing options...
Asterra Posted September 6, 2018 Author Share Posted September 6, 2018 A spawned xmarker won't be persistent. I think this may be where the CTD are coming from. This is probably the key. I pretty much swear MoveToNode does not work well with non-persistent xMarkers. Would not be the first time I've encountered bugs that necessitated fixes. Just in the last week, I found a bug with Get/SetSoundTraitNumeric (now happily fixed) and GetTeleportCell (still hoping for a fix). Link to comment Share on other sites More sharing options...
Recommended Posts