GetItemCount inside "OnAdd" block

Post » Mon May 07, 2012 10:13 pm

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
BlackaneseB
 
Posts: 3431
Joined: Sat Sep 23, 2006 1:21 am

Post » Mon May 07, 2012 9:25 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
chloe hampson
 
Posts: 3493
Joined: Sun Jun 25, 2006 12:15 pm

Post » Mon May 07, 2012 5:28 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
matt
 
Posts: 3267
Joined: Wed May 30, 2007 10:17 am


Return to IV - Oblivion