but is it faster in OpenMW's implemention of morrowind's bytecode
example script in script tidy
Code: Select all
Begin barAssScript
Float timer
Short creepstate
Short DtncCk
Short doorcheck
Short door2check
Short doOnce
Short dayCheck
If ( MenuMode == 1 )
Return
EndIf
If ( doOnce == 1 )
If ( GetJournalIndex "TR_Assassins" >= 100 )
light_bar1_OUT_unique->Disable
light_bar2_OUT_unique->Disable
light_bar3_OUT_unique->Disable
light_bar4_OUT_unique->Disable
light_bar5_OUT_unique->Disable
light_bar6_OUT_unique->Disable
light_bar7_OUT_unique->Disable
light_bar8_OUT_unique->Disable
light_bar1_unique->Enable
light_bar2_unique->Enable
light_bar3_unique->Enable
light_bar4_unique->Enable
light_bar5_unique->Enable
light_bar6_unique->Enable
light_bar7_unique->Enable
light_bar8_unique->Enable
Set doOnce To 2
EndIf
EndIf
If ( creepstate == 0 )
If ( doOnce == 0 )
light_bar1_OUT_unique->Disable
light_bar2_OUT_unique->Disable
light_bar3_OUT_unique->Disable
light_bar4_OUT_unique->Disable
light_bar5_OUT_unique->Disable
light_bar6_OUT_unique->Disable
light_bar7_OUT_unique->Disable
light_bar8_OUT_unique->Disable
Set doOnce To 1
EndIf
EndIf
If ( GetJournalIndex "TR_Assassins" < 80 )
Return
EndIf
If ( GetJournalIndex "TR_Assassins" >= 100 )
Return
EndIf
If ( DtncCk == 0 )
If ( GetDistance Player > 192 )
Return
EndIf
EndIf
If ( doorcheck == 1 )
If ( GetJournalIndex "TR_Assassins" < 85 )
Return
EndIf
EndIf
If ( door2check == 1 )
If ( GetJournalIndex "TR_Assassins" < 85 )
Return
EndIf
EndIf
If ( dayCheck == 0 )
If ( DaysPassed > "helsethScript".FightDay )
Set dayCheck To 1
EndIf
EndIf
If ( creepstate >= 1 )
If ( GetDistance Player >= 400 )
hels_assassin1->ClearForceSneak
hels_assassin2->ClearForceSneak
hels_assassin3->ClearForceSneak
hels_assassin1->ClearForceSneak
hels_assassin1->StartCombat Player
hels_assassin2->StartCombat Player
hels_assassin3->StartCombat Player
hels_assassin1->StartCombat Player
Set creepstate To 17
EndIf
EndIf
If ( dayCheck == 0 )
Return
EndIf
If ( creepstate == 0 )
If ( GameHour < 20 )
If ( GameHour > 4 )
Return
EndIf
EndIf
Set DtncCk To 1
Set creepstate To 1
Journal "TR_Assassins" 85
ElseIf ( creepstate == 1 )
hels_assassin1->ForceSneak
hels_assassin2->ForceSneak
hels_assassin3->ForceSneak
hels_assassin1->AiTravel 738 -228 -128
Set creepstate To 2
ElseIf ( creepstate == 2 )
If ( hels_assassin1->GetAiPackageDone == 1 )
PlaySound3D "Torch Out"
light_bar1_unique->Disable
light_bar2_unique->Disable
light_bar3_unique->Disable
light_bar4_unique->Disable
light_bar5_unique->Disable
light_bar6_unique->Disable
light_bar7_unique->Disable
light_bar8_unique->Disable
light_bar1_OUT_unique->Enable
light_bar2_OUT_unique->Enable
light_bar3_OUT_unique->Enable
light_bar4_OUT_unique->Enable
light_bar5_OUT_unique->Enable
light_bar6_OUT_unique->Enable
light_bar7_OUT_unique->Enable
light_bar8_OUT_unique->Enable
Set creepstate To 3
EndIf
ElseIf ( creepstate == 3 )
Set timer To ( timer + GetSecondsPassed )
If ( timer > 5 )
hels_assassin1->Say "Vo\Misc\helsass1.wav" "...supposed to be here somewhere..."
hels_assassin1->AiTravel 516 -100 -128
Set timer To 0
Set creepstate To 4
EndIf
ElseIf ( creepstate == 4 )
If ( hels_assassin1->GetAiPackageDone == 1 )
Set creepstate To 5
EndIf
ElseIf ( creepstate == 5 )
Set timer To ( timer + GetSecondsPassed )
If ( timer > 5 )
hels_assassin1->Say "Vo\Misc\helsass2.wav" "...he told us in the Queen Mother's chambers..."
hels_assassin1->AiTravel 816 -2 -128
Set timer To 0
Set creepstate To 6
EndIf
ElseIf ( creepstate == 6 )
If ( hels_assassin1->GetAiPackageDone == 1 )
Set creepstate To 7
EndIf
ElseIf ( creepstate == 7 )
hels_assassin1->Say "Vo\Misc\helsass3.wav" "...behind the screen..."
hels_assassin1->AiTravel 786 128 -128
Set creepstate To 8
ElseIf ( creepstate == 8 )
If ( hels_assassin1->GetAiPackageDone == 1 )
Set creepstate To 9
EndIf
ElseIf ( creepstate == 9 )
hels_assassin1->AiTravel 748 292 -128
Set creepstate To 10
ElseIf ( creepstate == 10 )
If ( hels_assassin1->GetAiPackageDone == 1 )
Set creepstate To 11
EndIf
ElseIf ( creepstate == 11 )
hels_assassin1->AiTravel 553 282 -128
Set creepstate To 12
ElseIf ( creepstate == 12 )
If ( hels_assassin1->GetAiPackageDone == 1 )
Set creepstate To 13
EndIf
ElseIf ( creepstate == 13 )
hels_assassin1->AiTravel 371 268 -128
Set creepstate To 14
ElseIf ( creepstate == 14 )
If ( hels_assassin1->GetAiPackageDone == 1 )
Set creepstate To 15
EndIf
ElseIf ( creepstate == 15 )
hels_assassin1->AiTravel 243 164 -128
Set creepstate To 16
ElseIf ( creepstate == 16 )
hels_assassin1->ClearForceSneak
hels_assassin2->ClearForceSneak
hels_assassin3->ClearForceSneak
hels_assassin1->StartCombat Player
hels_assassin2->StartCombat Player
hels_assassin3->StartCombat Player
Set creepstate To 17
EndIf
End
Code: Select all
Begin barAssScript
;this script is on the active_assassin_unique activator in Bs chambers. will need lots o' tweaking. - Mark
float timer
short creepstate
short distancecheck
short doorcheck
short door2check
short doOnce
short dayCheck
if ( MenuMode == 1 )
return
endif
if ( doOnce == 1 )
if ( GetJournalIndex TR_Assassins >= 100 )
light_bar1_OUT_unique->Disable
light_bar2_OUT_unique->Disable
light_bar3_OUT_unique->Disable
light_bar4_OUT_unique->Disable
light_bar5_OUT_unique->Disable
light_bar6_OUT_unique->Disable
light_bar7_OUT_unique->Disable
light_bar8_OUT_unique->Disable
light_bar1_unique->Enable
light_bar2_unique->Enable
light_bar3_unique->Enable
light_bar4_unique->Enable
light_bar5_unique->Enable
light_bar6_unique->Enable
light_bar7_unique->Enable
light_bar8_unique->Enable
set doOnce to 2
endif
endif
if ( creepstate == 0 )
if ( doOnce == 0 )
light_bar1_OUT_unique->Disable
light_bar2_OUT_unique->Disable
light_bar3_OUT_unique->Disable
light_bar4_OUT_unique->Disable
light_bar5_OUT_unique->Disable
light_bar6_OUT_unique->Disable
light_bar7_OUT_unique->Disable
light_bar8_OUT_unique->Disable
set doOnce to 1
endif
endif
if ( GetJournalIndex TR_Assassins < 80 )
;MessageBox "RETURNING FOR JOURNAL < 80"
return
endif
if ( GetJournalIndex TR_Assassins >= 100 )
;MessageBox "RETURNING FOR JOURNAL >= 100"
return
endif
if ( distancecheck == 0 )
if ( GetDistance Player > 192 )
;MessageBox "RETURNING FOR DISTANCE > 192"
return
endif
endif
if ( doorcheck == 1 )
if ( GetJournalIndex TR_Assassins < 85 )
;MessageBox "RETURNING FOR DOORCHECK=1 AND JOURNAL < 85"
return
endif
endif
if ( door2check == 1 )
if ( GetJournalIndex TR_Assassins < 85 )
;MessageBox "RETURNING FOR DOORCHECK=1 AND JOURNAL < 85"
return
endif
endif
if ( dayCheck == 0 )
if ( DaysPassed > "King Hlaalu Helseth".FightDay )
set dayCheck to 1
endif
endif
;this part clears sneak and starts combat if player moves from behind screens. avoids silly dialogue from assassins
if ( creepstate >= 1 )
if ( GetDistance Player >= 400 )
hels_assassin1->ClearForceSneak
hels_assassin2->ClearForceSneak
hels_assassin3->ClearForceSneak
hels_assassin1->ClearForceSneak
hels_assassin1->StartCombat Player
hels_assassin2->StartCombat Player
hels_assassin3->StartCombat Player
hels_assassin1->StartCombat Player
set creepstate to 17
endif
endif
if ( dayCheck == 0 )
return
endif
if ( creepstate == 0 )
if ( GameHour < 20 )
if ( GameHour > 4 )
;MessageBox "RETURNING FOR CREEPSTATE=0, GAMEHOUR <20 GAMEHOUR > 4"
return
endif
endif
set distancecheck to 1
set creepstate to 1
;set doorcheck to 0
Journal TR_Assassins 85
elseif ( creepstate == 1 )
hels_assassin1->ForceSneak
hels_assassin2->ForceSneak
hels_assassin3->ForceSneak
hels_assassin1->AiTravel 738 -228 -128
set creepstate to 2
elseif ( creepstate == 2 )
if ( hels_assassin1->GetAiPackageDone == 1 )
PlaySound3D, "Torch Out"
light_bar1_unique->Disable
light_bar2_unique->Disable
light_bar3_unique->Disable
light_bar4_unique->Disable
light_bar5_unique->Disable
light_bar6_unique->Disable
light_bar7_unique->Disable
light_bar8_unique->Disable
light_bar1_OUT_unique->Enable
light_bar2_OUT_unique->Enable
light_bar3_OUT_unique->Enable
light_bar4_OUT_unique->Enable
light_bar5_OUT_unique->Enable
light_bar6_OUT_unique->Enable
light_bar7_OUT_unique->Enable
light_bar8_OUT_unique->Enable
set creepstate to 3
endif
elseif ( creepstate == 3 )
set timer to ( timer + GetSecondsPassed )
if ( timer > 5 )
hels_assassin1->Say "Vo\Misc\helsass1.wav", "...supposed to be here somewhere..."
hels_assassin1->AiTravel 516 -100 -128
set timer to 0
set creepstate to 4
endif
elseif ( creepstate == 4 )
if ( hels_assassin1->GetAiPackageDone == 1 )
set creepstate to 5
endif
elseif ( creepstate == 5 )
set timer to ( timer + GetSecondsPassed )
if ( timer > 5 )
hels_assassin1->Say "Vo\Misc\helsass2.wav", "...he told us in the Queen Mother's chambers..."
hels_assassin1->AiTravel 816 -2 -128
set timer to 0
set creepstate to 6
endif
elseif ( creepstate == 6 )
if ( hels_assassin1->GetAiPackageDone == 1 )
set creepstate to 7
endif
elseif ( creepstate == 7 )
hels_assassin1->Say "Vo\Misc\helsass3.wav", "...behind the screen..."
hels_assassin1->AiTravel 786 128 -128
set creepstate to 8
elseif ( creepstate == 8 )
if ( hels_assassin1->GetAiPackageDone == 1 )
set creepstate to 9
endif
elseif ( creepstate == 9 )
hels_assassin1->AiTravel 748 292 -128
set creepstate to 10
elseif ( creepstate == 10 )
if ( hels_assassin1->GetAiPackageDone == 1 )
set creepstate to 11
endif
elseif ( creepstate == 11 )
hels_assassin1->AiTravel 553 282 -128
set creepstate to 12
elseif ( creepstate == 12 )
if ( hels_assassin1->GetAiPackageDone == 1 )
set creepstate to 13
endif
elseif ( creepstate == 13 )
hels_assassin1->AiTravel 371 268 -128
set creepstate to 14
elseif ( creepstate == 14 )
if ( hels_assassin1->GetAiPackageDone == 1 )
set creepstate to 15
endif
elseif ( creepstate == 15 )
hels_assassin1->AiTravel 243 164 -128
set creepstate to 16
elseif ( creepstate == 16 )
hels_assassin1->ClearForceSneak
hels_assassin2->ClearForceSneak
hels_assassin3->ClearForceSneak
hels_assassin1->StartCombat Player
hels_assassin2->StartCombat Player
hels_assassin3->StartCombat Player
set creepstate to 17
endif
endif
End barAssScript
So anyone familiar with OpenMW script VM is there a advantage to script tidy outside of the actually fixed errors