Spoiler
SCN MyScript
Ref SelfEA
Ref CriticalHealthEA
Begin GameMode
If ( SelfEA.GetLevel >= 8 )
Set CriticalHealthEA to 5
Elseif ( SelfEA.GetLevel >= 4 )
Set CriticalHealthEA to 4.5
Elseif ( SelfEA.GetLevel >= 1 )
Set CriticalHealthEA to 4
EndIf
End
Ref SelfEA
Ref CriticalHealthEA
Begin GameMode
If ( SelfEA.GetLevel >= 8 )
Set CriticalHealthEA to 5
Elseif ( SelfEA.GetLevel >= 4 )
Set CriticalHealthEA to 4.5
Elseif ( SelfEA.GetLevel >= 1 )
Set CriticalHealthEA to 4
EndIf
End
You can see that, depending on the level of SelfEA a number will be set for CriticalHealthEA. So if SelfEA is at or above level 8 then CriticalHealthEA will be set to 5, but since it is GameMode it will be set to whatever number EVERY frame, hogging resources. Right? Are you laughing at me yet? Pal, we've only just started. My OCD is begging me to change the whole block to the following:
Spoiler
If ( SelfEA.GetLevel >= 40 ) && ( CriticalHealthEA == 0 )
Set CriticalHealthEA to 10
Elseif ( SelfEA.GetLevel >= 36 ) && ( CriticalHealthEA == 0 )
Set CriticalHealthEA to 9
Elseif ( SelfEA.GetLevel >= 32 ) && ( CriticalHealthEA == 0 )
Set CriticalHealthEA to 8
Elseif ( SelfEA.GetLevel >= 28 ) && ( CriticalHealthEA == 0 )
Set CriticalHealthEA to 7.5
Elseif ( SelfEA.GetLevel >= 24 ) && ( CriticalHealthEA == 0 )
Set CriticalHealthEA to 7
Elseif ( SelfEA.GetLevel >= 20 ) && ( CriticalHealthEA == 0 )
Set CriticalHealthEA to 6.5
Elseif ( SelfEA.GetLevel >= 16 ) && ( CriticalHealthEA == 0 )
Set CriticalHealthEA to 6
Elseif ( SelfEA.GetLevel >= 12 ) && ( CriticalHealthEA == 0 )
Set CriticalHealthEA to 5.5
Elseif ( SelfEA.GetLevel >= 8 ) && ( CriticalHealthEA == 0 )
Set CriticalHealthEA to 5
Elseif ( SelfEA.GetLevel >= 4 ) && ( CriticalHealthEA == 0 )
Set CriticalHealthEA to 4.5
Elseif ( SelfEA.GetLevel >= 1 ) && ( CriticalHealthEA == 0 )
Set CriticalHealthEA to 4
EndIf
If ( SelfEA.GetLevel >= 40 ) && ( CriticalHealthEA == 0 )
Set CriticalHealthEA to 10
Elseif ( SelfEA.GetLevel >= 36 ) && ( CriticalHealthEA == 0 )
Set CriticalHealthEA to 9
Elseif ( SelfEA.GetLevel >= 32 ) && ( CriticalHealthEA == 0 )
Set CriticalHealthEA to 8
Elseif ( SelfEA.GetLevel >= 28 ) && ( CriticalHealthEA == 0 )
Set CriticalHealthEA to 7.5
Elseif ( SelfEA.GetLevel >= 24 ) && ( CriticalHealthEA == 0 )
Set CriticalHealthEA to 7
Elseif ( SelfEA.GetLevel >= 20 ) && ( CriticalHealthEA == 0 )
Set CriticalHealthEA to 6.5
Elseif ( SelfEA.GetLevel >= 16 ) && ( CriticalHealthEA == 0 )
Set CriticalHealthEA to 6
Elseif ( SelfEA.GetLevel >= 12 ) && ( CriticalHealthEA == 0 )
Set CriticalHealthEA to 5.5
Elseif ( SelfEA.GetLevel >= 8 ) && ( CriticalHealthEA == 0 )
Set CriticalHealthEA to 5
Elseif ( SelfEA.GetLevel >= 4 ) && ( CriticalHealthEA == 0 )
Set CriticalHealthEA to 4.5
Elseif ( SelfEA.GetLevel >= 1 ) && ( CriticalHealthEA == 0 )
Set CriticalHealthEA to 4
EndIf
There. So the script can now see that, for example, level 8 that CriticalHealthEA is at 0, so that it can then change it to 5. And after the fact, since one of the requirements for that change was for CriticalHealth to start at 0 then it will no longer process that line again and now the computer WON'T catch on fire and explode. Tell me straight, is this an unnecessary step ventured only to address my anxiety and stomp an irrational fear?