Editing Return

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 13: Line 13:


[[Category: Commands]]
[[Category: Commands]]
-------------------------------------------------------
( never used a Wiki before, hope I do this right )
-------------------------------------------------------
I had a glitch in a script, and careful debugging has taught me that RETURN is a little more powerful than first suspected.
The scripts are designed with the BEGIN <event> syntax.
I was considering these independednt functions called seperately.
However if within the same frame execution you have more than one <event> expected to be processed, and use RETURN in the first <event> for any reason. No other <event>s will be processed.
The clear example I discovered, was using RETURN within an OnLoad event. Which ultimately glitched the necessary OnReset event. Because OnLoad and OnReset are processed at the same frame during a cell load the OnLoad event exited the script before the OnReset had a chance to process.
''Begin OnLoad
  If doOnce == 1
    Return
  Endif
  ; Stuff to do once
End
Begin OnReset
  ; Stuff to do every Reset
End''
The "stuff to do every reset" will only process the one time OnLoad processes.
RETURN as clearly stated in the Wiki exits the script, not the OnLoad function.
Just thought I would add this bit of business so others would not make the same mistake I did. I hope it helps.
-Dejunai

Please note that all contributions to the Oblivion ConstructionSet Wiki are considered to be released under the Creative Commons Attribution-ShareAlike (see CSwiki: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)