MWEdit Script Revisions

Type: 

Bug

Severity: 

Minor

Game version: 

Morrowind

Concerns: 

TR_Preview

Found in Version: 

Status: 

Description: 

I don't think that any of these script warnings/errors actually target game-breaking bugs, but fixing them might help making debugging scripts via MWEdit simpler.

Proposed revisions include the line number (or the script ID itself) and the suggested fix:
- Replacing hyphens with underscores in script IDs (doesn't the vanilla CS sometimes complain about this, too?)
- Adding correct spacing within parentheses
- Fixing conditional checks outside of parentheses (only in TR_m3_OE_removeBowlScript)
- Changing PlaySound to PlaySoundVP and vice versa, where appropriate

TR_act_m3-770_gatecrank_script:

 

ScriptID: "TR_act_m3-770_gatecrank_script" to "TR_act_m3_770_gatecrank_script"
Line 15: if ( activated == 0 )

TR_act_m3-770_lant_script:

 

ScriptID: "TR_act_m3-770_lant_script" to "TR_act_m3_770_lant_script"
L34: elseif ( timer < ( swingTime * 3 ) )
L39: elseif ( timer < ( swingTime * 4 ) )

TR_act_pull_rope2_script:

 

L11: if ( OnActivate == 1 )
L14: PlaySoundVP "BowPull" 0.5 1.0

TR_act_pull_rope_script:

 

L11: if ( OnActivate == 1 )
L14: if ( OnActivate == 1 )

TR_i3-280_CursedDiamondSummon:

 

ScriptID: "i3-280" to "i3_280"

TR_i4-385-HlaSummon through TR_i4-385Gate2:

 

ScriptID: Replace "-" with "_"

TR_m3-239_rugs:

 

ScriptID: "TR_m3-239_rugs" to "TR_m3_239_rugs"

TR_m3-239_tapestry:

 

ScriptID: "TR_m3-239_tapestry" to "TR_m3_239_tapestry"

TR_m3-649_AkatoshScript through TR_m3-649_ZenitharScript:

 

ScriptID: "m3-649" to "m3_649"

TR_m4-519_doorscript1 through TR_m4-519_doorscript3:

 

ScriptID: "m3-519" to "m3_519"

TR_m3-725_RotZ_Object_60:

 

ScriptID: "TR_m3-725_RotZ_Object_60" to "TR_m3_725_RotZ_Object_60"
L42: if ( OnPCDrop == 1 )
L47: if ( timer_limit == 0.0 )
L72: if ( timer_limit < 0.01 )
L74: elseif ( timer_limit > 0.3 )
L97: elseif ( ma == 0.0 )
L181: set mvx to mvx + ( t1 * t1 * t1 * t1 * t1 / 120.0 )
L184: if ( mvx > 1.0 )
L186: elseif ( mvx < -1.0 )
L195: set t1 to ( ma - 360 ) * -0.0174533
L197: set mvy to mvy + ( t1 * t1 * t1 * t1 * t1 / 120.0 )
L201: elseif ( mvy < -1.0 )
L211: elseif ( tasks == 1 )
L212: if ( GetDistance Player < dis_limit )
L214: set pvx to ( ( "Player"->getPos X ) - mx )
L215: set pvy to ( ( "Player"->getPos Y ) - my )
L217: set t1 to ( pvx * pvx + pvy * pvy )
L237: if ( t1 > 0.0 )
L249: if ( t1 < ( -1.0 * rot_limit ) )
L263: if ( t1 > 0.0 )
L271: if ( t1 < ( -1.0 * rot_limit ) )

TR_m3_OE_removeBowlScript:

 

L9: if ( GetItemCount, "misc_com_redware_bowl" > 0 )
L20: if ( bowlsLeft == 0 )
L22: elseif ( GetItemCount, "misc_com_redware_bowl_01" > 0 )
L33: if ( bowlsLeft == 0 )
L35: elseif ( GetItemCount, "misc_com_wood_bowl_01" > 0 )
L46: if ( bowlsLeft == 0 )
L48: elseif ( GetItemCount, "misc_com_wood_bowl_02" > 0 )
L59: if ( bowlsLeft == 0 )
L61: elseif ( GetItemCount, "misc_com_wood_bowl_03" > 0 )
L72: if ( bowlsLeft == 0 )
L74: elseif ( GetItemCount, "misc_com_wood_bowl_04" > 0 )
L85: if ( bowlsLeft == 0 )
L87: elseif ( GetItemCount, "misc_com_wood_bowl_05" > 0 )
L98: if ( bowlsLeft == 0 )
L100: elseif ( GetItemCount, "misc_de_bowl_01" > 0 )
L111: if ( bowlsLeft == 0 )
L113: elseif ( GetItemCount, "misc_de_bowl_white_01" > 0 )

TR_m4_act_OE_LegBut_SCP:

 

L15: if ( OnActivate == 1 )

TR_m4_act_OE_LegDngHdoor_SCP:

 

L14: if ( OnActivate == 1 )

TR_m4_act_OE_LegHQButton_SCP:

 

:

L15: if ( OnActivate == 1 )

TR_m4_act_OE_LegHQHDoor_SCP:

 

L10: if ( OnActivate == 1 )

TR_m4_act_OE_LegHQPaint_SCP:

 

L14: if ( OnActivate == 1 )

TR_m4_act_OE_LegSmithCn_SCP:

 

L12: if ( OnActivate == 1 )

TR_m4_immetarca_boots_script:

 

L33: set randomness to ( ( player->GetLuck ) + Random100 ) / 5

TR_m4_menaan_9_wlight_e:

 

L21: elseif ( GameHour < 8 )

TR_m4_menaan_9_wlight_w:

 

L20: elseif ( GameHour < 8 )

TR_m4_menaan_int_8_script:

 

L11: if ( OnActivate == 1 )
L14: PlaySoundVP "BowPull" 0.5 1.0

TR_m4_NPC_awfully-swift:

 

ScriptID: "TR_m4_NPC_awfully-swift" to "TR_m4_NPC_awfully_swift"

TR_m4_NPC_V_Ilvaalmu_script:

 

L54: set zpos to ( zpos + 20 )
L56: PlaySound "hearthit2"

TR_m4_Pub_Bodrem:

 

L23: if ( rent == 1 )

TR_m4_vys-assanud_shrine_script:

 

ScriptID: "TR_m4_vys-assanud_shrine_script" to "TR_m4_vys_assanud_shrine_script"

TR_Rent_AlmasThirr_FallenMoon,
TR_Rent_AlmasThirr_HoC,
TR_Rent_AlmasThirr_LimpingScrib,
TR_Rent_AlmasThirr_TippedPitcher,
TR_Rent_AlmasThirr_TP,
TR_Rent_Dondril_Under_Nest_Inn,
TR_Rent_RoaDyr_TandT,
TR_Rent_RoaDyr_NS:

 

L23: if ( rent == 1 )

TR_Rent_AlmasThirr_TP:

 

- Appears to be redundant with TR_Rent_AlmasThirr_TippedPitcher which doesn't appear to be assigned to an NPC/in use
- MWEdit complains that the ScriptID is the same as the global variable used for this script

TR_Rent_RoaDyr_NS:

 

- MWEdit complains that the ScriptID is the same as the global variable used for this bed script

Comments

I agree that veryfing scripts

abot's picture

I agree that veryfing scripts syntax to be MWEdit/OpenMW compatible when possible (e.g. barring object.variable or other legit syntax problems with MWEdit) would really be something useful.

regarding door scripts, why not remove unneeded variables also? original Bethesda scripts are not to be considered a model of perfection, some of them are not optimized due to release time constrains, or evolved engine with Tribunal/Bloodmoon release,  or simply not being made by programmers knowing scripting quirks.

e.g. 2 variables should be enough

 [EDIT]sorry can't find a way to properly format the script with this editor

https://pastebin.com/CuKi45RH

(revised as it is related to TR_act_m3-770_gatecrank_script)