Editing Useful Scripts

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 362: Line 362:
         Set Msg_FnSum to 0
         Set Msg_FnSum to 0
         Set Msg_FnSum_Done to 1
         Set Msg_FnSum_Done to 1
      ; Uncomment the next two lines and comment out the ElseIf, if you want to
      ; allow multiple "functions" to execute per tick. This is not advised if
      ; you reuse param and return values as shown in this example.
      ;EndIf
      ;If Msg_FnProdut != 0
       ElseIf Msg_FnProduct != 0
       ElseIf Msg_FnProduct != 0
         Set ReturnValue to Param1 * Param2
         Set ReturnValue to Param1 * Param2
Line 381: Line 388:
       If SomeCondition == 1
       If SomeCondition == 1
         ; Let's call function Sum
         ; Let's call function Sum
         Set Example.Param1 to 2         ; Set parameter 1
         Set Example.Param1 to 2
         Set Example.Param2 to 5         ; Set parameter 2
         Set Example.Param2 to 5
         Set Example.Msg_FnSum to 1     ; Call Msg_FnSum on next tick
         Set Example.Msg_FnSum to 1
        Set SomeCondition to 3
       ElseIf SomeCondition == 2
       ElseIf SomeCondition == 2
         ; Let's call function Product
         ; Let's call function Product
         Set Example.Param1 to 2         ; Set parameter 1
         Set Example.Param1 to 2
         Set Example.Param2 to 5         ; Set parameter 2
         Set Example.Param2 to 5
         Set Example.Msg_FnProduct to 1 ; Call Msg_FnProduct on next tick
         Set Example.Msg_FnProduct to 1
        Set SomeCondition to 4
       EndIf
       EndIf


Line 394: Line 403:
       If Example.Msg_FnSum_Done == 1
       If Example.Msg_FnSum_Done == 1
         ; Do something with the value
         ; Do something with the value
         ; The value of Example.ReturnValue is now 7
         PrintC "Sum is %.0f" Example.ReturnValue ; Requires NVSE
 
         Set Example.ReturnValue to 0
         Set Example.ReturnValue to 0   ; Clean up return value (be nice)
         Set Example.Msg_FnSum_Done to 0
         Set Example.Msg_FnSum_Done to 0 ; Prevent this code block from executing next tick
       ElseIf Example.Msg_FnProduct_Done == 1
       ElseIf Example.Msg_FnProduct_Done == 1
         ; Do something with the value
         ; Do something with the value
         ; The value of Example.ReturnValue is now 10
         PrintC "Product is %.0f" Example.ReturnValue ; Requires NVSE
 
         Set Example.ReturnValue to 0
         Set Example.ReturnValue to 0       ; Clean up return value (be nice)
         Set Example.Msg_FnProduct_Done to 0
         Set Example.Msg_FnProduct_Done to 0 ; Prevent this code block from executing next tick
       EndIf
       EndIf
     End
     End
Line 479: Line 486:
End
End
</pre>
</pre>
Note: Your attached <b>Quest</b> should have a small <b>script Processing delay</b>, otherwise the key event may not work.


== Iterating through multiple lists ==
== Iterating through multiple lists ==

Please note that all contributions to the Fallout3 GECK Wiki are considered to be released under the Creative Commons Attribution-ShareAlike (see GECK:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)