Tokens keep being rejected

Post » Wed Oct 12, 2011 5:48 pm

Hello@ll,

I have made a Token, an unplayable ring, in order to distribute my object script, attached to the ring.

My mod does distribute the script via getfirstref and getnextref and the while...loop.

one of the first check when the token has been distributed is for it container/holder with GetContainer.

And there is the problem. Nearly half of all creatures and actors have no container. I use the command GetContainer from within the object script, the object script is attached to the token/unplayble ring,
which has been already added to the actors/creatures inventory with AddItem. Why does GetContainer not return its inventory owner? Do I have to wait for some frames, like in case of RemoveMe?
User avatar
FirDaus LOVe farhana
 
Posts: 3369
Joined: Thu Sep 13, 2007 3:42 am

Post » Wed Oct 12, 2011 6:00 am

Are the recipients loaded? Guess they'd have to be for RefWalking to work. Are you sure the refwalking distribution is working?
User avatar
Lifee Mccaslin
 
Posts: 3369
Joined: Fri Jun 01, 2007 1:03 am

Post » Wed Oct 12, 2011 9:31 am

Are the recipients loaded? Guess they'd have to be for RefWalking to work. Are you sure the refwalking distribution is working?


I do use two different refwalks with OBSE.


		set vIDcurrRace to getFirstRef 36 1 0				while(vIDcurrRace) 						if eval (vIDcurrRace.IsPersistent)                               if (vIDcurrRace.GetDead == 0)									if (vIDcurrRace.GetItemCount EGMEffectToken <= 0)					if bFatigue || bFainting						vIDcurrRace.addItem EGMEffectToken 1						endif													endif                          endif			endif					set vIDcurrRace to getNextRef					loop		set vIDcurrRace to getFirstRef 35 1 0				while(vIDcurrRace)									if eval (vIDcurrRace.IsPersistent) 				if (vIDcurrRace.GetDead == 0) 					if (vIDcurrRace.GetItemCount EGMEffectToken <= 0)						if bFatigue || bFainting							vIDcurrRace.addItem EGMEffectToken 1													endif					endif				endif				endif					set vIDcurrRace to getNextRef					loop	


The token gets distributed , yes, but in the Token script (Object script), the container test fails.

set myself to GetContainer ;
if (myself) ......
else count till 10 then RemoveMe
end
User avatar
~Amy~
 
Posts: 3478
Joined: Sat Aug 12, 2006 5:38 am

Post » Wed Oct 12, 2011 3:24 pm

OK, solved. It seems that it is just necessary to run the check again in the next frame, and a simple return did solve this issue. :foodndrink:
User avatar
^_^
 
Posts: 3394
Joined: Thu May 31, 2007 12:01 am


Return to IV - Oblivion