[BETA] Oblivion Script Extender (OBSE) 0018

Post » Fri May 27, 2011 4:01 am

Noooo, Mega-Ninja'd by TheNiceOne :ph34r:

Hey guys I love you so much! I'm just discovering oblivion scripting and OBSE and it's plain amazing! ... loops, arrays, strings, user-defined functions ... and so many things that I'm probably missing.

User-functions can even call other user-functions! And they work perfectly! I've used up to 3 calls in a row (script calls function1, function1 calls function2, function2 calls function3) and it's working as expected. Is there a maximum of functions that could be "nested" this way, or would it freeze the frame until all code is run?
The doc says "OBSE allows a maximum of 30 nested function calls. This means the above function will only work with exponents less than 30." but I'm not sure if this only applies to using the same function each time or the total amount of nested function calls (as in, even with 30 different user functions the nested limit is 30).

I wonder how scripters did to bypass the maximum on script lenght and nested blocks allowed by the CS before OBSE v0018 was out... well, I just can't imagine right now scripting without OBSE.
Most common use was activator scripts, they could be excecuted instantly although there was (before v17's Activate2) a nesting limit of 3-4. And ofcourse you couldn't nest the same activator like how user-functions can. Other than that they were a godsend, without it many mods probably would've never existed. :)

I have a minor request for the maths department, though, I'd really like to have min and max functions. Actualy it has an easy workaround, just an if check and it's done, but when one is using them several times in an expression that could save a few lines. Btw I understand it's nothing prioritary and there are more important things to attend, it's just to let you know sometimes I missed them.
Same here, although the anwser will probably be to make a user function to do this. That way you can keep it on one line. :)

I haven't had time to get into strings yet, could someone tell me if: 1) is it possible to use them in dialogues; and 2) can they be compiled and run as code? Thx!

1). Yes, although somewhat indirect. You can http://cs.elderscrolls.com/constwiki/index.php/Topics_Tab inside dialogue responses so in theory you could change such a string gamesetting on-the-fly with SetStringGameSetting. Then ofcourse restore it when you are done for the rare occassions they are used in vanilla dialogue.
2). Also possible but with a few limitations, the idea is to use http://obse.silverlock.org/obse_command_doc.html#RunScriptLine to execute a string, which you've put together on-the-fly, through the console. The obvious limitations are pretty much anything from the normal console (no local variables, no let/call/arrays/other expressions), biggest downside IMO is not being able to use (most) reference function because they don't work in a MyQuest.MyRef syntax. Easiest way to check if what you are trying to do is possible with RunScriptLine is typing it out in the console.

I'm using v0018 beta 4 and there's no error I can report by now. I realised a few days ago that b5 was out, but I'm not sure I should update because I don't know how these things work. I'm currently working in a mod using obse 18b4, so if I update to b5 and find some issue, could I downgrade to b4 and still working on it? Another doubt I have, regarding what is said in the first post about changes in the bytecode that makes that mods made with b2 or higher will require for the user obse b2 or higher. Does it means that if I pack the mod with b4 installed users will need b4 or will only need b2??
Pretty sure if you compiled a script with v18beta2 or higher AND it uses any of the new expressions/arrays the user will also need v18beta2 or higher. Not that anybody should be using a beta version that is NOT the latest beta. With the very rare exception of v18beta5.

-kyoma
User avatar
lauraa
 
Posts: 3362
Joined: Tue Aug 22, 2006 2:20 pm

Post » Fri May 27, 2011 7:37 am

Noooo, Mega-Ninja'd by TheNiceOne :ph34r:
...but then I overlooked the string question :)

The doc says "OBSE allows a maximum of 30 nested function calls. This means the above function will only work with exponents less than 30." but I'm not sure if this only applies to using the same function each time or the total amount of nested function calls (as in, even with 30 different user functions the nested limit is 30).
Normally, the only thing that needs to be added to the stack is the return point (i.e. the point in the calling code that control needs to be returned to when the function ends. And there's nothing more to store if there are 30 different functions.

1). Yes, although somewhat indirect. You can http://cs.elderscrolls.com/constwiki/index.php/Topics_Tab inside dialogue responses so in theory you could change such a string gamesetting on-the-fly with SetStringGameSetting. Then ofcourse restore it when you are done for the rare occassions they are used in vanilla dialogue.
That was a good idea. I have never scripted dialogues except the few house tax dialogues in EE, but now I know how the guards can mention the city's name :)

Pretty sure if you compiled a script with v18beta2 or higher AND it uses any of the new expressions/arrays the user will also need v18beta2 or higher. Not that anybody should be using a beta version that is NOT the latest beta. With the very rare exception of v18beta5.
I looked at the documentation (which I didn't in my previous reply, so forget about that). The deal is that anything compiled with v18b2 or newer needs v18b2 or newer to run, even if no 0018 commands are used. So if you open up a script previously compiled with OBSEb17 and recompile it (with no changes) using 18b2-5, the mod suddenly requires 18b2 or newer. Unlike a script that was compiled with OBSE 17 which could run with OBSE 16 if no newer commands were used.
User avatar
Albert Wesker
 
Posts: 3499
Joined: Fri May 11, 2007 11:17 pm

Post » Fri May 27, 2011 2:00 pm

Normally, the only thing that needs to be added to the stack is the return point (i.e. the point in the calling code that control needs to be returned to when the function ends. And there's nothing more to store if there are 30 different functions.
Ah yes ofcourse.

I looked at the documentation (which I didn't in my previous reply, so forget about that). The deal is that anything compiled with v18b2 or newer needs v18b2 or newer to run, even if no 0018 commands are used. So if you open up a script previously compiled with OBSEb17 and recompile it (with no changes) using 18b2-5, the mod suddenly requires 18b2 or newer. Unlike a script that was compiled with OBSE 17 which could run with OBSE 16 if no newer commands were used.
That's what I thought at first too, but when I asked it didn't seem to be the case. First post would be http://www.gamesas.com/bgsforums/index.php?s=&showtopic=1038356&view=findpost&p=15095281, a couple come after that which further explain my (current) understanding. :)
User avatar
Etta Hargrave
 
Posts: 3452
Joined: Fri Sep 01, 2006 1:27 am

Post » Fri May 27, 2011 2:21 am

Post limit. http://www.gamesas.com/bgsforums/index.php?showtopic=1059220
User avatar
Alessandra Botham
 
Posts: 3440
Joined: Mon Nov 13, 2006 6:27 pm

Previous

Return to IV - Oblivion