Talk:Common Mistakes

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search

PlaceAtMe'd actors: live actors seem to be cleared too[edit source]

I did some tests today and found that PlaceAtMe'd actors get cleared at cell reset even if they are still alive. I wonder what would be the circumstances / variables that would prevent live, PlaceAtMe'd actors from getting cleared.

My test was quite straightforward with a few scripted keys: (1) PlaceAtMe 100 x NPCs (2) PlaceAtMe 100 x Dogs (3) Kills half of the NPCs in cell and (4) Kills half of the creatures in cell. Both were based on vanilla actors with AI and factions removed and Aggression and Energy Level set to 5.

After going to a cell (internal or external) and hitting the four keys, I had 200 actors nearby, half of them dead. Then I left the cell and went thru a cycle of waiting 24 hours and save. After 72 hours, the savegame went back to its original size: all actors gone. Which, btw, contradicts something I read recently about the cell being reset the next time the player goes there. Any additional comments would be appreciated QQuix 16:28, 26 February 2009 (EST)

That's very good news. Some previous tests like this indicated that the live actors hung around, but it's possible the tests I'm remembering were back before the last official patch. Thanks, man! --dev_akm 17:13, 27 February 2009 (EST)
Based on a comment by Starwing on the Beth forums and rereading my previous report, above, I realized that I spawned the actors in the cell where the player was and, THEN, left the cell.
But the most usual would be to spawn the actor somewhere and, THEN, later on, move it to the dummy cell. So I tested it and (surprise!, surprise!) the actors never disappeared as in the previous test, even after 10 days and many cell load screens. For this test the methodology was: every four frames, PlaceAtMe an actor on frame 1, wait one frame, [kill it and] move it to the dummy cell on frame 3, wait one frame and start over. The killing on frame 3 was done to half the actors. At the end of 400x4 frames I had moved 100 live NPCs, 100 dead NPCs, 100 live creatures and 100 dead creatures to the dummy cell. Again, cell reset was detected by saving the game at several moments and comparing the save game sizes.
After some thinking and a lot of tests I learned a lot about cell reset (added to Cell Reset article). Bottom line: Cells reset 72 hours after the player leaves it. Which (not so obviously) implies that the usual dummy/hidden cell never resets because the player never goes there in the first place.
In this scenario, a safe way to get rid of spawned/dynamic actors is to move them there and force a cell reset:
MyDynaActor.PositionCell 0 0 0 0 MyDummyCell
ResetInterior MyDummyCell
(this code can run thousands of times without changes in the savegame size)
Of course, since both interior and exterior cells go by the same rule, you can simply leave them where they are and they will be gone 3 days later, thus, will not bloat the savegame.
In all my tests, it never made any difference whether the actors were dead or alive, btw.



Persistent Doors and other Persistent Activators[edit source]

I believe that this is true for all persistent activators. I have had experiences where traps, hidden doors, and similar persistent references behave similarly. Perhaps we should change the article to reflect this.

--therealneraverine 11:40, 16 May 2009 (GMT)

Good suggestion. It makes sense, too, since persistent data gets stored in the savegame.--dev_akm 11:41, 19 May 2009 (EDT)

How about a section cataloging the functions that act as a return statement ?[edit source]

I run on the player.moveto gotcha again - I was quick to find out but I think it is a common mistake even for intermediate modders - perhaps a new article ? I 'd start it but I am not any guru of scripting. What you say ? UDUN 08:12, 11 March 2010 (EST)

Do any other functions actually do that? Seems silly to have a list of one.
Hmm, I'd guess various ways of removing an item could count, if they remove the item that the script is on, though that one is pretty intuitive...
Are there any others?
Dragoon Wraith TALK 13:51, 11 March 2010 (EST)
dispell if in a scripteffect block and dispells the spell in question. The dropme removeme etc. Probably there are others - not too sure. Worth mentioning in this article as a new section maybe. Or in the troubleshoot guide ? UDUN 06:11, 12 March 2010 (EST)