How to get object ID of an object a script is attached to

Post » Thu Jun 21, 2012 9:03 am

I'm really new to how scripting works. I have a little programming experience but it's not helping a ton.

I'm trying to use UnEquipItem, but I'm confused on how to use the first parameter... I need the ObjectID right? How can I get the ObjectID for the object the script is attached to and running on?
User avatar
Alisia Lisha
 
Posts: 3480
Joined: Tue Dec 05, 2006 8:52 pm

Post » Thu Jun 21, 2012 8:20 pm

I used "Self" as the ObjectID and it compiled... Will that work?
User avatar
Naomi Ward
 
Posts: 3450
Joined: Fri Jul 14, 2006 8:37 pm

Post » Thu Jun 21, 2012 12:20 pm

I'm trying to use UnEquipItem, but I'm confused on how to use the first parameter... I need the ObjectID right? How can I get the ObjectID for the object the script is attached to and running on?

You don't need an objectID, you need either a variable or a property. Self should do fine.
User avatar
Rusty Billiot
 
Posts: 3431
Joined: Sat Sep 22, 2007 10:22 pm

Post » Thu Jun 21, 2012 1:55 pm

if your script extends objectreference, the unequipitem function is native to the objectrefernce script.

you dont even need to use self, it will automatically run it on itself without it.
User avatar
carla
 
Posts: 3345
Joined: Wed Aug 23, 2006 8:36 am


Return to V - Skyrim