Difference between revisions of "Debug Scripts"

490 bytes added ,  14:46, 14 November 2006
no edit summary
imported>AdiBeiElderScrolls
imported>AdiBeiElderScrolls
Line 92: Line 92:
PickIdle My name is Bob</pre>
PickIdle My name is Bob</pre>


:Yep, in fact, thats what's also true. But the GetCurrentAIPackage worked this time like a return function ... so it didn't execute any code above the first occurrence of GetCurrentAIPackage due to the use of no (valid) parameters ... just try (the package has to be associated also to the NPC - at least that was my situation)
:Yep, in fact, thats what's also true. But the GetCurrentAIPackage worked this time like a return function ... so it didn't execute any code above the first occurrence of GetCurrentAIPackage due to the use of not using it correctly in a compare statement ... but using a valid package name ... just try (the package doesn't need to be related to the NPC)


<pre>GetCurrentAIPackage "AnyParameterNotValid-ButMaybeValidPackageName?"
<pre>GetCurrentAIPackage "ValidPackageName"
PickIdle My name is Bob</pre>
PickIdle My name is Bob</pre>


:Or  
:Or  


<pre>If ( GetCurrentAIPackage "AnyParameterNotValid-ButMaybeValidPackageName?" )
<pre>If ( GetCurrentAIPackage "ValidPackageName" )
   PickIdle My name is Bob
   PickIdle My name is Bob
EndIf</pre>
:I used the following test sequence with an NPC not related to the used package to verify the problem. It turned out, that script could not be saved, if no valid package name was given. Also, it happened, that the script afterwards didn't seem to execute anymore. FramesRun stayed at value 1, even if talking to the NPC (activating)
<pre>short FramesRun
Begin GameMode
Set FramesRun To FramesRun+1
Message "Test before GetCurrentAIPackage"
If ( GetCurrentAIPackage aaaCreatureExterior1500 )
  Message "Test aaaCreatureExterior1500 package name"
EndIf
EndIf
; at least I used valid package names and didn't test it
; against invalid parameters</pre>


:So you see, some functions (especially that one's that can also work like a return function) have unwanted behavior, not foreseen and others don't!
Message "Still alive"
 
... other code
End</pre>
 
:So you see, some functions (especially that one's that can also work like a return function) may have unwanted behavior, not foreseen and others don't!


:Details about configuration: Using localized german version, with Update German V1.1, Plugin Oblivion Deutsch 3.0, BTMod 2.20
:Details about configuration: Using localized german version, with Update German V1.1, Plugin Oblivion Deutsch 3.0, BTMod 2.20