[RELz] Oblivion Script Extender (OBSE) 0018

Post » Fri Nov 26, 2010 12:17 am

I've got a question with my logs, I get "plugin did not read all of its data (at 0000000000007477 expected 0000000000007478):" and what does it mean? is there anything I can do to correct it??
Spoiler
OBSE: initialize (version = 18.6 010201A0)



This likely comes from OGE. Looking at the source SEOD and SEOF terminator records are saved as 1-byte, but not read as such. This is harmless, as OBSE code seeks at the correct position after each chunk.
User avatar
Britta Gronkowski
 
Posts: 3475
Joined: Mon Apr 09, 2007 3:14 pm

Post » Thu Nov 25, 2010 8:42 am

This likely comes from OGE. Looking at the source SEOD and SEOF terminator records are saved as 1-byte, but not read as such. This is harmless, as OBSE code seeks at the correct position after each chunk.


Whoops. Yes it looks like you are right. I'll fi it in my next release. (Just because the API is robust enough that it lets me get away with doing something stupid it doesn't mean that I should do it).
User avatar
Daddy Cool!
 
Posts: 3381
Joined: Tue Aug 21, 2007 5:34 pm

Post » Thu Nov 25, 2010 8:02 pm

The general format of an OBSE function, in the plaintext, is as follows...

Ok. I'll start plugging away at this, but it's going to take time. I'd like to finish the home page reformat first, since it won't take nearly as long to complete and can start being used as a resource sooner. I probably won't be including examples or notes (other than the notes included on the home page, that is). It will probably be easier and faster for you to add them yourself since I'm not 100% sure how all of these functions work and I don't want to mislead anyone. I'm just a scribe. :)

Incidentally, what happens if I create a page and someone creates the same page before I pass the document along to you? Will it overwrite the existing page or be ignored?
User avatar
Lori Joe
 
Posts: 3539
Joined: Tue Jun 20, 2006 6:10 am

Post » Thu Nov 25, 2010 2:01 pm

Ok. I'll start plugging away at this, but it's going to take time. I'd like to finish the home page reformat first, since it won't take nearly as long to complete and can start being used as a resource sooner. I probably won't be including examples or notes (other than the notes included on the home page, that is). It will probably be easier and faster for you to add them yourself since I'm not 100% sure how all of these functions work and I don't want to mislead anyone. I'm just a scribe. :)

Absolutely agreed on all of the above. Even, I think, mentioned about the notes and stuff. Definitely do the OBSE page first, and definitely don't worry about including any new information - just transcribing it to Wiki format would be huge.

Incidentally, what happens if I create a page and someone creates the same page before I pass the document along to you? Will it overwrite the existing page or be ignored?

The bot can be directed on what it should do in that case; presumably we'd want to ignore.
User avatar
Robert Garcia
 
Posts: 3323
Joined: Thu Oct 11, 2007 5:26 pm

Post » Thu Nov 25, 2010 9:23 pm

Absolutely agreed on all of the above. Even, I think, mentioned about the notes and stuff. Definitely do the OBSE page first, and definitely don't worry about including any new information - just transcribing it to Wiki format would be huge.

The bot can be directed on what it should do in that case; presumably we'd want to ignore.

Yes, ignore, definitely.

I'll keep you up to date on my progress and probably ask a few more questions, otherwise, assume I'm working on this.
User avatar
Jessie Rae Brouillette
 
Posts: 3469
Joined: Mon Dec 11, 2006 9:50 am

Post » Thu Nov 25, 2010 2:32 pm

Re: confusion over the disclaimer in the OP...

Thanks scruggsy, that did clear things up quite a bit (now if I can just make a time machine and have Cobl always require OBSE :P)
User avatar
lauraa
 
Posts: 3362
Joined: Tue Aug 22, 2006 2:20 pm

Post » Fri Nov 26, 2010 12:11 am

Excellent, thank you so much!
User avatar
ANaIs GRelot
 
Posts: 3401
Joined: Tue Dec 12, 2006 6:19 pm

Post » Thu Nov 25, 2010 10:43 pm

Bug report : adding a cloned item to an actor within some loop structures (while and forEach but not label/goto loops) seems to cause the game to freeze or crash.

here an example of some script that always causes my game to crash:
Scn aaaTesterItemref		actorref		clonearray_var	setBegin GameMode	if (actor)		ForEach set <- actor.GetItems 20 22			if (condisions)				let clone := (cloneform (set["value"]))			;	Do stuff with clone				actor.additemNS clone, 1			endif		loop	else		let actor := getContainer	endifEnd

Oddly enough, simply commenting out 'actor.additemNS clone, 1' will cause the script to function as expected.
User avatar
Mélida Brunet
 
Posts: 3440
Joined: Thu Mar 29, 2007 2:45 am

Post » Fri Nov 26, 2010 12:12 am

Bug report : adding a cloned item to an actor within some loop structures (while and forEach but not label/goto loops) seems to cause the game to freeze or crash.

here an example of some script that always causes my game to crash:
Scn aaaTesterItemref		actorref		clonearray_var	setBegin GameMode	if (actor)		ForEach set <- actor.GetItems 20 22			if (condisions)				let clone := (cloneform (set["value"]))			;	Do stuff with clone				actor.additemNS clone, 1			endif		loop	else		let actor := getContainer	endifEnd

Oddly enough, simply commenting out 'actor.additemNS clone, 1' will cause the script to function as expected.

Do:
let clone := set["value"]let clone := cloneform cloneactor.additemNS clone 1

The cloneform line as written should not compile; the parens induce it to compile anyway.
User avatar
Philip Lyon
 
Posts: 3297
Joined: Tue Aug 14, 2007 6:08 am

Post » Thu Nov 25, 2010 5:44 pm

Question about the documentation:

If the documentation claims that a reference is required, but the script compiles without an explicit reference, is the reference actually required?

I noticed this discrepancy when I started compiling a condensed list of functions. One of the first functions I added was ModAV2. In the OBSE documentation, the reference is written in a normal monospace font, indicating the reference is required, but it obviously isn't. I assume this is an error, as scripts compile fine without it. I then noticed several other functions that had similar discrepancies between documentation and implementation. Can I always assume that if a function compiles fine in an object script without a reference that the reference is not required, or are there occasions in which a function may compile without a reference but fail when called? I'd like to know how best to go about correcting clerical errors like this in the documentation.
User avatar
Len swann
 
Posts: 3466
Joined: Mon Jun 18, 2007 5:02 pm

Post » Thu Nov 25, 2010 5:21 pm

Question about the documentation:

If the documentation claims that a reference is required, but the script compiles without an explicit reference, is the reference actually required?

I noticed this discrepancy when I started compiling a condensed list of functions. One of the first functions I added was ModAV2. In the OBSE documentation, the reference is written in a normal monospace font, indicating the reference is required, but it obviously isn't. I assume this is an error, as scripts compile fine without it. I then noticed several other functions that had similar discrepancies between documentation and implementation. Can I always assume that if a function compiles fine in an object script without a reference that the reference is not required, or are there occasions in which a function may compile without a reference but fail when called? I'd like to know how best to go about correcting clerical errors like this in the documentation.


If you don't use an explicit Reference in an Object Script, the Reference which "holds" the Script is assumed as the Calling Actor (Magic Effect Scripts use the Target). Change the type to a Quest Script and the CS will complain if a Calling Actor is required, but not specified.
Quest Stage/Dialog Result Script should work, too. ;)
User avatar
Samantha Mitchell
 
Posts: 3459
Joined: Mon Nov 13, 2006 8:33 pm

Post » Thu Nov 25, 2010 12:07 pm

If you don't use an explicit Reference in an Object Script, the Reference which "holds" the Script is assumed as the Calling Actor (Magic Effect Scripts use the Target). Change the type to a Quest Script and the CS will complain if a Calling Actor is required, but not specified.
Quest Stage/Dialog Result Script should work, too. ;)

^ this. If "ref" is in italics it indicates a calling reference (implicit or explicit) is optional (e.g. for most inventory item commands) and a base object can be supplied as an argument instead - but either one or the other must be supplied for the command to execute, and the base object argument always takes precedence if both are supplied.
User avatar
SexyPimpAss
 
Posts: 3416
Joined: Wed Nov 15, 2006 9:24 am

Post » Thu Nov 25, 2010 4:06 pm

er...what?

What is the default reference in a quest stage script?

The player?

Is the player and OR the "other" NPC (who ever the NPC is talking to) the default reference in a Dialog Result Script ?


Quest Stage/Dialog Result Script should work, too. ;)

User avatar
Andres Lechuga
 
Posts: 3406
Joined: Sun Aug 12, 2007 8:47 pm

Post » Thu Nov 25, 2010 6:21 pm

er...what?

What is the default reference in a quest stage script?

The player?

Is the player and OR the "other" NPC (who ever the NPC is talking to) the default reference in a Dialog Result Script ?


As far as I know there is no default reference, that's why I think they should be an ideal "playground" for your tests. ;)
User avatar
Hannah Whitlock
 
Posts: 3485
Joined: Sat Oct 07, 2006 12:21 am

Post » Thu Nov 25, 2010 4:15 pm

Do:
let clone := set["value"]let clone := cloneform cloneactor.additemNS clone 1

The cloneform line as written should not compile; the parens induce it to compile anyway.


This still causes the game to crash. Even cloning an apple and adding it to the player inside a loop causes my game to crash.
foreach set <- actor.getitems	let clone := cloneForm apple	actor.additem clone 1loop

Everything compiles, but the game just crashes when it runs the script. As I said, the same script seems to work if I replace the forEach loop with a label/goto style loop.

Scn aaaTesterWorksref		actorref		cloneshort		iarray_var	itemSetBegin GameMode	if (actor)		let itemSet := actor.GetItems 20 22		label		if eval (itemSet[i])			let i := i + 1			let clone := cloneForm apple			actor.additemNS clone 1			goto		endif	else		let actor := getContainer	endifEnd

User avatar
Tyrel
 
Posts: 3304
Joined: Tue Oct 30, 2007 4:52 am

Post » Thu Nov 25, 2010 3:35 pm

If you don't use an explicit Reference in an Object Script, the Reference which "holds" the Script is assumed as the Calling Actor (Magic Effect Scripts use the Target). Change the type to a Quest Script and the CS will complain if a Calling Actor is required, but not specified.
Quest Stage/Dialog Result Script should work, too. ;)


^ this. If "ref" is in italics it indicates a calling reference (implicit or explicit) is optional (e.g. for most inventory item commands) and a base object can be supplied as an argument instead - but either one or the other must be supplied for the command to execute, and the base object argument always takes precedence if both are supplied.

Thank you. I understand how references work but for some reason I was misinterpreting the documentation. Since object scripts always run on references they don't need to be declared in the script. For some reason this is how my brain was interpreting 'optional'; as in: you don't have to explicitly type it into your script. These references are supplied implicitly, but obviously still required. Functions which operate on base objects don't require a reference, though one may be supplied in lieu of a base object. That means that functions supplied with base objects change the object for all instances, but functions supplied with a reference change only that single instance. Correct?

That clears things up for me. Thanks, guys.

Edit: Here's an updated version of the list -> http://i279.photobucket.com/albums/kk146/TheMagicianFromOblivion/obsefunctionlist.jpg (WIP)

As usual, suggestions, criticisms, and requests are appreciated.
User avatar
lillian luna
 
Posts: 3432
Joined: Thu Aug 31, 2006 9:43 pm

Post » Thu Nov 25, 2010 1:42 pm

Man, is my timing awesome or what?

On the other hand, sorry for copping out on the beta feedback, Scruggs. :(

@popcorn - IIRC, CloneForm only works on variables. See what happens if you instead use:

foreach set <- actor.getitems	let clone := apple	let clone := cloneForm clone	actor.additem clone 1loop

User avatar
Sophie Payne
 
Posts: 3377
Joined: Thu Dec 07, 2006 6:49 am

Post » Thu Nov 25, 2010 4:23 pm

Functions which operate on base objects don't require a reference, though one may be supplied in lieu of a base object. That means that functions supplied with base objects change the object for all instances, but functions supplied with a reference change only that single instance. Correct?
Yes.

The docs are getting better by the day :thumbsup:
User avatar
Roberta Obrien
 
Posts: 3499
Joined: Tue Oct 23, 2007 1:43 pm

Post » Thu Nov 25, 2010 8:59 pm

Is there a debug...ring mod around? Maybe I am just imagining things, but I thought I have seen people recommending the user post their console out put with ConScribe and to also use a ring in conjunction. Most of the time these issues are related to mods that use OBSE, that is why I have posted here.
User avatar
Bee Baby
 
Posts: 3450
Joined: Sun Jun 18, 2006 4:47 am

Post » Thu Nov 25, 2010 4:34 pm

Is there a debug...ring mod around? Maybe I am just imagining things, but I thought I have seen people recommending the user post their console out put with ConScribe and to also use a ring in conjunction. Most of the time these issues are related to mods that use OBSE, that is why I have posted here.
Would you be talking about the Console ring mod ?
User avatar
Liii BLATES
 
Posts: 3423
Joined: Tue Aug 22, 2006 10:41 am

Post » Thu Nov 25, 2010 5:12 pm

I might be, but that is only for helping users who cannot use the tilde key to open the console, right? I just added ConScribe to http://sites.google.com/site/oblivionpoinfo/troubleshooting/troubleshootingmods. Thanks.
User avatar
Anna Kyselova
 
Posts: 3431
Joined: Sun Apr 01, 2007 9:42 am

Post » Thu Nov 25, 2010 11:56 am


@popcorn - IIRC, CloneForm only works on variables. See what happens if you instead use:

foreach set <- actor.getitems	let clone := apple	let clone := cloneForm clone	actor.additem clone 1loop

This is copied strait from the documentation
The cloning functions are special. They are declared as taking Inventory Objects so any inventory object can be passed as a raw name from the CS. However you can clone any form by first assigning it to a ref and then passing that ref to CloneForm.
CloneForm - creates and returns a new base object that is an exact copy of the passed objectID

So yes cloneForm should work on base object passed directly to the function and not just variables.

And, no, writing the script like you suggested does not fix my crash. Although Im assuming you tested it before posting? Please tell me I'm not the only one having this problem :sad:
User avatar
Dan Endacott
 
Posts: 3419
Joined: Fri Jul 06, 2007 9:12 am

Post » Thu Nov 25, 2010 2:51 pm

This is copied strait from the documentation

So yes cloneForm should work on base object passed directly to the function and not just variables.

And, no, writing the script like you suggested does not fix my crash. Although Im assuming you tested it before posting? Please tell me I'm not the only one having this problem :sad:

I can't duplicate the crash using the posted code or other variations.
Please post the full script.
User avatar
Marquis deVille
 
Posts: 3409
Joined: Thu Jul 26, 2007 8:24 am

Post » Thu Nov 25, 2010 2:59 pm

Is there a limitation to the name of an object (length, content, size of which is stored in the save (if it's a clone))? Other than the global max string size (or should I say buffer).
User avatar
Becky Palmer
 
Posts: 3387
Joined: Wed Oct 04, 2006 4:43 am

Post » Fri Nov 26, 2010 2:23 am

Thank you. I understand how references work but for some reason I was misinterpreting the documentation. Since object scripts always run on references they don't need to be declared in the script. For some reason this is how my brain was interpreting 'optional'; as in: you don't have to explicitly type it into your script. These references are supplied implicitly, but obviously still required. Functions which operate on base objects don't require a reference, though one may be supplied in lieu of a base object. That means that functions supplied with base objects change the object for all instances, but functions supplied with a reference change only that single instance. Correct?


Not sure if I read you right.
Rephrasing:

Functions that operate on references require a reference (explicit or implied).
Functions that operate on base objects will use the supplied objectID or, if one is not supplied, will use the base object of the reference (explicit or implied). But it will still operate on a base object, regardless of how the function is written.

Take Health, for example. The base object of a weapon has a Health and references may have, each, a different Health.
GetObjectHealth operates on base objects, therefore "GetObjectHealth WeapIronLongsword" will return 140 (the base Health). "IronSword01.GetObjectHealth" will also return 140, regardless of the current Health of IronSword01.
To get the Health of the reference, you need a function that operates on the reference: GetCurrentHealth.
User avatar
Setal Vara
 
Posts: 3390
Joined: Thu Nov 16, 2006 1:24 pm

PreviousNext

Return to IV - Oblivion