TLM scripts

Post » Tue May 18, 2010 8:26 am

I'm trying to work out how to remove all the excessive message boxes in TLM


The original part of the script which deals with the messages is:

	if ( water == 1)		MessageBox "TLM - You cannot go underwater with lights. Morrowind has removed the light source!"		set water to 0	else		MessageBox "TLM - Light source no longer being held... lighting bonuses reset."		StartScript _lanterns_loadgame_verify	endif	StartScript _lanterns_off	set state to 0	StopScript _lanterns_global_checkendifendifEnd


I've changed it to:

	if ( water == 1)		set water to 0	else		StartScript _lanterns_loadgame_verify	endif	StartScript _lanterns_off	set state to 0	StopScript _lanterns_global_checkendifendifEnd


I'm getting an error in game about "eval" when equipping the lightsources edited by TLM. Ideas anyone?
User avatar
Shiarra Curtis
 
Posts: 3393
Joined: Thu Jan 04, 2007 3:22 pm

Post » Tue May 18, 2010 9:45 pm

I'm getting an error in game about "eval" when equipping the lightsources edited by TLM. Ideas anyone?

I suggest try compiling the script with http://sourceforge.net/projects/mwedit/files/, as its error message are far more clear.
User avatar
Jinx Sykes
 
Posts: 3501
Joined: Sat Jan 20, 2007 11:12 pm

Post » Tue May 18, 2010 12:47 pm

try adding a space before the right closing bracket, from
	if ( water == 1)
to
	if ( water == 1 )

User avatar
Enie van Bied
 
Posts: 3350
Joined: Sun Apr 22, 2007 11:47 pm

Post » Tue May 18, 2010 4:24 pm

I suggest try compiling the script with http://sourceforge.net/projects/mwedit/files/, as its error message are far more clear.


Seems like the wrong file was linked, but i found a (earlier?) version of MWEdit. Here is a link:


http://sourceforge.net/projects/mwedit/files/mwedit/v0.6.1%20-%20Minor%20Update/mwedit-0.6.1.zip/download


This is what I got from MWEdit when I compiled the script. I also tried to compile the unaltered script and got the same message. : /

Line 38 ( 23): Error -1002: Unknown object ID 'player' found!


try adding a space before the right closing bracket


tried it, but got the same error.

I haven't noticed any issues in game except the error message.
User avatar
Becky Palmer
 
Posts: 3387
Joined: Wed Oct 04, 2006 4:43 am

Post » Tue May 18, 2010 9:12 am

Line 38 ( 23): Error -1002: Unknown object ID 'player' found!

It would be interesting to see what that line in the script looks like.
User avatar
JeSsy ArEllano
 
Posts: 3369
Joined: Fri Oct 20, 2006 10:51 am

Post » Tue May 18, 2010 9:24 am

It would be interesting to see what that line in the script looks like.




set height to player -> GetPos z


here is the whole script:


Begin _lanterns_global_checkfloat timershort effectshort watershort waterLevelshort heightshort waterExistsshort stateif ( MenuMode == 1)	returnendifif ( state == 0 )	set waterLevel to GetWaterLevel	set waterExists to 1	if ( GetInterior == 1 )		if ( waterLevel == 0 )			set waterExists to 0		endif	endif		if ( ScriptRunning "_lanterns_SneakPen" == 0 )		StartScript "_lanterns_SneakPen"	endif	set state to 1	returnendifif ( state == 1 )	if ( CellChanged == 1 )		set state to 0		return	endif	set height to player -> GetPos z	if ( waterExists )		if ( height > waterLevel )			set water to 0		else			set water to 1										; player is under water			set timer to timer + 2								; accelerate the timer to warn player quickly		endif	endif	if ( timer < 5 )		set timer to timer + GetSecondsPassed		return	endif	if ( player->getSpellEffects, "_lighthigh" )		set effect to 4	elseif ( player->getSpellEffects, "_lightmed" )		set effect to 3	elseif ( player->getSpellEffects, "_lightlow" )		set effect to 2	elseif ( player->getSpellEffects, "_lightvlow" )		set effect to 1	else		set effect to 0	endif	set timer to 0if ( effect > 0 )	if ( player->HasItemEquipped, torch )		return	endif	if ( player->HasItemEquipped, torch_64 )		return	endif	if ( player->HasItemEquipped, torch_77 )		return	endif	if ( player->HasItemEquipped, torch_128 )		return	endif	if ( player->HasItemEquipped, torch_128_Off )		return	endif	if ( player->HasItemEquipped, torch_157 )		return	endif	if ( player->HasItemEquipped, torch_256 )		return	endif	if ( player->HasItemEquipped, torch_infinite_time )		return	endif	if ( player->HasItemEquipped, torch_infinite_time_unique )		return	endif	if ( player->HasItemEquipped, light_com_torch_01 )		return	endif	if ( player->HasItemEquipped, light_com_torch_01_77 )		return	endif	if ( player->HasItemEquipped, light_com_torch_01_128 )		return	endif	if ( player->HasItemEquipped, light_com_torch_01_200 )		return	endif	if ( player->HasItemEquipped, light_com_torch_01_256 )		return	endif	if ( player->HasItemEquipped, light_com_torch_01_off )		return	endif	if ( player->HasItemEquipped, light_com_torch_02 )		return	endif	if ( player->HasItemEquipped, light_com_lantern_01 )		return	endif	if ( player->HasItemEquipped, light_com_lantern_01_77 )		return	endif	if ( player->HasItemEquipped, light_com_lantern_01_128 )		return	endif	if ( player->HasItemEquipped, light_com_lantern_01_Off )		return	endif	if ( player->HasItemEquipped, light_com_lantern_02 )		return	endif	if ( player->HasItemEquipped, light_com_lantern_02_64 )		return	endif	if ( player->HasItemEquipped, light_com_lantern_02_128 )		return	endif	if ( player->HasItemEquipped, light_com_lantern_02_128_Off )		return	endif	if ( player->HasItemEquipped, light_com_lantern_02_177 )		return	endif	if ( player->HasItemEquipped, light_com_lantern_02_INF )		return	endif	if ( player->HasItemEquipped, light_com_lantern_02_Off )		return	endif	if ( player->HasItemEquipped, Light_De_Lantern_01 )		return	endif	if ( player->HasItemEquipped, Light_De_Lantern_01_77 )		return	endif	if ( player->HasItemEquipped, Light_De_Lantern_01_128 )		return	endif	if ( player->HasItemEquipped, Light_De_Lantern_01_177 )		return	endif	if ( player->HasItemEquipped, Light_De_Lantern_01_off )		return	endif	if ( player->HasItemEquipped, light_de_lantern_02 )		return	endif	if ( player->HasItemEquipped, light_de_lantern_02_128 )		return	endif	if ( player->HasItemEquipped, light_de_lantern_02_256_blue )		return	endif	if ( player->HasItemEquipped, light_de_lantern_02_256_Off )		return	endif	if ( player->HasItemEquipped, light_de_lantern_02_blue )		return	endif	if ( player->HasItemEquipped, "light_de_lantern_02-128" )		return	endif	if ( player->HasItemEquipped, "light_de_lantern_02-177" )		return	endif	if ( player->HasItemEquipped, light_de_lantern_05 )		return	endif	if ( player->HasItemEquipped, light_de_lantern_05_128_Carry )		return	endif	if ( player->HasItemEquipped, light_de_lantern_05_200 )		return	endif	if ( player->HasItemEquipped, light_de_lantern_05_Carry )		return	endif	if ( player->HasItemEquipped, light_de_lantern_06 )		return	endif	if ( player->HasItemEquipped, light_de_lantern_06_64 )		return	endif	if ( player->HasItemEquipped, light_de_lantern_06_128 )		return	endif	if ( player->HasItemEquipped, light_de_lantern_06_177 )		return	endif	if ( player->HasItemEquipped, light_de_lantern_06_256 )		return	endif	if ( player->HasItemEquipped, Light_De_Lantern_06A )		return	endif	if ( player->HasItemEquipped, light_de_lantern_07 )		return	endif	if ( player->HasItemEquipped, light_de_lantern_07_128 )		return	endif	if ( player->HasItemEquipped, light_de_lantern_07_warm )		return	endif	if ( player->HasItemEquipped, light_de_lantern_10 )		return	endif	if ( player->HasItemEquipped, light_de_lantern_10_128 )		return	endif	if ( player->HasItemEquipped, light_de_lantern_11 )		return	endif	if ( player->HasItemEquipped, light_de_lantern_14 )		return	endif	if ( water == 1 )		set water to 0	else		StartScript _lanterns_loadgame_verify	endif	StartScript _lanterns_off	set state to 0	StopScript _lanterns_global_checkendifendifEnd

User avatar
[ becca ]
 
Posts: 3514
Joined: Wed Jun 21, 2006 12:59 pm

Post » Tue May 18, 2010 10:12 am

set height to player -> GetPos z

Does it help to add parentheses?

set height to ( player->GetPos z )
User avatar
Alessandra Botham
 
Posts: 3440
Joined: Mon Nov 13, 2006 6:27 pm

Post » Tue May 18, 2010 1:10 pm

This is what I got from MWEdit when I compiled the script. I also tried to compile the unaltered script and got the same message. : /

Line 38 ( 23): Error -1002: Unknown object ID 'player' found!

You have to tick Morrowind.esm and Tribunal.esm manually in MWEdit when you load the TLM esp, it doesn't do it automatically.
User avatar
Emilie Joseph
 
Posts: 3387
Joined: Thu Mar 15, 2007 6:28 am

Post » Tue May 18, 2010 11:34 am

You have to tick Morrowind.esm and Tribunal.esm manually in MWEdit when you load the TLM esp, it doesn't do it automatically.



the script compiles successfully when the .esm files are ticked. Any clues to when you get the "expression" followed by "eval"-error messages?
User avatar
tegan fiamengo
 
Posts: 3455
Joined: Mon Jan 29, 2007 9:53 am

Post » Tue May 18, 2010 11:35 pm

Iunno, that's pretty generic. Any group of operators and values (like water == 1) is an expression. Can't you post the exact message?
User avatar
casey macmillan
 
Posts: 3474
Joined: Fri Feb 09, 2007 7:37 pm

Post » Tue May 18, 2010 9:09 am

verify to have the warning level set to strong
User avatar
amhain
 
Posts: 3506
Joined: Sun Jan 07, 2007 12:31 pm

Post » Tue May 18, 2010 7:48 pm

Out of curiosity, is there any realistic chance that this is another one of those seemingly arbitrary and intermittent issues which are sometimes caused by object IDs (including script names) that start with leading underscores?

[edit] I also notice this script directly references the object "torch" which I had some unfortunate issues with in the past. It seems that there was something wrong with the way the object was tokenized during script compile and it failed miserably whenever both Tribunal and Bloodmoon were included as master files. Although, in fairness, the error in my script occurred when I tried to do a GetItemCount. But then I didn't even try the HasItemEquipped function, so it might suffer the same error.

To provide just a bit more background, the command player->GetitemCount "torch" compiled just fine. However, the moment the game tried to process the script, it failed with an eval error.
User avatar
Brad Johnson
 
Posts: 3361
Joined: Thu May 24, 2007 7:19 pm

Post » Tue May 18, 2010 3:28 pm

I suspect this script may cause some problems due to excessive elseif, here is a revised version, see if it can help
Begin _lanterns_removeshort numbershort originalshort TYPE; type breaks down lanterns & torches to the duration type for ELSEIF efficiency; 0 - V Low; 1 - Low; 2 - Medium; 3 - High; changed to avoid too many ifs /abotStopScript _lanterns_remove ; this will be effective next frame, so better put it here so whe can just return asap /abotIF ( TYPE == 0 )	if ( player->HasItemEquipped "torch_64" )		set original to player->GetItemCount "torch_64"		set number to original		while ( number > 0 )			player->RemoveItem "torch_64" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "torch_64" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "torch_77" )		set original to player->GetItemCount "torch_77"		set number to original		while ( number > 0 )			player->RemoveItem "torch_77" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "torch_77" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "light_com_torch_01_77" )		set original to player->GetItemCount "light_com_torch_01_77"		set number to original		while ( number > 0 )			player->RemoveItem "light_com_torch_01_77" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_com_torch_01_77" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "Light_De_Lantern_01_77" )		set original to player->GetItemCount "Light_De_Lantern_01_77"		set number to original		while ( number > 0 )			player->RemoveItem "Light_De_Lantern_01_77" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "Light_De_Lantern_01_77" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "Light_De_Lantern_01_128" )		set original to player->GetItemCount "Light_De_Lantern_01_128"		set number to original		while ( number > 0 )			player->RemoveItem "Light_De_Lantern_01_128" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "Light_De_Lantern_01_128" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "Light_De_Lantern_01_177" )		set original to player->GetItemCount "Light_De_Lantern_01_177"		set number to original		while ( number > 0 )			player->RemoveItem "Light_De_Lantern_01_177" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "Light_De_Lantern_01_177" 1				set number to ( number + 1 )			endwhile		endif		return	endifendif; break	IF ( TYPE == 0 )	if ( player->HasItemEquipped "Light_De_Lantern_01_off" )		set original to player->GetItemCount "Light_De_Lantern_01_off"		set number to original		while ( number > 0 )			player->RemoveItem "Light_De_Lantern_01_off" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "Light_De_Lantern_01_off" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "light_de_lantern_05_128_Carry" )		set original to player->GetItemCount "light_de_lantern_05_128_Carry"		set number to original		while ( number > 0 )			player->RemoveItem "light_de_lantern_05_128_Carry" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_de_lantern_05_128_Carry" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "light_de_lantern_05_200" )		set original to player->GetItemCount "light_de_lantern_05_200"		set number to original		while ( number > 0 )			player->RemoveItem "light_de_lantern_05_200" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_de_lantern_05_200" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "light_de_lantern_05_Carry" )		set original to player->GetItemCount "light_de_lantern_05_Carry"		set number to original		while ( number > 0 )			player->RemoveItem "light_de_lantern_05_Carry" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_de_lantern_05_Carry" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "light_de_lantern_06_64" )		set original to player->GetItemCount "light_de_lantern_06_64"		set number to original		while ( number > 0 )			player->RemoveItem "light_de_lantern_06_64" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_de_lantern_06_64" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "light_de_lantern_07_128" )		set original to player->GetItemCount "light_de_lantern_07_128"		set number to original		while ( number > 0 )			player->RemoveItem "light_de_lantern_07_128" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_de_lantern_07_128" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "light_de_lantern_10_128" )		set original to player->GetItemCount "light_de_lantern_10_128"		set number to original		while ( number > 0 )			player->RemoveItem "light_de_lantern_10_128" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_de_lantern_10_128" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "light_de_lantern_11" )		set original to player->GetItemCount "light_de_lantern_11"		set number to original		while ( number > 0 )			player->RemoveItem "light_de_lantern_11" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_de_lantern_11" 1				set number to ( number + 1 )			endwhile		endif	endif	returnendif	IF ( TYPE == 1 )	;MESSAGEBOX "TYPE == 1"	if ( player->HasItemEquipped "torch_128" )	;MESSAGEBOX "Torch_128 Equipped"		set original to player->GetItemCount "torch_128"		set number to original		while ( number > 0 )			player->RemoveItem "torch_128" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "torch_128" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "torch_128_Off" )		set original to player->GetItemCount "torch_128_Off"		set number to original		while ( number > 0 )			player->RemoveItem "torch_128_Off" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "torch_128_Off" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "torch_157" )		set original to player->GetItemCount "torch_157"		set number to original		while ( number > 0 )			player->RemoveItem "torch_157" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "torch_157" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "torch_infinite_time_unique" )		set original to player->GetItemCount "torch_infinite_time_unique"		set number to original		while ( number > 0 )			player->RemoveItem "torch_infinite_time_unique" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "torch_infinite_time_unique" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "light_com_torch_01_128" )		set original to player->GetItemCount "light_com_torch_01_128"		set number to original		while ( number > 0 )			player->RemoveItem "light_com_torch_01_128" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_com_torch_01_128" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "light_com_torch_01_200" )		set original to player->GetItemCount "light_com_torch_01_200"		set number to original		while ( number > 0 )			player->RemoveItem "light_com_torch_01_200" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_com_torch_01_200" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "light_com_lantern_01_77" )		set original to player->GetItemCount "light_com_lantern_01_77"		set number to original		while ( number > 0 )			player->RemoveItem "light_com_lantern_01_77" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_com_lantern_01_77" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "light_com_lantern_02_64" )		set original to player->GetItemCount "light_com_lantern_02_64"		set number to original		while ( number > 0 )			player->RemoveItem "light_com_lantern_02_64" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_com_lantern_02_64" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "Light_De_Lantern_01" )		set original to player->GetItemCount "Light_De_Lantern_01"		set number to original		while ( number > 0 )			player->RemoveItem "Light_De_Lantern_01" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "Light_De_Lantern_01" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped, "light_de_lantern_02-128" )		set original to player->GetItemCount "light_de_lantern_02-128"		set number to original		while ( number > 0 )			player->RemoveItem "light_de_lantern_02-128" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_de_lantern_02-128" 1				set number to ( number + 1 )			endwhile		endif		return	endifendif; breakIF ( TYPE == 1 )	if ( player->HasItemEquipped, "light_de_lantern_02-177" )		set original to player->GetItemCount "light_de_lantern_02-177"		set number to original		while ( number > 0 )			player->RemoveItem "light_de_lantern_02-177" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_de_lantern_02-177" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "light_de_lantern_02_128" )		set original to player->GetItemCount "light_de_lantern_02_128"		set number to original		while ( number > 0 )			player->RemoveItem "light_de_lantern_02_128" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_de_lantern_02_128" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "light_de_lantern_02_256_blue" )		set original to player->GetItemCount "light_de_lantern_02_256_blue"		set number to original		while ( number > 0 )			player->RemoveItem "light_de_lantern_02_256_blue" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_de_lantern_02_256_blue" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "light_de_lantern_02_256_Off" )		set original to player->GetItemCount "light_de_lantern_02_256_Off"		set number to original		while ( number > 0 )			player->RemoveItem "light_de_lantern_02_256_Off" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_de_lantern_02_256_Off" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "light_de_lantern_02_blue" )		set original to player->GetItemCount "light_de_lantern_02_blue"		set number to original		while ( number > 0 )			player->RemoveItem "light_de_lantern_02_blue" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_de_lantern_02_blue" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "light_de_lantern_05" )		set original to player->GetItemCount "light_de_lantern_05"		set number to original		while ( number > 0 )			player->RemoveItem "light_de_lantern_05" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_de_lantern_05" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "light_de_lantern_06" )		set original to player->GetItemCount "light_de_lantern_06"		set number to original		while ( number > 0 )			player->RemoveItem "light_de_lantern_06" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_de_lantern_06" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "light_de_lantern_06_128" )		set original to player->GetItemCount "light_de_lantern_06_128"		set number to original		while ( number > 0 )			player->RemoveItem "light_de_lantern_06_128" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_de_lantern_06_128" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "light_de_lantern_06_177" )		set original to player->GetItemCount "light_de_lantern_06_177"		set number to original		while ( number > 0 )			player->RemoveItem "light_de_lantern_06_177" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_de_lantern_06_177" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "light_de_lantern_07" )		set original to player->GetItemCount "light_de_lantern_07"		set number to original		while ( number > 0 )			player->RemoveItem "light_de_lantern_07" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_de_lantern_07" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "light_de_lantern_07_warm" )		set original to player->GetItemCount "light_de_lantern_07_warm"		set number to original		while ( number > 0 )			player->RemoveItem "light_de_lantern_07_warm" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_de_lantern_07_warm" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "light_de_lantern_10" )		set original to player->GetItemCount "light_de_lantern_10"		set number to original		while ( number > 0 )			player->RemoveItem "light_de_lantern_10" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_de_lantern_10" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "light_de_lantern_14" )		set original to player->GetItemCount "light_de_lantern_14"		set number to original		while ( number > 0 )			player->RemoveItem "light_de_lantern_14" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_de_lantern_14" 1				set number to ( number + 1 )			endwhile		endif	endif	returnendifIF ( TYPE == 2 )	if ( player->HasItemEquipped "torch" )		set original to player->GetItemCount "torch"		set number to original		while ( number > 0 )			player->RemoveItem "torch" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "torch" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "torch_256" )		set original to player->GetItemCount "torch_256"		set number to original		while ( number > 0 )			player->RemoveItem "torch_256" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "torch_256" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "torch_infinite_time" )		set original to player->GetItemCount "torch_infinite_time"		set number to original		while ( number > 0 )			player->RemoveItem "torch_infinite_time" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "torch_infinite_time" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "light_com_torch_01" )		set original to player->GetItemCount "light_com_torch_01"		set number to original		while ( number > 0 )			player->RemoveItem "light_com_torch_01" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_com_torch_01" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "light_com_torch_01_256" )		set original to player->GetItemCount "light_com_torch_01_256"		set number to original		while ( number > 0 )			player->RemoveItem "light_com_torch_01_256" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_com_torch_01_256" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "light_com_torch_01_off" )		set original to player->GetItemCount "light_com_torch_01_off"		set number to original		while ( number > 0 )			player->RemoveItem "light_com_torch_01_off" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_com_torch_01_off" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "light_com_torch_02" )		set original to player->GetItemCount "light_com_torch_02"		set number to original		while ( number > 0 )			player->RemoveItem "light_com_torch_02" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_com_torch_02" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "light_com_lantern_01_128" )		set original to player->GetItemCount "light_com_lantern_01_128"		set number to original		while ( number > 0 )			player->RemoveItem "light_com_lantern_01_128" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_com_lantern_01_128" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "light_com_lantern_01_Off" )		set original to player->GetItemCount "light_com_lantern_01_Off"		set number to original		while ( number > 0 )			player->RemoveItem "light_com_lantern_01_Off" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_com_lantern_01_Off" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "light_com_lantern_02_128" )		set original to player->GetItemCount "light_com_lantern_02_128"		set number to original		while ( number > 0 )			player->RemoveItem "light_com_lantern_02_128" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_com_lantern_02_128" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "light_com_lantern_02_128_Off" )		set original to player->GetItemCount "light_com_lantern_02_128_Off"		set number to original		while ( number > 0 )			player->RemoveItem "light_com_lantern_02_128_Off" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_com_lantern_02_128_Off" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "light_com_lantern_02_177" )		set original to player->GetItemCount "light_com_lantern_02_177"		set number to original		while ( number > 0 )			player->RemoveItem "light_com_lantern_02_177" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_com_lantern_02_177" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "light_com_lantern_02_Off" )		set original to player->GetItemCount "light_com_lantern_02_Off"		set number to original		while ( number > 0 )			player->RemoveItem "light_com_lantern_02_Off" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_com_lantern_02_Off" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "light_de_lantern_02" )		set original to player->GetItemCount "light_de_lantern_02"		set number to original		while ( number > 0 )			player->RemoveItem "light_de_lantern_02" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_de_lantern_02" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "light_de_lantern_06_256" )		set original to player->GetItemCount "light_de_lantern_06_256"		set number to original		while ( number > 0 )			player->RemoveItem "light_de_lantern_06_256" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_de_lantern_06_256" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "Light_De_Lantern_06A" )		set original to player->GetItemCount "Light_De_Lantern_06A"		set number to original		while ( number > 0 )			player->RemoveItem "Light_De_Lantern_06A" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "Light_De_Lantern_06A" 1				set number to ( number + 1 )			endwhile		endif	endif	returnendifIF ( TYPE == 3 )	if ( player->HasItemEquipped "light_com_lantern_01" )		set original to player->GetItemCount "light_com_lantern_01"		set number to original		while ( number > 0 )			player->RemoveItem "light_com_lantern_01" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_com_lantern_01" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "light_com_lantern_02" )		set original to player->GetItemCount "light_com_lantern_02"		set number to original		while ( number > 0 )			player->RemoveItem "light_com_lantern_02" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_com_lantern_02" 1				set number to ( number + 1 )			endwhile		endif		return	elseif ( player->HasItemEquipped "light_com_lantern_02_INF" )		set original to player->GetItemCount "light_com_lantern_02_INF"		set number to original		while ( number > 0 )			player->RemoveItem "light_com_lantern_02_INF" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_com_lantern_02_INF" 1				set number to ( number + 1 )			endwhile		endif	endifENDIFEnd

User avatar
Alyce Argabright
 
Posts: 3403
Joined: Mon Aug 20, 2007 8:11 pm

Post » Tue May 18, 2010 2:21 pm

Umm, that's not the same script as Woven Tree's (_lanterns_global_check). Am I missing something?
User avatar
Logan Greenwood
 
Posts: 3416
Joined: Mon Jul 30, 2007 5:41 pm

Post » Tue May 18, 2010 9:41 am

Umm, that's not the same script as Woven Tree's (_lanterns_global_check). Am I missing something?
If the problem is not referencing the "torch"object (which may be), the only other thing that seems wrong with that script was if ( water == 1).
I assume tests for previous conditions can be done easily (correct the second, comment the first)

the _lanterns_remove script
- is the longest in the mod (in my experience, a good candidate for probable errors ;) )
- is called from _lanterns_global_check (and other scripts)
- had debugging messageboxes ;MESSAGEBOX "Torch_128 Equipped"
- had the only relevant (and often nasty) warning signaled by MWEdit
(using = instead of == in comparisons, a problem signaled in other 2 scripts, is usually not a real problem because it is the same for TESCS and at runtime, while having too many elseif can lead to runtime problems)
No other ideas.
[EDIT]for clarification, here is the original script
Begin _lanterns_removeshort numbershort originalshort TYPE; type breaks down lanterns & torches to the duration type for ELSEIF efficiency; 0 - V Low; 1 - Low; 2 - Medium; 3 - HighIF ( TYPE == 0 )	if ( player->HasItemEquipped "torch_64" )		set original to player->GetItemCount "torch_64"		set number to original		while ( number > 0 )			player->RemoveItem "torch_64" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "torch_64" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "torch_77" )		set original to player->GetItemCount "torch_77"		set number to original		while ( number > 0 )			player->RemoveItem "torch_77" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "torch_77" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "light_com_torch_01_77" )		set original to player->GetItemCount "light_com_torch_01_77"		set number to original		while ( number > 0 )			player->RemoveItem "light_com_torch_01_77" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_com_torch_01_77" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "Light_De_Lantern_01_77" )		set original to player->GetItemCount "Light_De_Lantern_01_77"		set number to original		while ( number > 0 )			player->RemoveItem "Light_De_Lantern_01_77" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "Light_De_Lantern_01_77" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "Light_De_Lantern_01_128" )		set original to player->GetItemCount "Light_De_Lantern_01_128"		set number to original		while ( number > 0 )			player->RemoveItem "Light_De_Lantern_01_128" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "Light_De_Lantern_01_128" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "Light_De_Lantern_01_177" )		set original to player->GetItemCount "Light_De_Lantern_01_177"		set number to original		while ( number > 0 )			player->RemoveItem "Light_De_Lantern_01_177" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "Light_De_Lantern_01_177" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "Light_De_Lantern_01_off" )		set original to player->GetItemCount "Light_De_Lantern_01_off"		set number to original		while ( number > 0 )			player->RemoveItem "Light_De_Lantern_01_off" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "Light_De_Lantern_01_off" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "light_de_lantern_05_128_Carry" )		set original to player->GetItemCount "light_de_lantern_05_128_Carry"		set number to original		while ( number > 0 )			player->RemoveItem "light_de_lantern_05_128_Carry" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_de_lantern_05_128_Carry" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "light_de_lantern_05_200" )		set original to player->GetItemCount "light_de_lantern_05_200"		set number to original		while ( number > 0 )			player->RemoveItem "light_de_lantern_05_200" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_de_lantern_05_200" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "light_de_lantern_05_Carry" )		set original to player->GetItemCount "light_de_lantern_05_Carry"		set number to original		while ( number > 0 )			player->RemoveItem "light_de_lantern_05_Carry" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_de_lantern_05_Carry" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "light_de_lantern_06_64" )		set original to player->GetItemCount "light_de_lantern_06_64"		set number to original		while ( number > 0 )			player->RemoveItem "light_de_lantern_06_64" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_de_lantern_06_64" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "light_de_lantern_07_128" )		set original to player->GetItemCount "light_de_lantern_07_128"		set number to original		while ( number > 0 )			player->RemoveItem "light_de_lantern_07_128" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_de_lantern_07_128" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "light_de_lantern_10_128" )		set original to player->GetItemCount "light_de_lantern_10_128"		set number to original		while ( number > 0 )			player->RemoveItem "light_de_lantern_10_128" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_de_lantern_10_128" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "light_de_lantern_11" )		set original to player->GetItemCount "light_de_lantern_11"		set number to original		while ( number > 0 )			player->RemoveItem "light_de_lantern_11" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_de_lantern_11" 1				set number to ( number + 1 )			endwhile		endif	endifELSEIF ( TYPE == 1 )MESSAGEBOX "TYPE == 1"	if ( player->HasItemEquipped "torch_128" )MESSAGEBOX "Torch_128 Equipped"		set original to player->GetItemCount "torch_128"		set number to original		while ( number > 0 )			player->RemoveItem "torch_128" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "torch_128" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "torch_128_Off" )		set original to player->GetItemCount "torch_128_Off"		set number to original		while ( number > 0 )			player->RemoveItem "torch_128_Off" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "torch_128_Off" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "torch_157" )		set original to player->GetItemCount "torch_157"		set number to original		while ( number > 0 )			player->RemoveItem "torch_157" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "torch_157" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "torch_infinite_time_unique" )		set original to player->GetItemCount "torch_infinite_time_unique"		set number to original		while ( number > 0 )			player->RemoveItem "torch_infinite_time_unique" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "torch_infinite_time_unique" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "light_com_torch_01_128" )		set original to player->GetItemCount "light_com_torch_01_128"		set number to original		while ( number > 0 )			player->RemoveItem "light_com_torch_01_128" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_com_torch_01_128" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "light_com_torch_01_200" )		set original to player->GetItemCount "light_com_torch_01_200"		set number to original		while ( number > 0 )			player->RemoveItem "light_com_torch_01_200" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_com_torch_01_200" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "light_com_lantern_01_77" )		set original to player->GetItemCount "light_com_lantern_01_77"		set number to original		while ( number > 0 )			player->RemoveItem "light_com_lantern_01_77" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_com_lantern_01_77" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "light_com_lantern_02_64" )		set original to player->GetItemCount "light_com_lantern_02_64"		set number to original		while ( number > 0 )			player->RemoveItem "light_com_lantern_02_64" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_com_lantern_02_64" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "Light_De_Lantern_01" )		set original to player->GetItemCount "Light_De_Lantern_01"		set number to original		while ( number > 0 )			player->RemoveItem "Light_De_Lantern_01" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "Light_De_Lantern_01" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped, "light_de_lantern_02-128" )		set original to player->GetItemCount "light_de_lantern_02-128"		set number to original		while ( number > 0 )			player->RemoveItem "light_de_lantern_02-128" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_de_lantern_02-128" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped, "light_de_lantern_02-177" )		set original to player->GetItemCount "light_de_lantern_02-177"		set number to original		while ( number > 0 )			player->RemoveItem "light_de_lantern_02-177" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_de_lantern_02-177" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "light_de_lantern_02_128" )		set original to player->GetItemCount "light_de_lantern_02_128"		set number to original		while ( number > 0 )			player->RemoveItem "light_de_lantern_02_128" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_de_lantern_02_128" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "light_de_lantern_02_256_blue" )		set original to player->GetItemCount "light_de_lantern_02_256_blue"		set number to original		while ( number > 0 )			player->RemoveItem "light_de_lantern_02_256_blue" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_de_lantern_02_256_blue" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "light_de_lantern_02_256_Off" )		set original to player->GetItemCount "light_de_lantern_02_256_Off"		set number to original		while ( number > 0 )			player->RemoveItem "light_de_lantern_02_256_Off" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_de_lantern_02_256_Off" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "light_de_lantern_02_blue" )		set original to player->GetItemCount "light_de_lantern_02_blue"		set number to original		while ( number > 0 )			player->RemoveItem "light_de_lantern_02_blue" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_de_lantern_02_blue" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "light_de_lantern_05" )		set original to player->GetItemCount "light_de_lantern_05"		set number to original		while ( number > 0 )			player->RemoveItem "light_de_lantern_05" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_de_lantern_05" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "light_de_lantern_06" )		set original to player->GetItemCount "light_de_lantern_06"		set number to original		while ( number > 0 )			player->RemoveItem "light_de_lantern_06" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_de_lantern_06" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "light_de_lantern_06_128" )		set original to player->GetItemCount "light_de_lantern_06_128"		set number to original		while ( number > 0 )			player->RemoveItem "light_de_lantern_06_128" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_de_lantern_06_128" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "light_de_lantern_06_177" )		set original to player->GetItemCount "light_de_lantern_06_177"		set number to original		while ( number > 0 )			player->RemoveItem "light_de_lantern_06_177" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_de_lantern_06_177" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "light_de_lantern_07" )		set original to player->GetItemCount "light_de_lantern_07"		set number to original		while ( number > 0 )			player->RemoveItem "light_de_lantern_07" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_de_lantern_07" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "light_de_lantern_07_warm" )		set original to player->GetItemCount "light_de_lantern_07_warm"		set number to original		while ( number > 0 )			player->RemoveItem "light_de_lantern_07_warm" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_de_lantern_07_warm" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "light_de_lantern_10" )		set original to player->GetItemCount "light_de_lantern_10"		set number to original		while ( number > 0 )			player->RemoveItem "light_de_lantern_10" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_de_lantern_10" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "light_de_lantern_14" )		set original to player->GetItemCount "light_de_lantern_14"		set number to original		while ( number > 0 )			player->RemoveItem "light_de_lantern_14" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_de_lantern_14" 1				set number to ( number + 1 )			endwhile		endif	endifELSEIF ( TYPE == 2 )	if ( player->HasItemEquipped "torch" )		set original to player->GetItemCount "torch"		set number to original		while ( number > 0 )			player->RemoveItem "torch" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "torch" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "torch_256" )		set original to player->GetItemCount "torch_256"		set number to original		while ( number > 0 )			player->RemoveItem "torch_256" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "torch_256" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "torch_infinite_time" )		set original to player->GetItemCount "torch_infinite_time"		set number to original		while ( number > 0 )			player->RemoveItem "torch_infinite_time" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "torch_infinite_time" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "light_com_torch_01" )		set original to player->GetItemCount "light_com_torch_01"		set number to original		while ( number > 0 )			player->RemoveItem "light_com_torch_01" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_com_torch_01" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "light_com_torch_01_256" )		set original to player->GetItemCount "light_com_torch_01_256"		set number to original		while ( number > 0 )			player->RemoveItem "light_com_torch_01_256" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_com_torch_01_256" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "light_com_torch_01_off" )		set original to player->GetItemCount "light_com_torch_01_off"		set number to original		while ( number > 0 )			player->RemoveItem "light_com_torch_01_off" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_com_torch_01_off" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "light_com_torch_02" )		set original to player->GetItemCount "light_com_torch_02"		set number to original		while ( number > 0 )			player->RemoveItem "light_com_torch_02" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_com_torch_02" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "light_com_lantern_01_128" )		set original to player->GetItemCount "light_com_lantern_01_128"		set number to original		while ( number > 0 )			player->RemoveItem "light_com_lantern_01_128" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_com_lantern_01_128" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "light_com_lantern_01_Off" )		set original to player->GetItemCount "light_com_lantern_01_Off"		set number to original		while ( number > 0 )			player->RemoveItem "light_com_lantern_01_Off" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_com_lantern_01_Off" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "light_com_lantern_02_128" )		set original to player->GetItemCount "light_com_lantern_02_128"		set number to original		while ( number > 0 )			player->RemoveItem "light_com_lantern_02_128" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_com_lantern_02_128" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "light_com_lantern_02_128_Off" )		set original to player->GetItemCount "light_com_lantern_02_128_Off"		set number to original		while ( number > 0 )			player->RemoveItem "light_com_lantern_02_128_Off" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_com_lantern_02_128_Off" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "light_com_lantern_02_177" )		set original to player->GetItemCount "light_com_lantern_02_177"		set number to original		while ( number > 0 )			player->RemoveItem "light_com_lantern_02_177" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_com_lantern_02_177" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "light_com_lantern_02_Off" )		set original to player->GetItemCount "light_com_lantern_02_Off"		set number to original		while ( number > 0 )			player->RemoveItem "light_com_lantern_02_Off" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_com_lantern_02_Off" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "light_de_lantern_02" )		set original to player->GetItemCount "light_de_lantern_02"		set number to original		while ( number > 0 )			player->RemoveItem "light_de_lantern_02" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_de_lantern_02" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "light_de_lantern_06_256" )		set original to player->GetItemCount "light_de_lantern_06_256"		set number to original		while ( number > 0 )			player->RemoveItem "light_de_lantern_06_256" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_de_lantern_06_256" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "Light_De_Lantern_06A" )		set original to player->GetItemCount "Light_De_Lantern_06A"		set number to original		while ( number > 0 )			player->RemoveItem "Light_De_Lantern_06A" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "Light_De_Lantern_06A" 1				set number to ( number + 1 )			endwhile		endif	endifELSEIF ( TYPE == 3 )	if ( player->HasItemEquipped "light_com_lantern_01" )		set original to player->GetItemCount "light_com_lantern_01"		set number to original		while ( number > 0 )			player->RemoveItem "light_com_lantern_01" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_com_lantern_01" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "light_com_lantern_02" )		set original to player->GetItemCount "light_com_lantern_02"		set number to original		while ( number > 0 )			player->RemoveItem "light_com_lantern_02" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_com_lantern_02" 1				set number to ( number + 1 )			endwhile		endif	elseif ( player->HasItemEquipped "light_com_lantern_02_INF" )		set original to player->GetItemCount "light_com_lantern_02_INF"		set number to original		while ( number > 0 )			player->RemoveItem "light_com_lantern_02_INF" 1			set number to ( number - 1 )		endwhile		if ( original > 1 )			set original to ( original - 1 )			while ( number < original )				player->AddItem "light_com_lantern_02_INF" 1				set number to ( number + 1 )			endwhile		endif	endifENDIFStopScript _lanterns_removeEnd
[EDIT2]wrong paste
User avatar
matt oneil
 
Posts: 3383
Joined: Tue Oct 09, 2007 12:54 am

Post » Tue May 18, 2010 7:42 pm

If you get a problem along the lines 'Right Eval' or 'Left Eval' it means the game is having trouble accessing a variable. This down to one of two reasons:

1- you've used the dreaded 34th variable. Always set the 34th variable to 'DoNotUse' or something as it is broken
2- you've used a variable that you've forgotten to declare. Forgetting to add 'short DoOnce' is a constant source of me kicking myself.

I don't know if this 'eval' problem has already been solved because I kind of got lost in the massive piles of scripts. Could you not put them in 'spoiler' boxes?
User avatar
Svenja Hedrich
 
Posts: 3496
Joined: Mon Apr 23, 2007 3:18 pm

Post » Tue May 18, 2010 8:58 pm

If you get a problem along the lines 'Right Eval' or 'Left Eval' it means the game is having trouble accessing a variable. This down to one of two reasons:

1- you've used the dreaded 34th variable. Always set the 34th variable to 'DoNotUse' or something as it is broken
2- you've used a variable that you've forgotten to declare. Forgetting to add 'short DoOnce' is a constant source of me kicking myself.
I doubt the cause can be any of these, I tried compiling the mod with MWEdit strong syntax checking and none of them were signaled.
I don't know if this 'eval' problem has already been solved because I kind of got lost in the massive piles of scripts. Could you not put them in 'spoiler' boxes?
Yes but... it is called code tag for a reason! I assume when discussing about inner details of whole scripts you may be willing to read them, having to click a extra button or not, the amount of text your browser is downloading is the same :)

[EDIT]I changed the whole mod scripts to be MWEdit strict syntax checking compatible. Dunno if this can help , anyway for anybody interested:
http://abot.silgrad.com/guppy/file/TLMCompletefix_Scripts.zip
http://abot.silgrad.com/guppy/file/TLMComplete_Scripts.zip
you can compare before/after using for instance http://winmerge.org/,
to apply the new scripts use http://wryemusings.com/#WryeMash/import scripts, reload the mod in TESCS loading http://planetelderscrolls.gamespy.com/View.php?view=Utilities.Detail&id=74 also, recompile all
[EDIT]fixed url & typo
User avatar
Justin Bywater
 
Posts: 3264
Joined: Tue Sep 11, 2007 10:44 pm

Post » Tue May 18, 2010 3:01 pm

I doubt the cause can be any of these, I tried compiling the mod with MWEdit strong syntax checking and none of them were signaled.Yes but... it is called code tag for a reason! I assume when discussing about inner details of whole scripts you may be willing to read them, having to click a extra button or not, the amount of text your browser is downloading is the same :)

[EDIT]I changed the whole mod scripts to be MWEdit strict syntax checking compatible. Dunno if this can help , anyway for anybody interested:
http://abot.silgrad.com/guppy/file/TLMCompletefix_Scripts.zip
http://abot.silgrad.com/guppy/file/TLMComplete_Scripts.zip
you can compare before/after using for instance http://winmerge.org/,
to apply the new scripts use http://wryemusings.com/#WryeMash/import scripts, reload the mod in TESCS loading http://planetelderscrolls.gamespy.com/View.php?view=Utilities.Detail&id=74 also, recompile all
[EDIT]fixed url & typo


thanks alot abot for all your help! I'll try it out as fast as I get my disc back.
User avatar
Erich Lendermon
 
Posts: 3322
Joined: Sat Nov 03, 2007 4:20 pm


Return to III - Morrowind