PlaceAtMe Persistance?

Post » Thu Nov 04, 2010 6:26 pm

What I need is something I can spawn a copy of with PlaceAtMe, and the new whatever-it-is would have a persistant ref.. Is that possible? It could be anything at all, even a world object.. I just need it to hold a static ref beyond cell cleanup, and be something I can dump a script on. Any ideas on how to acheive that, what I can use, or is it a lost cause?

Thanks
User avatar
bonita mathews
 
Posts: 3405
Joined: Sun Aug 06, 2006 5:04 am

Post » Thu Nov 04, 2010 10:16 pm

I don't really know what you after, but if what you are spawning already has a script on it, the placeatme spawn will have the script too. I can't see anyway to make the spawn persistent, but you can perform a 'ref walk' to get the spawned objects ref ID and use it to do stuff.
User avatar
Holli Dillon
 
Posts: 3397
Joined: Wed Jun 21, 2006 4:54 am

Post » Thu Nov 04, 2010 2:30 pm

Use a reference variable to create it, and set it as a quest item.

set MyRef to player.placeatme SomeObject
MyRef.setquestitem 1

You can pass the reference on to a quest variable if need be after creating it.
User avatar
BaNK.RoLL
 
Posts: 3451
Joined: Sun Nov 18, 2007 3:55 pm

Post » Thu Nov 04, 2010 5:30 pm

Use a reference variable to create it, and set it as a quest item.

set MyRef to player.placeatme SomeObject
MyRef.setquestitem 1

You can pass the reference on to a quest variable if need be after creating it.

So you're saying that by setting it as a quest item, a passed-off-and-recorded temp ref to that object/actor will still relate to the object after cell cleanup? Am I getting that right? I was under the impression that spawned things completely lost their association to ref variables at cleanup, as in the ref ID won't point to the actor anymore, even if the actor survives cleanup. Tell me I was wrong please because that's exactly the answer I was looking for.


@pkleiss - portable, movable, persistant spawn points for one... but I have another, larger, more psychotic use in mind as well. Maintaining persistance is the last hurdle, but it has to be done without FOSE.
User avatar
Glu Glu
 
Posts: 3352
Joined: Sun Apr 01, 2007 5:39 am

Post » Thu Nov 04, 2010 12:04 pm

I'm assuming b3w4r3 is referring to an OBSE function. The GECK added http://geck.gamesas.com/index.php/SetQuestObject which has a different syntax.

But I'm not sure that gives you anything extra in this case anyway. From what I understand, objects (other than actors and explosions) spawned with PlaceAtMe are not cleaned up at all - that's the reason for the warning http://geck.gamesas.com/index.php/PlaceAtMe#Caution, that you should remove those objects afterward to avoid savegame bloat. I haven't observed anything to indicate that's not true, so if you spawn something with PlaceAtMe, it should remain there permanently. What I haven't fully tested myself is if saved references to PlaceAtMe objects remain valid to use in script reliably after cell/worldspace changes and game restarts. I've only done some limited tests that seem to indicate they are "persistent" in that sense, for example, try this:

Scriptname TeleportTestScriptint iIterationref rMarkerBegin Gamemode	PrintC "TeleportTest:"	if iIteration == 0		set rMarker to Player.PlaceAtMe XMarker 1		set iIteration to 1		PrintC "  rMarker placed: <%i> %n" rMarker rMarker		StopQuest TeleportTest	elseif iIteration == 1		Player.MoveTo rMarker		set iIteration to -1		PrintC "  Moved to rMarker: <%i> %n" rMarker rMarker		StopQuest TeleportTest	endifEnd

Attach it to a quest named TeleportTest with a short delay (like 0.1). Load up the game, and in the console type "StartQuest TeleportTest", then fast travel or something, and again enter the console and type "StartQuest TeleportTest". You'll teleport back to first location.

You might just want to try pushing that to see if the reference survives after doing more things, until you're reasonably satisfied it will be available as long as you need it. If it doesn't, I don't think setting the "Quest Item" flag will make any difference here.

I've always wanted to try making user-placeable or portable map markers, but it's another idea never got around to trying. I think it could be pretty cool.
User avatar
*Chloe*
 
Posts: 3538
Joined: Fri Jul 07, 2006 4:34 am

Post » Thu Nov 04, 2010 8:29 pm

From what I understand, objects (other than actors and explosions) spawned with PlaceAtMe are not cleaned up at all - that's the reason for the warning http://geck.gamesas.com/index.php/PlaceAtMe#Caution, that you should remove those objects afterward to avoid savegame bloat. I haven't observed anything to indicate that's not true, so if you spawn something with PlaceAtMe, it should remain there permanently. What I haven't fully tested myself is if saved references to PlaceAtMe objects remain valid to use in script reliably after cell/worldspace changes and game restarts.

I've always wanted to try making user-placeable or portable map markers, but it's another idea never got around to trying. I think it could be pretty cool.

Thanks much. Yeah, the "referrences to placed objects remaining valid" was the heart of my question, though like I said, I wasn't aware that only the temp ref value assigned at creation was lost and not the whole objects ability to be referrenced by that value. I was curious if there's some types of objects that are persistant by default when created like that, based on their type..like maybe a marker, or door, or container or something. I could always use a custom one and change the world model to whatever I needed, but the persistant aspect needs to be there for it to be doable.

And yes, placeable map markers would be awesome... the one user marker on the map pretty much svcks, not to mention the dotted lines get annoying.
User avatar
lexy
 
Posts: 3439
Joined: Tue Jul 11, 2006 6:37 pm

Post » Thu Nov 04, 2010 6:54 am

In the script above, XMarker is a Static (STAT), and I think I always used Statics when I played around with this in the past. In Feng Shui I've been using Misc Items (MISC) created by PlaceAtMe to handle locking items and other things - if references to them stored in ref variables didn't remain valid, the locking in Feng Shui wouldn't work, or would at least be unreliable. I haven't yet had a report from anyone that any items spontaneously became unlocked after some time, so I'd say so far it looks like they're "persistent" in this way too.

If for what you're doing, you're gonna need to keep track of an unknown number of PlaceAtMe refs, you might want to do take a look at what I do in FS. Feel free to pm me if you have questions about any of the related script in there - it's not that complicated really, but it might be hard to find what you should be looking at.
User avatar
WYatt REed
 
Posts: 3409
Joined: Mon Jun 18, 2007 3:06 pm

Post » Thu Nov 04, 2010 10:22 am

In the script above, XMarker is a Static (STAT), and I think I always used Statics when I played around with this in the past. In Feng Shui I've been using Misc Items (MISC) created by PlaceAtMe to handle locking items and other things - if references to them stored in ref variables didn't remain valid, the locking in Feng Shui wouldn't work, or would at least be unreliable. I haven't yet had a report from anyone that any items spontaneously became unlocked after some time, so I'd say so far it looks like they're "persistent" in this way too.

If for what you're doing, you're gonna need to keep track of an unknown number of PlaceAtMe refs, you might want to do take a look at what I do in FS. Feel free to pm me if you have questions about any of the related script in there - it's not that complicated really, but it might be hard to find what you should be looking at.

Hey thanks a lot. That info makes the amount of blind testing I might have to do a lot smaller. I'm thinking of limiting it to about 20 or so, after which the player would be given the choice of removing an old point before they can create a new one, or don't make a new one. It's more than I'd like to write out, but not too bad.
User avatar
Emerald Dreams
 
Posts: 3376
Joined: Sun Jan 07, 2007 2:52 pm

Post » Thu Nov 04, 2010 11:34 am

Is there a specific reason you can't just create persistent references in a holding cell, and use moveto instead of placeatme.
User avatar
Erika Ellsworth
 
Posts: 3333
Joined: Sat Jan 06, 2007 5:52 am

Post » Thu Nov 04, 2010 4:15 pm

Is there a specific reason you can't just create persistent references in a holding cell, and use moveto instead of placeatme.

Since you're planning to use only a fixed, limited number of objects, that probably would be the better way to go. It wouldn't make a difference in the structure of your script, and you could use those references anywhere very easily. Plus, we're already sure about how placed persistent references work.
User avatar
Laura Wilson
 
Posts: 3445
Joined: Thu Oct 05, 2006 3:57 pm

Post » Thu Nov 04, 2010 9:50 pm

Is there a specific reason you can't just create persistent references in a holding cell, and use moveto instead of placeatme.

Absolutely no reason at all... Sometimes you round off enough of your sharp braincells on a problem that you end up being too close to it to see it clearly.
Thanks!
User avatar
Amy Melissa
 
Posts: 3390
Joined: Fri Jun 23, 2006 2:35 pm


Return to Fallout 3