Difference between revisions of "Useful Scripts"
Jump to navigation
Jump to search
m
→Simulating Global Functions in your Mod
imported>Nyteschayde |
imported>Nyteschayde |
||
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 | ||
ElseIf Msg_FnProduct != 0 | ElseIf Msg_FnProduct != 0 | ||
Set ReturnValue to Param1 * Param2 | Set ReturnValue to Param1 * Param2 | ||
Line 401: | Line 394: | ||
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 | |||
Set Example.ReturnValue to 0 | |||
Set Example.Msg_FnSum_Done to 0 | Set Example.ReturnValue to 0 ; Clean up return value (be nice) | ||
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 | |||
Set Example.ReturnValue to 0 | |||
Set Example.Msg_FnProduct_Done to 0 | Set Example.ReturnValue to 0 ; Clean up return value (be nice) | ||
Set Example.Msg_FnProduct_Done to 0 ; Prevent this code block from executing next tick | |||
EndIf | EndIf | ||
End | End |