Is it possible to disable a base object via a script?

Post » Tue May 17, 2011 6:51 am

As the topic asks, is it possible to disable a base object (like a torch) via a script?
User avatar
KU Fint
 
Posts: 3402
Joined: Mon Dec 04, 2006 4:00 pm

Post » Tue May 17, 2011 4:48 am

As the topic asks, is it possible to disable a base object (like a torch) via a script?


I'm really sorry if i completely misunderstood the question because my answer is really simple.

type the objectID.disable

cheers.
User avatar
Solène We
 
Posts: 3470
Joined: Tue Mar 27, 2007 7:04 am

Post » Tue May 17, 2011 8:12 am

Yeah. But scruggsywuggsytheferret said you can't do that for base objects, only references. Is there a way to turn a base object into a reference?
User avatar
tiffany Royal
 
Posts: 3340
Joined: Mon Dec 25, 2006 1:48 pm

Post » Tue May 17, 2011 12:21 pm

Yeah. But scruggsywuggsytheferret said you can't do that for base objects, only references. Is there a way to turn a base object into a reference?


I'm not sure what you're trying to do with that, but you could probably constantly scan the cells around the player for the object in question (getfirst/nextref and getisid) and then disable or remove each reference that fits.
User avatar
Mizz.Jayy
 
Posts: 3483
Joined: Sat Mar 03, 2007 5:56 pm

Post » Tue May 17, 2011 4:14 am

Give me a sample code of what you're talking about, if you could, please? I'm still very much a noob scripter, but I'm learning.
User avatar
zoe
 
Posts: 3298
Joined: Sun Nov 12, 2006 1:09 pm

Post » Tue May 17, 2011 12:29 pm

Come on, Phitt. I learn by example. Give me a simple sample code of what you're talking about. Or do you not know how to script what you suggested?
User avatar
Lawrence Armijo
 
Posts: 3446
Joined: Thu Sep 27, 2007 7:12 pm

Post » Tue May 17, 2011 7:25 am

Yeah. But scruggsywuggsytheferret said you can't do that for base objects, only references. Is there a way to turn a base object into a reference?

I think you need to understand the difference between a base object and a reference. A base object is a specific type of object, but not an actual one that exists in the game world, but a reference is one instance of an actual object. So you can for instance think of "iPhone" as a base object, and your personal iPhone (if you own one) as a reference.

Thinking of deleting a base object therefore makes as much sense as asking how to destroy "iPhone". You cannot destroy "iPhone" in general (the base object), but you can destroy one specifc (the refrence).

So the answerasking if there is a way to turn a base object into a reference, is Yes (PlaceAtMe), but that will only let you disable the one reference you just created, just as you can buy a new iPhone and destroy that, but that still only affect that single item.


Now, there are a number of functions that work on base objects, like SetGoldValue which thereby affects the price fo all instances of that base object, just like Apple can change the price for all iPhones by deciding to change the price for "iPhone", but delete is not one of them.

So what are you planning to do actually?
User avatar
Melissa De Thomasis
 
Posts: 3412
Joined: Tue Feb 27, 2007 6:52 pm

Post » Tue May 17, 2011 1:01 am

I think you need to understand the difference between a base object and a reference. A base object is a specific type of object, but not an actual one that exists in the game world, but a reference is one instance of an actual object. So you can for instance think of "iPhone" as a base object, and your personal iPhone (if you own one) as a reference.

Thinking of deleting a base object therefore makes as much sense as asking how to destroy "iPhone". You cannot destroy "iPhone" in general (the base object), but you can destroy one specifc (the refrence).

So the answerasking if there is a way to turn a base object into a reference, is Yes (PlaceAtMe), but that will only let you disable the one reference you just created, just as you can buy a new iPhone and destroy that, but that still only affect that single item.


Now, there are a number of functions that work on base objects, like SetGoldValue which thereby affects the price fo all instances of that base object, just like Apple can change the price for all iPhones by deciding to change the price for "iPhone", but delete is not one of them.

So what are you planning to do actually?


Thanks for the explanation, TNO. I thought I understood the difference between a base object and reference, but it turns out after reading your explanation, I didn't.

What I want to do is disable an instance of the torch, because I'm using "SetLightRadius", and the description off the wiki recommends disabling the reference to work around the need to load a cell for the function to work. That's all.
User avatar
Causon-Chambers
 
Posts: 3503
Joined: Sun Oct 15, 2006 11:47 pm

Post » Tue May 17, 2011 1:36 pm

Is the torch in an actor's inventory, e.g. being held in the player's hand?
If so it is not a reference. You would most likely need to unequip and then re-equip it to get the changed light radius to take visible effect.
If this doesn't help please explain where the instance of the torch is located at the time it is supposed to be disabled.
User avatar
Dj Matty P
 
Posts: 3398
Joined: Sat Jun 09, 2007 12:31 am

Post » Tue May 17, 2011 7:08 am

Is the torch in an actor's inventory, e.g. being held in the player's hand?
If so it is not a reference. You would most likely need to unequip and then re-equip it to get the changed light radius to take visible effect.
If this doesn't help please explain where the instance of the torch is located at the time it is supposed to be disabled.


No, un-equipping and then re-equipping doesn't do anything.
The instance of the torch? My inventory and my hand. My hand (equipped) to show the light radius.
User avatar
Oceavision
 
Posts: 3414
Joined: Thu May 03, 2007 10:52 am

Post » Tue May 17, 2011 1:56 am

So you want to change the light radius of a torch in your hand? I'd imagine that the easiest way to do that would be to swap the one your holding for a different base object which is identical to a torch but has a different radius. Be sure to swap it back when it's unequipped.
User avatar
biiibi
 
Posts: 3384
Joined: Sun Apr 08, 2007 4:39 am


Return to IV - Oblivion