Difference between revisions of "Talk:PlaceAtMe"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>DragoonWraith
(did you try using Wait at all?)
imported>Gamall
(test done. What was Morrowind's discharge function ?)
Line 53: Line 53:


:::::::[[User:DragoonWraith|<font face="Oblivion,Daedric Runes" size=3>D</font>ragoon <font face="Oblivion,Daedric" size=3>W</font>raith]] [[User_talk:DragoonWraith|<font face="Oblivion,Daedric" size=2>TALK</font>]] 17:42, 18 July 2006 (EDT): I may, if I get the chance... can't really right now. But at any rate, for your tests, it generally takes time for things to unload. I think the default is three in-game days. Try "Wait"ing for about 75 hours and see if that changes things (actually, even if it doesn't unload the disabled objects, your savefile should shrink because many things ''will'' be unloaded as cells are reset).
:::::::[[User:DragoonWraith|<font face="Oblivion,Daedric Runes" size=3>D</font>ragoon <font face="Oblivion,Daedric" size=3>W</font>raith]] [[User_talk:DragoonWraith|<font face="Oblivion,Daedric" size=2>TALK</font>]] 17:42, 18 July 2006 (EDT): I may, if I get the chance... can't really right now. But at any rate, for your tests, it generally takes time for things to unload. I think the default is three in-game days. Try "Wait"ing for about 75 hours and see if that changes things (actually, even if it doesn't unload the disabled objects, your savefile should shrink because many things ''will'' be unloaded as cells are reset).
[[User:Gamall|Gamall]] 18:15, 18 July 2006 (EDT) : I waited for a week, and the save ''did'' shrink. Of about 35 Kb. Since the "placeatme obesity" was of about 100 Kb, it tends to confirm the problem. I created the references in a matter of seconds, so I cannot think of any reason why waiting would destroy some of them and leave others.
I'll edit the main article, since the issue seems about settled.
Oh, and does anyone remember the name of the function Morrowind used to discharge disabled placeatpc'd objects ? I must say throughout this discussion I hoped someone would come and save the day by pulling an "Oblivioned" version of this function out of their hat. Trouble is I can't remember this function's name in the first place...

Revision as of 17:15, 18 July 2006

Using PlaceAtMe to return a reference to a created object does not appear to work...

ref refCreatedObject to refCreatingObject.PlaceAtMe ObjectToCreate, 1, 0, 0

Seems to do nothing. ObjectToCreate is never created, as far as I can determine. Conversely, the following creates ObjectToCreate perfectly fine:

refCreatingObject.PlaceAtMe ObjectToCreate, 1, 0, 0

Some more detail in how this is supposed to be used would be good, maybe? Or this is a bug I guess...

--X-Bahamut 23:34, 8 April 2006 (EDT)

You can't declare and set a variable in the same line. I'll add a section to the article explaining how to use the returned reference. Mrflippy 20:03, 8 April 2006 (EDT)

--Tegid 22:41, 12 April 2006 (EDT) Does PlaceAtMe only succeed at creating a reference if it is called by a Persistent Object or an Actor? More importantly if I have a Foo object can I create another Foo object by calling?

set FooRef2 to FooRef1.PlaceAtMe Foo, 1, 0, 0

--Tegid 09:14, 20 April 2006 (EDT): It turns out the answer to my questions are no, you don't need a persistent reference, and yes, one object can create another of the same type.


-- I noticed something bad about the couple PlaceAtMe / Disable, often used in mods for spell effects. Once the references are placed, there is no way to get rid of them. Although disabled, they are saved with your saved games. In MW there was a way around this, but the command disappeared with TESIV. All I can say is that, unless there is a way around this, modders should strive to avoid use of PlaceAtMe at all cost, and use MoveTo instead on a finite number of references. Gamall 12:23, 18 July 2006 (EDT)

test : 500 references = 76 KB increase of the savegame. Gamall 12:41, 18 July 2006 (EDT)
Dragoon Wraith TALK 13:28, 18 July 2006 (EDT): That's a temporary increase though. Disabled objects are unloaded from memory every so often, automatically.
I heard this rumor a while ago, but I'm still not convinced. "Initially disabled" objects are not removed from the savegame. Objects that exist in an ESP or ESM (persistent or not) are not removed after you disable them, that's a fact that was extensively tested. Objects created by placeatme give you a reference to access them, the game would crash if you do so after the object is removed, and I doubt that Bethsoft made a garbage-collection-routine that just removes disabled objects that were created ingame without storing a reference to them.--JOG 13:40, 18 July 2006 (EDT)

Gamall 14:17, 18 July 2006 (EDT) :

@ DragoonWraith : How often ? Did you test this ? Who provided this information ? I do hope the are unloaded from times to times (or when a limit is reached), but I'm not convinced. It is true that savegames seem to lose about 10 Kb every now and then, but nothing proves it is linked to disabled references being cleaned up.

@ JOG : Try creating a reference with placeatme, use the console to get its reference, see to it that the zone you were in is discharged from memory, save, quit the game, go back to it, go back to the zone, use the reference, it will work. This proves references created with placeatme are saved. That and the significant weight increase in the savegames mentionned earlier.

So whether or not objects placed with placeatme and disabled are stored in the savegame is really not the issue anymore. They are. The issue is whether or not saves are cleaned in the way DragoonWraith said, or any other way. They may be, and they may not be ; either way, I think this issue deserves much more attention than has been given to it this far.

Dragoon Wraith TALK 15:51, 18 July 2006 (EDT): It was mentioned on this Wiki somewhere by a Beth employee... I think it was Ashileedo or Kkulman, I'll look around.
Dragoon Wraith TALK 15:55, 18 July 2006 (EDT): Found it; according to Ashileedo, disabled items will be removed:
The danger is summong 50 iron swords at the wrong time and running out of memory. However, if you disable something that you've placeatme'd, I believe it gets thrown out -- I don't think right away, but our memory management code will clear it out when you hit your next load (though we'd have to check the code to be absolutely sure its at your NEXT load. But I am sure it does get cleared away. It most definitely will go away when the cell you summoned the objects in gets unloaded from memory). But the bigger risk here is if you placeatme something that is too expensive -- especially if player does it over and over and over again consecutively. --Ashileedo 15:08, 7 April 2006 (EDT)
Gamall 16:47, 18 July 2006 (EDT) : That's a bit comforting. However, when I made the test I suggested to JOG, the cell I summoned the objects in was unloaded from memory (I loaded another city to make sure it would be), and I rebooted the game and made my way back there. So according to this quote, the objects should have been destroyed. But they weren't : I had written down a reference to one of them before it was disabled, and after the operation I described, I enabled it via the console.
Ill try to load my savegame over and over again, and see if it looses weigth. On a sidenote, I'd say the dev didn't sound very confident when he wrote what you quoted ;)Plus, I found another quote of the same, about disable : "We don't use it with placeatme very often, I can't think of any example off hand." So it could very well be that they overlooked that possibility a bit, since it was to no extent critical at that time. Anyway, I'll do more tests, and if they are successful, this issue will be buried once and for all.
Dragoon Wraith TALK 16:57, 18 July 2006 (EDT): Hmm... so it seems that we should use MoveTo on a persistant reference rather than PlaceAtMe. Good to know. MoveTo with a persistant reference has another benefit, too - it can tell if the player has changed cells by using GetInSameCell.
Using MoveTo is exactly what I do, and recommand to people patient enough to listen. Most of the time, you can do with MoveTo everything you do with PlaceAtMe, even if it is trickier for complex spell effects.
I have restarted the game about seven time, each time loading new zones and saving again, without any weight loss. I have about 100 Kb of placeatme'd disabled references in my save, btw...
I think someone should edit this article Casting Spells From An Activator,since it uses placeatme, and I am under the impression many people learned how to script spells from this very page, hence the prominence of the use of placeatme in spell effects... I'm a little too fed up with this specific issue to make it right now, having spent my whole day on it, so... If noone else wants to do it, I'll do it tomorrow anyway. Good day/night, depending on the country you're from... Gamall 17:17, 18 July 2006 (EDT)
Dragoon Wraith TALK 17:42, 18 July 2006 (EDT): I may, if I get the chance... can't really right now. But at any rate, for your tests, it generally takes time for things to unload. I think the default is three in-game days. Try "Wait"ing for about 75 hours and see if that changes things (actually, even if it doesn't unload the disabled objects, your savefile should shrink because many things will be unloaded as cells are reset).

Gamall 18:15, 18 July 2006 (EDT) : I waited for a week, and the save did shrink. Of about 35 Kb. Since the "placeatme obesity" was of about 100 Kb, it tends to confirm the problem. I created the references in a matter of seconds, so I cannot think of any reason why waiting would destroy some of them and leave others.

I'll edit the main article, since the issue seems about settled.

Oh, and does anyone remember the name of the function Morrowind used to discharge disabled placeatpc'd objects ? I must say throughout this discussion I hoped someone would come and save the day by pulling an "Oblivioned" version of this function out of their hat. Trouble is I can't remember this function's name in the first place...