Jump to content
  • Announcements

    • AndalayBay

      Orphan Attachments   07/31/2018

      I have been doing some housekeeping lately and I've noticed that I had a lot of orphaned attachments. Attachments get orphaned when the PM or post is deleted without removing the attachment first. Deleting a PM or post does not delete the attachment and the file or image remain on the server. I'd like to ask all members to go through their attachments and delete any attachments you don't need anymore or those that have been orphaned. Where can I get a list of my attachments? Click on your display name in the upper right corner of the forums and pick "My Attachments" from the drop-down list. How can I tell an attachment is orphaned? If the PM has been deleted, you'll see a message like this in your attachment list: Unfortunately there is no message if the post has been deleted, so please check your old posts. We do purge old birthday threads every once in a while. Also some hosted projects have been shut down, so you may have orphaned attachments on one of those locations. Thanks!
Sign in to follow this  
AndalayBay

OBSE Gotcha's

Recommended Posts

Forli has compiled a list of OBSE quirks that could cause you to go bald...

 

The following is his post from the Bethesda forums, reposted with permission:

 

"!" has been added by OBSE and only the compiler override will recognize it.
Add an underscore before the script block name: "Begin <Something>" ==> "Begin _<something>".

Don't know if "!condition" it's faster than "condition == 0", but they are both operations the CPU must execute.
Anyway, if you remove all the "== 1" the performance difference will be barely noticeable even with a heavy script running every frame, but every little bit helps!


WARNING: the compiler override is very useful, but it can be dangerous, if you don't use it properly.
If you do multiple operations in a single line, then use parentheses everywhere, around every command, because (example) even an innocent "GetAV Sneak > 75" will act strange...

COMMON PROBLEM A: You type GetAV x >= y. You expect (GetAV x) >= y. OBSE will do GetAV (x >= y).
COMMON PROBLEM B: You type Call functA x y + Call functB z w. You expect functA(x,y) + functB(z,w). OBSE will do functA (x, y + functB(z,w)).
SOLUTION A: (GetAV x) >= y.
SOLUTION B: (Call functA x y) + (Call functB z w).
EXPLANATION: This happens in ANY line with both math and commands/functions calls, because while the vanilla compiler execute commands then do math, the OBSE compiler do math then execute commands...

COMMON PROBLEM C: Set somevar To (GetAV x) + y doesn't compile. A mysterious "Mismatched brackets" error appear.
COMMON PROBLEM D: If (GetAV x) > y doesn't compile. As above.
SOLUTION C: Let somevar := (GetAV x) + y
SOLUTION D: If Eval (GetAV x) > y
EXPLANATION: Let is better than Set, and Eval is better than nothing. Nobody knows why, but the OBSE compiler forces you to use them often, even if the vanilla compiler works fine without them.

NOTE 1: The problem only happens if there's a command with parameters, or if there's a function (with or without parameters). If (Actor.IsSneaking || Actor.IsRunning) will compile fine
NOTE 2: Set somevar To <BooleanExpression> can be fixed with either Let somevar := ... or Set somevar To Eval ... (ONLY FOR BOOLEAN EXPRESSIONS)

COMMON PROBLEM E: GetAV Sneak gives warning.
SOLUTION E: either GetAV 31 or GetAV "Sneak"

EXPLANATION: the OBSE compiler doesn't like tokens used to identify actor values. Put them inside a string or use their AV code to gain the compiler trust.

 

If you follow these rules, then OBSE will simplify your code.

shadeMe should stick this "OBSE compiler problems guide" on the main post...


 

Thanks to Forli for these tips!

Share this post


Link to post
Share on other sites

"!" has been added by OBSE and only the compiler override will recognize it.

Add an underscore before the script block name: "Begin <Something>" ==> "Begin _<something>".

 

Don't know if "!condition" it's faster than "condition == 0", but they are both operations the CPU must execute.

Anyway, if you remove all the "== 1" the performance difference will be barely noticeable even with a heavy script running every frame, but every little bit helps!

 

 

Could you repeat these parts in stupid please, for those of us who have no idea what it's about?

Share this post


Link to post
Share on other sites

:rofl: That part is from a previous conversation. He kind of explains it in the second sentence, so I didn't expand on it.

 

With OBSE, you can do:

 

if !(condition)

 

but you need to use the compiler override to use it. To invoke the compiler override, put an underscore in front of the block name.

 

Forli isn't sure if !(condition) is faster than if (condition == 0). He is saying that it is faster to use if (condition) than if (condition == 1).

Share this post


Link to post
Share on other sites

Script speed in Oblivion has never been an issue unless you do something REALLY stupid. You'd never even be able to detect the difference in speed between !(condition) and if( condition == 0 ).

 

You're talking about a difference that's literally nanoseconds.

Share this post


Link to post
Share on other sites

Yes, for 99% of us, this kind of optimization isn't necessary. saebel is trying to optimize his scripts for SDR as much as possible and apparently he has a large number of "if (condition == 1)" tests, so he's going to try the shorter form.

Share this post


Link to post
Share on other sites

I thought Sabel was using a DLL these days because his scripts were so big?

Share this post


Link to post
Share on other sites

You can never have too many scripts. Unless the game crashes from overload of course. Then you probably have too many scripts. But otherwise, you can never have too many scripts.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×