Scripting Questions (again)

Post » Sat May 28, 2011 1:42 pm

Is there a way to recall a deleted reference? I had to use placeatme for a script, and decided to delete the reference after I was done with what I needed to do. So as to prevent save game boat. Problem is, the base object that I turned into a reference with placeatme is used in other scripts. If I delete the reference, it disables the scripts. Can I still delete the reference and recall it on the other script? Hope this makes sense to people.
User avatar
DarkGypsy
 
Posts: 3309
Joined: Tue Jan 23, 2007 11:32 am

Post » Sat May 28, 2011 11:47 pm

No, I'm pretty sure that if you delete a reference, it is, by definition, deleted...
User avatar
Sun of Sammy
 
Posts: 3442
Joined: Mon Oct 22, 2007 3:38 pm

Post » Sat May 28, 2011 9:35 am

Well hell. So how can I prevent save game bloat by using PlaceAtMe? Without deleting the reference?
User avatar
Chloe Lou
 
Posts: 3476
Joined: Sat Nov 04, 2006 2:08 am

Post » Sat May 28, 2011 1:11 pm

You delete it once you're done with it. If you've got a script that repeatedly creates objects with PlaceAtMe, you need to find an alternative method. Here's one http://cs.elderscrolls.com/constwiki/index.php/Summon_Object If your script doesn't repeatedly call PlaceAtMe, don't worry about it. Quite often PlaceAtMe is used during a transition phase, so you would delete the original object once it has transitioned over to something else.
User avatar
Gen Daley
 
Posts: 3315
Joined: Sat Jul 08, 2006 3:36 pm

Post » Sat May 28, 2011 5:51 pm

Well, PlaceAtMe is used in a Quest script. With the quest delay time set to 1 second. Is that going to really bloat my save game?
User avatar
Lucie H
 
Posts: 3276
Joined: Tue Mar 13, 2007 11:46 pm

Post » Sat May 28, 2011 6:41 pm

From your first post, I understand that you asked about the BASE object.

Base objects are not affected by creating and/or deleting its references.
If you have problems in scripts that use the base object, the cause is not the deletion of the references.

And the best practice is deleting all the references created with PlaceAtMe, whenever you don't need them anymore.
At the time that article was written, removing carriable items was not trivial and deleting non-carriable objects like statics, activator and containers was impossible.
Today, with the availability of DeletReference, there is no excuses for keeping unused objects in the game.
User avatar
DAVId Bryant
 
Posts: 3366
Joined: Wed Nov 14, 2007 11:41 pm

Post » Sat May 28, 2011 4:10 pm

Well it's a base object that I turned into a reference by using placeatme. But if I delete the reference using DeleteReference, the other scripts that use that base object (turned reference) don't work properly.

You said that the base object isn't effected by it, but my experience with these scripts is that it is. So, why is that?

Edit:

Another thing. According to the OBSE documentation, you cannot delete references found in your inventory. I've turned a torch (base object) into a reference. Being that it is found in my inventory, I guess that means I cannot delete it anyway.
User avatar
Elizabeth Falvey
 
Posts: 3347
Joined: Fri Oct 26, 2007 1:37 am

Post » Sat May 28, 2011 11:27 am

Well it's a base object that I turned into a reference by using placeatme. But if I delete the reference using DeleteReference, the other scripts that use that base object (turned reference) don't work properly.
You have not yet fully understood the relationship between a base object and a reference. A Base Object simply cannot be turned into anything else (though there exist a number of OBSE functions that temporarily modifies single aspects of a Base Object, for that gaming session).

What you do with PlaceAtMe, is to create one reference of the type defined by the Base Object, but that does in no way affect the Base Object. Deleting that reference only affects that single reference, and doesn't affect the Base Object or other references created from that Base Object.

You said that the base object isn't effected by it, but my experience with these scripts is that it is. So, why is that?
Probably because the script is not working as you think :)


Another thing. According to the OBSE documentation, you cannot delete references found in your inventory. I've turned a torch (base object) into a reference. Being that it is found in my inventory, I guess that means I cannot delete it anyway.
You can delete things from your inventory, but things in your inventory are not real references, but more like pointers to the Base Object.
User avatar
OJY
 
Posts: 3462
Joined: Wed May 30, 2007 3:11 pm

Post » Sat May 28, 2011 5:35 pm

I understand now, TNO. The script works fine, it was a load order thing. I didn't place the plugin low enough in the order. Now I have to test exactly how high up in the order it can go and still function as it's supposed to.
User avatar
FLYBOYLEAK
 
Posts: 3440
Joined: Tue Oct 30, 2007 6:41 am

Post » Sat May 28, 2011 10:01 am

I understand now, TNO. The script works fine, it was a load order thing. I didn't place the plugin low enough in the order. Now I have to test exactly how high up in the order it can go and still function as it's supposed to.
Know that if the mod consists of only new quests/scripts, like most of my mods do, and like I get the impression that your mod does, then load order means absolutely nothing at all. Load order only matters if two mods are statically changing the same vanilla item, i.e. not changing the vanilla item within a script, but by directly editing it in the CS.
User avatar
ezra
 
Posts: 3510
Joined: Sun Aug 12, 2007 6:40 pm

Post » Sat May 28, 2011 1:52 pm

Know that if the mod consists of only new quests/scripts, like most of my mods do, and like I get the impression that your mod does, then load order means absolutely nothing at all. Load order only matters if two mods are statically changing the same vanilla item, i.e. not changing the vanilla item within a script, but by directly editing it in the CS.


Well, all I can say is that my mod wouldn't work if I loaded it before the Bashed Patch. That was until I imported the scripts into the BP. Works fine now. It's not all scripts. It makes some changes to torch stats.
User avatar
Keeley Stevens
 
Posts: 3398
Joined: Wed Sep 06, 2006 6:04 pm


Return to IV - Oblivion