Brain fried

Post » Sat Feb 19, 2011 7:14 am

I have spent the last 12 hours trying to find a way to scipt things so that when I equip a certain item another item is added to my inventory and equipped as well. I suspect that an enchantment might do what I want, but I'm trying to make it work through scripting to allow the parent item to be enchanted later in game if need be. I want it to add and equip when the parent is equipped, and unequip and remove from inventory when the parent item is unequipped. Is this even possible? I have tried several variants and several different commands, but nothing so far has worked. I have very limited scripting knowledge , and what I have has moslty been drawn from reading others' scripts and reading the construction set wiki. Am I just chasing my tail on this or have I just not come up with the right combination? Please, if anyone could help, it would be greatly appreciated.
User avatar
Emerald Dreams
 
Posts: 3376
Joined: Sun Jan 07, 2007 2:52 pm

Post » Sat Feb 19, 2011 2:16 am

This is the script you are after. This can be attached to the parent item, or a quest script.

MyScript = Your script name
MyItem = Your first item, the parent item
MyItemOtherItem = Your second item that gets equipped

SCN MyScriptshort togglebegin menumode	if ( player.getequipped MyItem == 1 && toggle == 0)		player.additem MyItemOtherItem 1		player.equipitem MyItemOtherItem		set toggle to 1	endif	if ( player.getequipped MyItem == 0 && toggle == 1)		player.removeitem MyItemOtherItem 1		set toggle to 0	endifendbegin gamemode	if ( player.getequipped MyItem == 1 && toggle == 0)		player.additem MyItemOtherItem 1		player.equipitem MyItemOtherItem		set toggle to 1	endif	if ( player.getequipped MyItem == 0 && toggle == 1)		player.removeitem MyItemOtherItem 1		set toggle to 0	endifend

User avatar
Catherine Harte
 
Posts: 3379
Joined: Sat Aug 26, 2006 12:58 pm

Post » Sat Feb 19, 2011 3:55 am

One thing to note: A scripted item with no enchantment will "lose" it's script when you enchant it. So you may want this to be part of an enchantment on the item.
User avatar
Franko AlVarado
 
Posts: 3473
Joined: Sun Nov 18, 2007 7:49 pm

Post » Sat Feb 19, 2011 9:35 am

One thing to note: A scripted item with no enchantment will "lose" it's script when you enchant it. So you may want this to be part of an enchantment on the item.


Really? I didnt know this. Thanks for the note. :thumbsup:
User avatar
Luna Lovegood
 
Posts: 3325
Joined: Thu Sep 14, 2006 6:45 pm

Post » Sat Feb 19, 2011 8:18 am

I have spent the last 12 hours trying to find a way to scipt things so that when I equip a certain item another item is added to my inventory and equipped as well. I suspect that an enchantment might do what I want, but I'm trying to make it work through scripting to allow the parent item to be enchanted later in game if need be. I want it to add and equip when the parent is equipped, and unequip and remove from inventory when the parent item is unequipped. Is this even possible? I have tried several variants and several different commands, but nothing so far has worked. I have very limited scripting knowledge , and what I have has moslty been drawn from reading others' scripts and reading the construction set wiki. Am I just chasing my tail on this or have I just not come up with the right combination? Please, if anyone could help, it would be greatly appreciated.

User avatar
luis dejesus
 
Posts: 3451
Joined: Sun Aug 19, 2007 7:40 am

Post » Fri Feb 18, 2011 9:29 pm

Thank you both very much for your help with this issue. I appreciate y'all taking the time and effort share your information. I will go ahead and put this in as an enchantment on the item because I really want these two items to always equip together. Hopwfully with your help/advice I won't spend another 12 hours foaming at the mouth like a rabid dog.
User avatar
Nathan Maughan
 
Posts: 3405
Joined: Sun Jun 10, 2007 11:24 pm


Return to IV - Oblivion