Troubleshooting

Post » Tue Dec 08, 2009 4:19 am

Writing a script that let's you "light" your arrows with a torch
scn aaaArcherArrowsbegin onEquipref Arrow     set Arrow to player.GetEquippedObject 17     if IsTorchOut == 1		if Arrow.NameIncludes Iron == 1				player.UnequipItemNS Arrow				player.removeitemns Arrow 1				player.additemns 01000cea 1				player.equipitemns 01000cea		elseif Arrow.NameIncludes Steel == 1				player.UnequipItemNS Arrow				player.removeitemns Arrow 1				player.additemns  01000ceb 1				player.equipitemns 01000ceb		elseif Arrow.NameIncludes Elven == 1				player.UnequipItemNS Arrow				player.removeitemns Arrow 1				player.additemns 01000cec 1				player.equipitemns 01000cec		elseif Arrow.NameIncludes Glass == 1				player.UnequipItemNS Arrow				player.removeitemns Arrow 1				player.additemns 01000ced 1				player.equipitemns 01000ced		elseif Arrow.NameIncludes Ebony == 1				player.UnequipItemNS Arrow				player.removeitemns Arrow 1				player.additemns 01000cee 1				player.equipitemns 01000cee		elseif Arrow.NameIncludes Daedric == 1				player.UnequipItemNS Arrow				player.removeitemns Arrow 1				player.additemns 01000cef 1				player.equipitemns 01000cef		endif     else player.removeitemns aaaLighter 1     endifend

but the script seems to be completely inactive, not even 'player.removeitemns aaaLighter 1' occurs, am I missing something painfully obvious? Tankyau
User avatar
Annika Marziniak
 
Posts: 3416
Joined: Wed Apr 18, 2007 6:22 am

Post » Tue Dec 08, 2009 1:24 am

Maybe you must write
Player.IsTorchOut
? Or
Set Me to GetSelf
and then
Me.IsTorchOut

User avatar
Thema
 
Posts: 3461
Joined: Thu Sep 21, 2006 2:36 am

Post » Tue Dec 08, 2009 7:57 am

What did you attach the script to? OnEquip is only going to work in an object script when that object is equipped, so it looks like you'd want to attach to to arrows, which means replacing the base form for each of the unenchanted arrows with a scripted version.

P.s. what do you have against Silver and Dwarven arrows?
User avatar
RaeAnne
 
Posts: 3427
Joined: Sat Jun 24, 2006 6:40 pm

Post » Tue Dec 08, 2009 5:12 pm

Maybe you must write
Player.IsTorchOut
?

Hmm, tried that right after I started the thread, no luck. I shall try the latter now.

Script is attached to Misc Item 'Light arrow' which is added to the inventory upon equiping a torch.(and removed if you use it without a torch)
That's the most puzzling bit, even if the script was comepletely bonkers, I don't see why a simple "else player.removeitemns aaaLighter 1" wouldn't work.

p.s. lol I guess I forgot
User avatar
rolanda h
 
Posts: 3314
Joined: Tue Mar 27, 2007 9:09 pm

Post » Tue Dec 08, 2009 2:03 pm

Nope. I have a very good feeling that the script isn't running at all.
User avatar
chloe hampson
 
Posts: 3493
Joined: Sun Jun 25, 2006 12:15 pm

Post » Tue Dec 08, 2009 8:23 am

How does the "Light Arrow" misc item get equipped? I don't think a misc item can be - because it has no equipment slot to go to. Hence it will never trigger the OnEquip block.
User avatar
Sasha Brown
 
Posts: 3426
Joined: Sat Jan 20, 2007 4:46 pm

Post » Tue Dec 08, 2009 1:47 am

How does the "Light Arrow" misc item get equipped? I don't think a misc item can be - because it has no equipment slot to go to. Hence it will never trigger the OnEquip block.

No, Misc items do trigger scripts. You guys aren't any better at this than I am init :P I think all the experienced modders just thought: "oh look a noob playground" and then walked off. I expected (slightly) better from these forums. Anyway, if anyone's still wondering, the reference for nameincludes goes AFTER the word to search for. Figured it out two days ago on a Polish site of all things, it was a how-to on translating skycaptain's Deadly Reflex. Seems the capt'n only searched for english names.
That's often the best way to learn scripting, just dive into it and dissect other people's work, but you don't just know which mods use nameincludes/comparename.
User avatar
Sami Blackburn
 
Posts: 3306
Joined: Tue Jun 20, 2006 7:56 am


Return to IV - Oblivion