[BETA] Oblivion Script Extender (OBSE) v0018

Post » Fri May 27, 2011 1:08 pm

To add to kyoma's sneaky request, he forgot something else that would make his modding easier: SetCurrentWeatherPercent. I'm not even sure it's possible, but it would (theoretically) use the previous weather ID, the current weather ID and the current weather percentage as arguements. I'm going to a be nice and request it for v19. :P
User avatar
Pumpkin
 
Posts: 3440
Joined: Sun Jun 25, 2006 10:23 am

Post » Fri May 27, 2011 9:03 am

I've been away from Oblivion for awhile and missed most of the v0018 development cycle, so maybe this is a dumb question, but does v0018 support using formIDs as keys in map-type arrays? (I suspect the answer is no since it doesn't seem to be mentioned in the documentation, nor any of the v0018 beta threads, but I recall it being discussed as a possible and even probable future feature during the v0017 development cycle, so I thought I'd ask.)

If not in v0018, is it likely to be supported in v0019? (I have an idea for a mod that would benefit greatly from it.)
User avatar
Yung Prince
 
Posts: 3373
Joined: Thu Oct 11, 2007 10:45 pm

Post » Fri May 27, 2011 8:17 am

I've been away from Oblivion for awhile and missed most of the v0018 development cycle, so maybe this is a dumb question, but does v0018 support using formIDs as keys in map-type arrays? (I suspect the answer is no since it doesn't seem to be mentioned in the documentation, nor any of the v0018 beta threads, but I recall it being discussed as a possible and even probable future feature during the v0017 development cycle, so I thought I'd ask.)
The current beta doesn't.

EDIT : LoadGame/NewGame callbacks seem to work with the default opcode range, in contradiction to what's said in the example plugin code. Savegame doesn't however.

Yet another issue with the stringVar API. My command doesn't support the %z format specifier even after registering the interface. Reg. code :
g_stringvar = (OBSEStringVarInterface*)obse->QueryInterface(kInterface_StringVar);		g_stringvar->Register(g_stringvar);
The new command is basically a copy of PrintToConsole.

PS : What's the result pointer used for ?
User avatar
Emma Parkinson
 
Posts: 3401
Joined: Wed Jul 26, 2006 5:53 pm

Post » Fri May 27, 2011 12:24 am

The current beta doesn't.

Oh well; maybe in a future release. Actually, though, I think I can design my code around StringMaps and user-defined functions instead, so maybe I don't need formID keys after all.

Speaking of which, I'm looking into implementing an extensibility system in which a mod loops over all the refs in a certain special cell, calls GetScript on each, and then calls each resulting script as a function. The idea is that other mods can "hook into" this one by adding scripted objects to that cell in order to have the functions called automatically at the appropriate time. (I know the documentation says "function scripts should never be attached to any object", but these are dummy objects whose only purpose is to point to a script, not game-world objects that the player will interact with.) This can also be done by putting plain scripted activators in the special cell and just calling Activate on each, but in this case I want return values so functions are more natural.

I'd like to gracefully handle the error case where one of these objects (supplied by some other mod, out of my control) has a script that isn't a valid function. It looks like attempting to call a non-function script causes the call, and any assignment of the result, to be ignored, but the calling script continues running. That's good, because it means that my code can continue as if the bad script weren't there, but this seems like undefined behavior that I shouldn't be relying on, and I'd like to display a more informative message than the "Begin Function block not found in compiled script data" that the Call command writes to the console when given a script that's not a function.

I realize it's pretty late to ask for a new script command, but would it be possible/practical to have some sort IsFunctionScript command that tells whether a given script is a callable function? (If not, it's no big deal, since my code will still work correctly without it.)
User avatar
Natalie J Webster
 
Posts: 3488
Joined: Tue Jul 25, 2006 1:35 pm

Post » Fri May 27, 2011 6:50 am

"Could not parse function definition."

I've been fighting one of these for a couple of hours. Some info on the scenario:

Error in script 1500ba9bCould not parse function definition.Error in script 1500bd59Could not parse function info for function script 1500ba9b	File: QQuix ------ [wip] Anvil Red Light District.esp Offset: 0x000004C7 Command: Call (0x1883)


Script 1500bd59 has the calling line:"Call zzInitRooms"

Script 1500ba9b has been stripped down to this:
scn zzInitRoomsarray_var arrbegin Function {  } 		let arr := ar_construct stringmap		let arr [zrefDoorPackage] := aaaaqqxxGotoRoom00Doorend


aaaaqqxxGotoRoom00Door is a Travel AI package that is broken because the target ref has been deleted.
Missing a target, it defaulted to "Near editor location"
I changed it to "Near current location location" - no change - same error
I set it to a specific reference and the runtime error vanished!!!
Changed it back to "Near editor location" and, of course, everything is fine. I suppose I somehow fixed the package.

Weird. Even if the AI package was broken, the script is not trying to run it. Just assigning the ref to an array element.

Hope it helps.
User avatar
Auguste Bartholdi
 
Posts: 3521
Joined: Tue Jun 13, 2006 11:20 am

Post » Fri May 27, 2011 12:35 am

Are Function blocks actually implemented as GameMode blocks in the bytecode? I put a persistent object with a function script into a cell (as mentioned in my previous post) and it seems to run once when the game is loaded, even though nothing has called it yet. I get a "SetFunctionValue statement failed" message on the console, presumably because there's no caller to receive the return value.

Maybe I should just use plain scripted activators and pass back the "return" value through a global variable, rather than trying to use them as wrappers for function scripts. :huh:
User avatar
mimi_lys
 
Posts: 3514
Joined: Mon Apr 09, 2007 11:17 am

Post » Thu May 26, 2011 10:11 pm

CalcLeveledItemNR doesn't seem to be working in OBSE expressions:

let rList := LL0Deer100let rCreature := CalcLeveledItemNR rList, 1PrintToConsole "Let: %i", rCreature ; Always prints zeroset rCreature to CalcLeveledItemNR rList, 1PrintToConsole "Set: %i", rCreature ; Works as expected

CalcLeveledItem seems to work OK though.

This works in v0017, so it looks like a new bug in v0018.
User avatar
sarah taylor
 
Posts: 3490
Joined: Thu Nov 16, 2006 3:36 pm

Post » Fri May 27, 2011 5:31 am

Hi, I had a few questions. :)
  • Array FormMaps, now I know it has been mentioned alot before and I won't repeat any arguments. All I'd like to know is if they'll be in v19 or not (aka, what the final verdict on them is).
  • In the past, only the latest version of OBSE is available for download. Since v18 changes the the way a script is compiled it automatically requires v18 or higher. Now for OBSE scripts this shouldn't matter, a user should always be using the latest OBSE. But for non-OBSE mods or dual mods it quickly becomes a problem. Yes, I can just load the cs without OBSE but that is a bit of a hassle when I'm working on two scripts at once, one is OBSE-powered and the other isn't. For dual scripts (where the OBSE code is in the same script as the normal code) this won't work. So the only way around this right is installing v17 again whenever I need to change that particular script. Then change it back to v18 again. So it's probably a good idea to keep v17b up for grabs.
  • To add to #2, is it possible (in theory) to add a flag or switch or whatever it's called to the command line that forces OBSE to use the older bytecode stuff in the cs?
-kyoma
User avatar
ANaIs GRelot
 
Posts: 3401
Joined: Tue Dec 12, 2006 6:19 pm

Post » Fri May 27, 2011 6:38 am

hi obse team!
i try not to request for new functionality (due to the fact that you guys already provide us with plenty) unless i find that i really need to.
this is one of those cases.

would like to request someone to take a quick look at how dialogue options (MenuMode 1009) are updated by the game (e.g. when the persuasion mini game is opened then closed).
and if possible (and if its a "quick fix") make that available to us.
alternative, a way to interrupt (either stop or change) the "greeting" selected by the game would also suffice.

here's my case in the CS forums: http://www.gamesas.com/bgsforums/index.php?showtopic=1040947
succintly:
  • disposition changed at onset of MenuMode 1009.
  • but npc's facial expressions reflect the previous disposition. the dialogue options are updated, however, (with RefreshTopicLis).
  • if any of the MenuMode options (e.g. a dialogue option, the persuasion mini game) are accessed, the npc's facial expressions are then updated with the new disposition.


thanks, guys!
and, again, i appreciate all the things you guys do. :D
cheers!
User avatar
Cassie Boyle
 
Posts: 3468
Joined: Sun Nov 05, 2006 9:33 am

Post » Fri May 27, 2011 10:34 am

Requests have been added to the todo list.

Yet another issue with the stringVar API. My command doesn't support the %z format specifier even after registering the interface. Reg. code :
g_stringvar = (OBSEStringVarInterface*)obse->QueryInterface(kInterface_StringVar);		g_stringvar->Register(g_stringvar);
The new command is basically a copy of PrintToConsole.

PS : What's the result pointer used for ?

result is used to store the command's return value.
*result = someFloatValue; // return a numeric value*((UInt32*)result) = someObject->refID; // return a form

AssignToStringVar() stores a stringID in result for you.

Please PM me with full code for your Cmd_Execute handler, CommandInfo, and ParamInfo.
(I know the documentation says "function scripts should never be attached to any object", but these are dummy objects whose only purpose is to point to a script, not game-world objects that the player will interact with.)

The documentation is serious when it says this, and ...
I put a persistent object with a function script into a cell (as mentioned in my previous post) and it seems to run once when the game is loaded, even though nothing has called it yet. I get a "SetFunctionValue statement failed" message on the console, presumably because there's no caller to receive the return value.

...that is why you get the above error.
Have your clients pass the function scripts directly rather than attaching them to objects. A ref variable containing a script basically *is* a function pointer.
"Could not parse function definition."

I've been fighting one of these for a couple of hours. Some info on the scenario:

Error in script 1500ba9bCould not parse function definition.Error in script 1500bd59Could not parse function info for function script 1500ba9b	File: QQuix ------ [wip] Anvil Red Light District.esp Offset: 0x000004C7 Command: Call (0x1883)


Script 1500bd59 has the calling line:"Call zzInitRooms"

Script 1500ba9b has been stripped down to this:
scn zzInitRoomsarray_var arrbegin Function {  } 		let arr := ar_construct stringmap		let arr [zrefDoorPackage] := aaaaqqxxGotoRoom00Doorend


aaaaqqxxGotoRoom00Door is a Travel AI package that is broken because the target ref has been deleted.
Missing a target, it defaulted to "Near editor location"
I changed it to "Near current location location" - no change - same error
I set it to a specific reference and the runtime error vanished!!!
Changed it back to "Near editor location" and, of course, everything is fine. I suppose I somehow fixed the package.

Weird. Even if the AI package was broken, the script is not trying to run it. Just assigning the ref to an array element.

Hope it helps.

Sounds like the bad package reference was contaminating the script data/preventing the script from loading correctly.
CalcLeveledItemNR doesn't seem to be working in OBSE expressions:

Thanks, fixed.
Hi, I had a few questions. :)
  • Array FormMaps, now I know it has been mentioned alot before and I won't repeat any arguments. All I'd like to know is if they'll be in v19 or not (aka, what the final verdict on them is).
  • In the past, only the latest version of OBSE is available for download. Since v18 changes the the way a script is compiled it automatically requires v18 or higher. Now for OBSE scripts this shouldn't matter, a user should always be using the latest OBSE. But for non-OBSE mods or dual mods it quickly becomes a problem. Yes, I can just load the cs without OBSE but that is a bit of a hassle when I'm working on two scripts at once, one is OBSE-powered and the other isn't. For dual scripts (where the OBSE code is in the same script as the normal code) this won't work. So the only way around this right is installing v17 again whenever I need to change that particular script. Then change it back to v18 again. So it's probably a good idea to keep v17b up for grabs.
  • To add to #2, is it possible (in theory) to add a flag or switch or whatever it's called to the command line that forces OBSE to use the older bytecode stuff in the cs?
-kyoma

There is no final verdict. Can't make any promises about 0019 yet.

I'll have to look at the differences between bytecode representations between the current and previous versions to see how much of a problem this is.
User avatar
Loane
 
Posts: 3411
Joined: Wed Apr 04, 2007 6:35 am

Post » Fri May 27, 2011 12:09 pm

Hi, I had a few questions. :)
  • Array FormMaps, now I know it has been mentioned alot before and I won't repeat any arguments. All I'd like to know is if they'll be in v19 or not (aka, what the final verdict on them is).
  • In the past, only the latest version of OBSE is available for download. Since v18 changes the the way a script is compiled it automatically requires v18 or higher. Now for OBSE scripts this shouldn't matter, a user should always be using the latest OBSE. But for non-OBSE mods or dual mods it quickly becomes a problem. Yes, I can just load the cs without OBSE but that is a bit of a hassle when I'm working on two scripts at once, one is OBSE-powered and the other isn't. For dual scripts (where the OBSE code is in the same script as the normal code) this won't work. So the only way around this right is installing v17 again whenever I need to change that particular script. Then change it back to v18 again. So it's probably a good idea to keep v17b up for grabs.
  • To add to #2, is it possible (in theory) to add a flag or switch or whatever it's called to the command line that forces OBSE to use the older bytecode stuff in the cs?
-kyoma

With regards to #2 - older versions of OBSE are kept available. http://obse.silverlock.org/download/archive/ shows previous versions of OBSE. You can navigate there by following a couple links: Downloads link from the first page (right before the demo video), and then Archive Folder listed at the bottom of the download page. It isn't a straight jump from the main page to discourage folks from getting an older version. But the files are still available.

The packages are just moved from download to download/archive when the new officially support version goes online.
User avatar
Justin Bywater
 
Posts: 3264
Joined: Tue Sep 11, 2007 10:44 pm

Post » Thu May 26, 2011 10:06 pm

Since v18 changes the the way a script is compiled it automatically requires v18 or higher.

My understanding was that this is only the case if the compiled script uses any OBSE expressions. An all-vanilla script will still run without OBSE even if compiled with it active, and the standard tricks can still be used for "hybrid" mods.
User avatar
Jessica White
 
Posts: 3419
Joined: Sun Aug 20, 2006 5:03 am

Post » Fri May 27, 2011 4:42 am

My understanding was that this is only the case if the compiled script uses any OBSE expressions. An all-vanilla script will still run without OBSE even if compiled with it active, and the standard tricks can still be used for "hybrid" mods.
Ohhhh, I'm gonna try it out. :)
User avatar
james tait
 
Posts: 3385
Joined: Fri Jun 22, 2007 6:26 pm

Post » Fri May 27, 2011 8:17 am

My understanding was that this is only the case if the compiled script uses any OBSE expressions. An all-vanilla script will still run without OBSE even if compiled with it active, and the standard tricks can still be used for "hybrid" mods.



Ohhhh, I'm gonna try it out. :)

tejon is correct - this only happens if you are using any of the expression parsing code and features introduced in v17. So if you bypass arrays, strings and the like you can continue to build mods for all versions of OBSE.
User avatar
steve brewin
 
Posts: 3411
Joined: Thu Jun 21, 2007 7:17 am

Post » Fri May 27, 2011 4:52 am

tejon is correct - this only happens if you are using any of the expression parsing code and features introduced in v17. So if you bypass arrays, strings and the like you can continue to build mods for all versions of OBSE.
By strings, do you mean any strings or only strings in combination with expressions and direct assignment?
User avatar
stephanie eastwood
 
Posts: 3526
Joined: Thu Jun 08, 2006 1:25 pm

Post » Fri May 27, 2011 9:56 am

By strings, do you mean any strings or only strings in combination with expressions and direct assignment?

Probably the latter, as we had some string_var support before expressions came around. But I am not positive - it may all run through the same internal code today. Hard-coded strings (in quotes for things like MessageBox) are obviously fine - it will be direct assignment of string_vars for things like GetName which would be likely to have the problem.
User avatar
Charlotte Lloyd-Jones
 
Posts: 3345
Joined: Fri Jun 30, 2006 4:53 pm

Post » Fri May 27, 2011 1:33 am

Well Old Friends as you can See the Raz is back. I have been working on a scriptwriter's resource for the OBSE with the use of http://notepad-plus.sourceforge.net/uk/site.htm. I have talked about it over at this thread http://www.gamesas.com/bgsforums/index.php?showtopic=1040995. Right Now I am working on my website Which I am calling http://oblivionworks.co.cc/. Like I said I compiled my list basing it off of the http://cs.elderscrolls.com/constwiki/index.php/OBSE_Functions located on the CS Wiki. but sadily that list only list functions native up to OBSE V15 I was wondering if there is another list a more updated list of just all the functions it does not have to be in ABC order they can be listed in groups of when they was implemented IE ObSE Version they came into being.
User avatar
Madeleine Rose Walsh
 
Posts: 3425
Joined: Wed Oct 04, 2006 2:07 am

Post » Fri May 27, 2011 4:40 am

Well Old Friends as you can See the Raz is back. I have been working on a scriptwriter's resource for the OBSE with the use of http://notepad-plus.sourceforge.net/uk/site.htm. I have talked about it over at this thread http://www.gamesas.com/bgsforums/index.php?showtopic=1040995. Right Now I am working on my website Which I am calling http://oblivionworks.co.cc/. Like I said I compiled my list basing it off of the http://cs.elderscrolls.com/constwiki/index.php/OBSE_Functions located on the CS Wiki. but sadily that list only list functions native up to OBSE V15 I was wondering if there is another list a more updated list of just all the functions it does not have to be in ABC order they can be listed in groups of when they was implemented IE ObSE Version they came into being.

I can actually produce a list of functions and parameters generated from the code itself. From there I can also list which functions showed up in which release. You can get a lot of this information listed in the http://obse.silverlock.org/obse_command_doc.html#Function_Index.
User avatar
R.I.p MOmmy
 
Posts: 3463
Joined: Wed Sep 06, 2006 8:40 pm

Post » Fri May 27, 2011 6:01 am

Cool Cool I uploaded the changes to my site http://www.oblivionworks.co.cc/index.php/plugins-and-utilties/48-tes-cs-with-obse-script-definition-for-notepad-plus to read the Article and download the utility

Edit:

Updated the link to the right location feel free to download the utility and comment on it
User avatar
Jason White
 
Posts: 3531
Joined: Fri Jul 27, 2007 12:54 pm

Post » Thu May 26, 2011 9:46 pm

I have been using v. 0018 beta 4 for some time without problems, but after some hardware issues I was told to delete oblivion.ini.

So I did, but now I got problems in Main menu; whenever I click anything (new game, load, exit) I get a weird "flash" which looks like the e.g load game ui opened and instantly closed. Then after that, the mouse cursor wont respond to any clicks. If I press load game, I get the flash, and if I press esc after that I get the save selection screen, but still can't click anything.
Is there way to fix this? I tried installing obse again, with no difference in results.

And I get no problems when I launch oblivion without obse
User avatar
Ana
 
Posts: 3445
Joined: Sat Jul 01, 2006 4:29 am

Post » Fri May 27, 2011 6:04 am

I have been using v. 0018 beta 4 for some time without problems, but after some hardware issues I was told to delete oblivion.ini.

So I did, but now I got problems in Main menu; whenever I click anything (new game, load, exit) I get a weird "flash" which looks like the e.g load game ui opened and instantly closed. Then after that, the mouse cursor wont respond to any clicks. If I press load game, I get the flash, and if I press esc after that I get the save selection screen, but still can't click anything.
Is there way to fix this? I tried installing obse again, with no difference in results.

And I get no problems when I launch oblivion without obse

Hmm - I haven't heard of this problem before. Can you check to see what happens if you launch with OBSE, but without any OBSE-mods? A list of the OBSE mods and plugins you use would be really helpful for solving this problem. Also - did you keep your old Oblivion.ini file from when things were working? Comparing that with the contents of the new generated ini file might help to figure out what is going on.
User avatar
J.P loves
 
Posts: 3487
Joined: Thu Jun 21, 2007 9:03 am

Post » Fri May 27, 2011 2:19 am

Tried without any mods enabled - still no luck. Normal oblivion launcher works still just fine.
Sadly I don't have the old oblivion.ini anymore, as I figured the newly generated ini would be just like from oblivion fresh install and problemless :/

Weirdly enoughm, when I manage to press esc after pressing load game and I'm staring at file selection without ability to click any option, I sometimes can see the 1st part of the credits flash there if I spam esc and random clicks.

I tried pressing credits normally in main menu, and got the 1st part showing up, but they wont scroll anywhere. And even more weirdly pressing credits won't prevent me from clicking further stuff, I can spam the credit start on and off just fine.
User avatar
Shannon Lockwood
 
Posts: 3373
Joined: Wed Aug 08, 2007 12:38 pm

Post » Fri May 27, 2011 3:36 am

Tried without any mods enabled - still no luck. Normal oblivion launcher works still just fine.
Sadly I don't have the old oblivion.ini anymore, as I figured the newly generated ini would be just like from oblivion fresh install and problemless :/

Weirdly enoughm, when I manage to press esc after pressing load game and I'm staring at file selection without ability to click any option, I sometimes can see the 1st part of the credits flash there if I spam esc and random clicks.

I tried pressing credits normally in main menu, and got the 1st part showing up, but they wont scroll anywhere. And even more weirdly pressing credits won't prevent me from clicking further stuff, I can spam the credit start on and off just fine.


Do you have any OBSE-plugins? I am truly at a loss for what might have happened, and why our code would do anything with this. Can you check your Oblivion.ini file for the settings for bBackground Keyboard and bBackground Mouse? It might be interesting to know if those are on (1) or off (0) and to see if switching them makes any difference. I'm pretty stumped.
User avatar
quinnnn
 
Posts: 3503
Joined: Sat Mar 03, 2007 1:11 pm

Post » Fri May 27, 2011 10:03 am

That's the thingy! I had universal silent voice ( http://tesnexus.com/downloads/file.php?id=16622 ) and some fpscapper files in my obse plugin folder.
Removing universal silent files had no effect, but removing those fps capper files worked and now my game rolls great with obse.
I had already forgotten about fpscapper, and searched for it in tesnexus, but only found a blocked file with that name.

Anyways my game is working nicely without those capper files, so thank you for help.
User avatar
Miguel
 
Posts: 3364
Joined: Sat Jul 14, 2007 9:32 am

Post » Fri May 27, 2011 2:05 am

Anyways my game is working nicely without those capper files, so thank you for help.
FPS Capper's now called Oblivion Stutter Remover.
User avatar
Bethany Watkin
 
Posts: 3445
Joined: Sun Jul 23, 2006 4:13 pm

PreviousNext

Return to IV - Oblivion