how do you detect if a particular scroll is equipped in the

Post » Sat Nov 17, 2012 2:49 am

I can use isequiped to see if A scroll is equipped or not but how do I find if it is equipped in the left or right or both hands?


This would not compile, error message "not a spell":

Scroll Property aadpHolyWater Auto

if me.GetEquippedspell(0) != aadpHolyWater

if (me.GetEquippedspell(0) != (aadpHolyWater)as spell)
User avatar
Wane Peters
 
Posts: 3359
Joined: Tue Jul 31, 2007 9:34 pm

Post » Sat Nov 17, 2012 12:22 pm

It's GetEquippedSpell(0) for left hand, GetEquippedSpell(1) for the right. There's also (2) and even (3) (for 'other' and 'instant' but I've never used them).

What you're doing here however is a little confusing especially because I don't think you can 'equip' a scroll. Are you equipping a spell when you use that scroll, or are you equipping a weapon? If your 'scroll' of holy water is actually a weapon, you check for that differently. If it's indeed a spell, then your property should be a spell type.

If your scroll is equipping as a weapon, you need If Actor.GetEquippedWeapon(abLeftHand = false) != myScroll for the right hand and Actor.GetEquippedWeapon(abLeftHand = true) for the left hand.
User avatar
renee Duhamel
 
Posts: 3371
Joined: Thu Dec 14, 2006 9:12 am

Post » Sat Nov 17, 2012 11:52 am

The scroll is a normal scroll, it equips as a spell.

Scroll Property aadpHolyWater Auto

That is why I found it strange that I would get an error when I do this:

if me.GetEquippedspell(0) != aadpHolyWater

On the other hand the property is a scroll not a spell:.

Scroll Property aadpHolyWater Auto

But if I try to make this:

spell Property aadpHolyWater Auto
It will not auto fill, but that is not surprising because it is a scroll not a spell! :wallbash:

So, again I have to ask: How do you detect if a particular scroll is equipped in the right and left hand?

OR maybe I should say: How do you detect if THE SPELL of a particular scroll is equipped in the right and or left hand?

Remember that scrolls are like objects that can be droped to the ground but they have spell effect tab as well. So there is NO "spell" to detect only the scroll.

Detecting that just any spell is equipped or not is not good enough, I need to know that is a particular "scroll/spell" (my Holy water scroll's spell) and if it is in one hand or if 2 scrolls were equipped and they are thus in both hands (one in each hand).

Or should I just change the scroll settings so that it can only be equipped in one hand? That seems a little unfair to the player.

Just to be clear, I made a the casting art look like a glass bottle, so when the "spell" is equipped it looks like a bottle in your hand or one in each hand. But it is still only a spell that was equipped from a scroll.

I know that is about as clear as mud, but I have no other way to describe this situation. I always seem to be doing unorthodox things in my mods :huh:


It's GetEquippedSpell(0) for left hand, GetEquippedSpell(1) for the right. There's also (2) and even (3) (for 'other' and 'instant' but I've never used them).

What you're doing here however is a little confusing especially because I don't think you can 'equip' a scroll. Are you equipping a spell when you use that scroll, or are you equipping a weapon? If your 'scroll' of holy water is actually a weapon, you check for that differently. If it's indeed a spell, then your property should be a spell type.

If your scroll is equipping as a weapon, you need If Actor.GetEquippedWeapon(abLeftHand = false) != myScroll for the right hand and Actor.GetEquippedWeapon(abLeftHand = true) for the left hand.
User avatar
Samantha hulme
 
Posts: 3373
Joined: Wed Jun 21, 2006 4:22 pm

Post » Sat Nov 17, 2012 11:12 am

I would have thought there would be a special function for this like :

GetEquippedSCROLL(which hand)

But I cannot find one.
User avatar
Lawrence Armijo
 
Posts: 3446
Joined: Thu Sep 27, 2007 7:12 pm

Post » Sat Nov 17, 2012 11:25 am

This is screwed up. Magic Scrolls return as item type 9 (Magic Spell) but you can't cast them to a spell, nor is there a way to identify whether or not a specific one is equipped. And "GetEquipped()" doesn't work for anything in the left hand.

Wow.

Normally, to detect which hand has an equipped spell you would use 0 for left hand and 1 for the right hand.

So... I guess you need to find a work-around. What is it that you want to accomplish when your holy water is equipped in somebody's right (or left) hand? Perhaps there's some other way to do it?

EDIT:

Wait. You CAN cast the scroll to a spell type, but you need to go through a form first:

Spell MyHolyWaterScrollSpell = (MyHolyWaterScroll As Form) As Spell

Player.GetEquippedSpell(0) == myHolyWaterScrollSpell
Player.GetEquippedSpell(1) == myHolyWaterScrollSpell

I prototyped this in a script and it compiled successfully, all that remains is to see what happens in the game world.
User avatar
quinnnn
 
Posts: 3503
Joined: Sat Mar 03, 2007 1:11 pm

Post » Sat Nov 17, 2012 3:05 am

:ohmy:

:mad:

:wallbash:

wow....I am so stunned at how ridiculously esoteric that is, why would Bethesda do that to their own people let along us! :tongue:
Thank you so veryvery much for letting me know, how in the world did you find this info? Is it in the wiki "someplace"?


This is screwed up. Magic Scrolls return as item type 9 (Magic Spell) but you can't cast them to a spell, nor is there a way to identify whether or not a specific one is equipped. And "GetEquipped()" doesn't work for anything in the left hand.

Wow.

Normally, to detect which hand has an equipped spell you would use 0 for left hand and 1 for the right hand.

So... I guess you need to find a work-around. What is it that you want to accomplish when your holy water is equipped in somebody's right (or left) hand? Perhaps there's some other way to do it?

EDIT:

Wait. You CAN cast the scroll to a spell type, but you need to go through a form first:

Spell myHolyWaterScrollSpell = (MyHolyWaterScroll As Form) As Spell

Player.GetEquippedSpell(0) == myHolyWaterScrollSpell
Player.GetEquippedSpell(1) == myHolyWaterScrollSpell
User avatar
natalie mccormick
 
Posts: 3415
Joined: Fri Aug 18, 2006 8:36 am

Post » Sat Nov 17, 2012 12:11 am

Don't get too excited just yet... because it doesn't seem to be doing what I expected when I test it in the world.

(I found it at CreationKit.com when I was looking around at casting types)
User avatar
Amiee Kent
 
Posts: 3447
Joined: Thu Jun 15, 2006 2:25 pm

Post » Sat Nov 17, 2012 2:13 am

so I put a request for

GetEquippedScroll(which hand)

over on the skse thread.

But that will not help me now. Thanks for trying.


It is very complicated what I am trying to do, but here is a summery:

Right now the Holy water is a scroll, it cannot be a spell for technical reasons concerning rapid fire pressing of the cast button (the spell needs to only work ONCE and there is no way to remove the spell from the player as the player rapidly presses the cast key because of the #$%$$#@ script lag).

So making this a scroll is fine except that it is in the scroll section of the inventory and this bugs a lot a players. So I am trying to make a potion that when you drink it auto equips the scroll. This is all great until the player dose not use the scroll and instead switches to a weapon or some other items. Now he has the scroll in the inventory as well as the other holy water potions.

To remove the scroll from inventory :

 Event OnObjectUnequipped(Form akBaseObject, ObjectReference akReference)if akBaseObject.gettype() == 23 ;-- scroll itemint itemcount = me.getitemcount(akBaseObject)if ItemCount == 1   if me.GetEquippedspell(1) != (aadpHolyWater)as spell) && (me.GetEquippedspell(0) != (aadpHolyWater)as spell)	me.RemoveItem(aadpHolyWater)   endif	  elseif iItemCount == 2	   if (me.GetEquippedspell(0) != aadpHolyWater) && (me.GetEquippedSpell(1) != aadpHolyWater)		me.RemoveItem(aadpHolyWater, 2)		 elseif (me.GetEquippedspell(0) != aadpHolyWater) || (me.GetEquippedSpell(1) != aadpHolyWater)		me.RemoveItem(aadpHolyWater)	  endif   endifendifendevent


The above code is not finished, I still need to add the potion BACK to inventory but as you know I am stuck on the (me.GetEquippedSpell(1) != aadpHolyWater) issue.
And there may be other errors in the script as I have not been able to compile it yet BECAUSE of the (me.GetEquippedSpell(1) != aadpHolyWater) issue.
User avatar
sam smith
 
Posts: 3386
Joined: Sun Aug 05, 2007 3:55 am

Post » Sat Nov 17, 2012 3:26 am

I tried doing this:

Spell Property LeftHandSpell AutoSpell Property RightHandSpell AutoLeftHandSpell = Player.GetEquippedSpell(0)RightHandSpell = Player.GetEquippedSpell(1)Spell MySpell = (MyScroll As Form) As SpellIf LeftHandSpell = MySpell	 MsgThisWorked.Show()EndIf
But when I tried it in the game, the message showed up no matter what I had in my hand (even if it was empty). That svcks.

Straight comparing MySpell to GetEquippedSpell(0/1) didn't work either... I kept getting the message.

Damn.

Well... sorry spooky... that's all I got. :(

EDIT:

okay, it's not all I got, because I'm determined to make this [censored] thing work.

So here's what happened:

I scripted the same thing you see above (getequippedspell, compare that property to another property, etc.) and it failed when I first tried it right after loading the plugin but... get this...

... it *worked* after I changed my gear. It was failing consistently because I was checking it immediately after loading it in the game.

Long story short: this actually should work for you, but you might run into problems if you happen to be checking the player right after they have loaded the game (which you can't account for).
User avatar
trisha punch
 
Posts: 3410
Joined: Thu Jul 13, 2006 5:38 am

Post » Sat Nov 17, 2012 9:06 am

Maybe it would be best for me to just limit the scroll to one hand? Kind of svcks but that would solve the issue for now. :confused:
User avatar
Eileen Collinson
 
Posts: 3208
Joined: Thu Dec 28, 2006 2:42 am

Post » Sat Nov 17, 2012 11:17 am

Maybe it would be best for me to just limit the scroll to one hand? Kind of svcks but that would solve the issue for now. :confused:

I'd go with that if I were you. It does svck, but it will cut down on so much bs on your part.
User avatar
Elea Rossi
 
Posts: 3554
Joined: Tue Mar 27, 2007 1:39 am


Return to V - Skyrim