Bad expression error

Post » Sat Jul 23, 2011 12:03 pm

I'm getting a bad expression error in this script. Any ideas as to what's causing it? Thanks.

begin jac_mortelevelshort morte_lvlshort teethcountshort silverteethcountfloat morte_shortbladefloat morte_destructionfloat morte_restfloat morte_unarmored   float morte_handtohandfloat morte_strfloat morte_intfloat morte_wilfloat morte_agifloat morte_endfloat morte_perfloat morte_lucfloat morte_healthfloat morte_magickafloat morte_fatigueif ( GetHealth <= 0 )   ;check for untargeted script, avoids crashes   StopScript jac_mortelevel   returnendifset silverteethcount to ( jac_morte->GetItemCount "jac_silverteeth" )if ( silverteethcount >=1 )	jac_morte->RemoveItem "jac_silverteeth" 1	jac_morte->Additem "jac_silverteeth" 1	set teethcount to ( jac_morte->GetItemCount "jac_morteteeth" )		if ( teethcount >= 1 )				jac_morte->RemoveItem "jac_morteteeth" 1		endifelse	set teethcount to ( jac_morte->GetItemCount "jac_morteteeth" )		if ( teethcount >= 1 )			jac_morte->RemoveItem "jac_morteteeth" 1			jac_morte->Additem "jac_morteteeth" 1		endifendifset morte_lvl to ( player->GetLevel )if ( morte_lvl < 16 )   set morte_agi to ( 2.4 * morte_lvl + 30 )else   set morte_agi to 100endif;if ( morte_lvl < 34 );   set morte_destruction to ( 1 * morte_lvl + 30 );else;  set morte_destruction to 100;endifif ( morte_lvl < 35 )   set morte_str to ( 2.6 * morte_lvl + 60 )   set morte_wil to ( 1.1 * morte_lvl + 40 )   set morte_end to ( 1.6957 * morte_lvl + 60 )   set morte_health to ( 8.1333 * morte_lvl + 60 )elseif ( morte_lvl < 45 )   set morte_str to 100   set morte_wil to ( 1.1 * morte_lvl + 40 )   set morte_end to ( 1.6957 * morte_lvl + 60 )   set morte_health to ( 6.875 * ( morte_lvl - 34 ) + 217 )else   set morte_str to 100   set morte_wil to 100   set morte_end to 100   set morte_health to ( 6.0213 * ( morte_lvl - 44 ) + 237 )endifif ( morte_lvl < 44 )   set morte_shortblade to ( 1.5 * morte_lvl + 40 )else   set morte_shortblade to 100endifif ( morte_lvl < 71 )   set morte_rest to ( morte_lvl + 15 )else   set morte_rest to 100endifif ( morte_lvl < 81 )   set morte_handtohand to ( morte_lvl + 15 )else   set morte_handtohand to 100endifif ( morte_lvl < 86 )   set morte_unarmored to ( morte_lvl + 15 )   set morte_luc to ( 0.7 * morte_lvl + 40 )else   set morte_unarmored to 100   set morte_luc to 100endifif ( morte_lvl < 88 )   set morte_int to ( 0.8 * morte_lvl + 30 )else   set morte_int to 100endifif ( morte_lvl < 101 )   ;this should always be true, but doesn't hurt to be sure   set morte_per to ( 0.6 * morte_lvl + 40 )else   set morte_per to 100endifset morte_magicka to ( 2 * morte_int )set morte_fatigue to ( morte_str + morte_wil + morte_agi + morte_end )jac_morte->Setshortblade morte_shortblade;jac_morte->Setdestruction 5jac_morte->SetRestoration morte_restjac_morte->Setunarmored morte_unarmoredjac_morte->SetHandtoHand morte_handtohandjac_morte->SetStrength morte_strjac_morte->SetIntelligence morte_intjac_morte->SetWillpower morte_wiljac_morte->SetAgility morte_agijac_morte->SetEndurance morte_endjac_morte->SetPersonality morte_perjac_morte->SetLuck morte_lucjac_morte->SetHealth morte_healthjac_morte->SetMagicka morte_magickajac_morte->SetFatigue morte_fatigueStopScript jac_mortelevelend

User avatar
Michael Korkia
 
Posts: 3498
Joined: Mon Jul 23, 2007 7:58 pm

Post » Sat Jul 23, 2011 3:42 am

Is this in game or when trying to compile?

This is just a shot in the dark, because your syntax looks spot-on, but you have commented out a nest using a declared float that is still active. Comment out the float declaration and recompile.
User avatar
Lakyn Ellery
 
Posts: 3447
Joined: Sat Jan 27, 2007 1:02 pm

Post » Fri Jul 22, 2011 11:10 pm

It's in-game as soon as I load. I'll try that. Thanks.

[edit]: No, it's still returning a Expression Error: BADOBJECTPOINTER in jac_mortelevel when I load the game.
User avatar
Alessandra Botham
 
Posts: 3440
Joined: Mon Nov 13, 2006 6:27 pm

Post » Sat Jul 23, 2011 12:33 am

I think it may be the >=1, try adding the proper spacing.
As this is a targeted global script and you are ensuring it is targeted on first lines, why keep the objectid-> prefix?
Spoiler
begin jac_mortelevelshort morte_lvlshort teethcountshort silverteethcountfloat morte_shortbladefloat morte_destructionfloat morte_restfloat morte_unarmored   float morte_handtohandfloat morte_strfloat morte_intfloat morte_wilfloat morte_agifloat morte_endfloat morte_perfloat morte_lucfloat morte_healthfloat morte_magickafloat morte_fatigueif ( GetHealth <= 0 )   ;check for untargeted script, avoids crashes	StopScript jac_mortelevel	returnendif; if it is targeted, no reason to keep prefix-> /abot; set silverteethcount to ( jac_morte->GetItemCount "jac_silverteeth" )set silverteethcount to ( GetItemCount "jac_silverteeth" )if ( silverteethcount >= 1 )  ; >=1 fixed /abot	RemoveItem "jac_silverteeth" 1	Additem "jac_silverteeth" 1	set teethcount to ( GetItemCount "jac_morteteeth" )	if ( teethcount >= 1 )		RemoveItem "jac_morteteeth" 1	endifelse	set teethcount to ( GetItemCount "jac_morteteeth" )	if ( teethcount >= 1 )		RemoveItem "jac_morteteeth" 1		Additem "jac_morteteeth" 1	endifendifset morte_lvl to ( player->GetLevel )if ( morte_lvl < 16 )	set morte_agi to ( ( 2.4 * morte_lvl ) + 30 )else	set morte_agi to 100endif;if ( morte_lvl < 34 );   set morte_destruction to ( 1 * morte_lvl + 30 );else;  set morte_destruction to 100;endifif ( morte_lvl < 35 )	set morte_str to ( 2.6 * morte_lvl + 60 )	set morte_wil to ( 1.1 * morte_lvl + 40 )	set morte_end to ( 1.6957 * morte_lvl + 60 )	set morte_health to ( 8.1333 * morte_lvl + 60 )elseif ( morte_lvl < 45 )	set morte_str to 100	set morte_wil to ( 1.1 * morte_lvl + 40 )	set morte_end to ( 1.6957 * morte_lvl + 60 )	set morte_health to ( 6.875 * ( morte_lvl - 34 ) + 217 )else	set morte_str to 100	set morte_wil to 100	set morte_end to 100	set morte_health to ( 6.0213 * ( morte_lvl - 44 ) + 237 )endifif ( morte_lvl < 44 )	set morte_shortblade to ( 1.5 * morte_lvl + 40 )else	set morte_shortblade to 100endifif ( morte_lvl < 71 )	set morte_rest to ( morte_lvl + 15 )else	set morte_rest to 100endifif ( morte_lvl < 81 )	set morte_handtohand to ( morte_lvl + 15 )else	set morte_handtohand to 100endifif ( morte_lvl < 86 )	set morte_unarmored to ( morte_lvl + 15 )	set morte_luc to ( 0.7 * morte_lvl + 40 )else	set morte_unarmored to 100	set morte_luc to 100endifif ( morte_lvl < 88 )	set morte_int to ( 0.8 * morte_lvl + 30 )else	set morte_int to 100endifif ( morte_lvl < 101 )   ;this should always be true, but does not hurt to be sure	set morte_per to ( 0.6 * morte_lvl + 40 )else	set morte_per to 100endifset morte_magicka to ( 2 * morte_int )set morte_fatigue to ( morte_str + morte_wil + morte_agi + morte_end )Setshortblade morte_shortblade;Setdestruction 5SetRestoration morte_restSetunarmored morte_unarmoredSetHandtoHand morte_handtohandSetStrength morte_strSetIntelligence morte_intSetWillpower morte_wilSetAgility morte_agiSetEndurance morte_endSetPersonality morte_perSetLuck morte_lucSetHealth morte_healthSetMagicka morte_magickaSetFatigue morte_fatigueStopScript jac_mortelevelend
[EDIT]P.S: any ETA? I'm a big Torment fan eagerly awaiting :hubbahubba:
[EDIT2] forum syntax highlighter does not like '
User avatar
Emilie Joseph
 
Posts: 3387
Joined: Thu Mar 15, 2007 6:28 am


Return to III - Morrowind