GetItemCount inside "OnAdd" block

Post » Fri Jul 22, 2011 4:33 am

Hi, I've a problem:
I've this code:
Begin OnAdd Player   Set X to (Player.GetItemCount Token)EndBegin OnDrop Player   Set X to (Player.GetItemCount Token)End

I've no Tokens in my inventory, and I pick the first one:
Do "OnAdd" fire before the item is added (and GetItemCount still return 0) or it fire after (Thus GetItemCount return 1)?

And when I drop it, what happens with GetItemCount in the "OnDrop" block?
User avatar
I love YOu
 
Posts: 3505
Joined: Wed Aug 09, 2006 12:05 pm

Post » Thu Jul 21, 2011 11:01 pm

Try making a global, iTokenCountGLOB...
Begin OnAdd Player   Set iTokenCountGLOB to (iTokenCountGLOB + 1)EndBegin OnDrop Player   Set iTokenCountGLOB to (iTokenCountGLOB - 1)End
...and modifying it so the variable is only in one place?
User avatar
Chavala
 
Posts: 3355
Joined: Sun Jun 25, 2006 5:28 am

Post » Thu Jul 21, 2011 9:00 pm

No, I don't want to use variables. I need the use of GetItemCount.
Actually I can't test it myself (it's for a friend).
User avatar
Brittany Abner
 
Posts: 3401
Joined: Wed Oct 24, 2007 10:48 pm


Return to IV - Oblivion