[BETA] Oblivion Script Extender (OBSE) v0018

Post » Fri May 27, 2011 1:08 pm

That would be it, and, actually, I think the OBSE team is discussing ways around the problem (i.e., load the OBSE data at a different point, start up the scripts that were "supposed" to start at GameMode instead of MenuMode).


Well, it's good that there are still options atleast. I will be looking closely at how it turns out, I'm waiting on a few mods that won't release until obse 18 is stable
User avatar
Dina Boudreau
 
Posts: 3410
Joined: Thu Jan 04, 2007 10:59 pm

Post » Fri May 27, 2011 7:20 am

Hi All,

I am using OBSE 18 beta 4. I hit a CTD problem with GetBookText. It appears to crash if the text exceeds some length. The book that is failing is Aurum Incantatum from Midas Spells. According to MS Word, it is 46,451 characters.

I hit this problem calling FormID Finder on the book, and it immediately CTD; I added some printc statements and found that the GetBookText is the culprit.

thanks all,
a
User avatar
Gavin boyce
 
Posts: 3436
Joined: Sat Jul 28, 2007 11:19 pm

Post » Fri May 27, 2011 4:06 am

Hi All,

I am using OBSE 18 beta 4. I hit a CTD problem with GetBookText. It appears to crash if the text exceeds some length. The book that is failing is Aurum Incantatum from Midas Spells. According to MS Word, it is 46,451 characters.

I hit this problem calling FormID Finder on the book, and it immediately CTD; I added some printc statements and found that the GetBookText is the culprit.

thanks all,
a
GetBookText will crash when the book text is above 16440 (or something, maybe it's been increased since the last time I checked) because that is the maximum (internal) buffer size for strings in OBSE. You'll also get a crash with the pre-v17 (sv_Set, sv_Construct, any function that takes a format string) functions if the string exceeds that length. The new assignment string manipulation (let and := does not seem suffer from this limit though.
User avatar
Cat
 
Posts: 3451
Joined: Mon Dec 18, 2006 5:10 am

Post » Fri May 27, 2011 8:14 am

Hi All,

I have two questions, please:

============================
1.

ScriptName example
;
ref namecell
...
...
;
Begin GameMode
...
set namecell to Player.GetCellRef
...
...
End

namecell would be the reference of the cell where is placed the player
But this syntax "GetCellRef" or "GetCellReference" does not exist?

============================
2.

The syntax "SetRace" to change the race of an actor is always for the version OBSE v0019 ?

============================

Thanks all
User avatar
trisha punch
 
Posts: 3410
Joined: Thu Jul 13, 2006 5:38 am

Post » Thu May 26, 2011 10:36 pm

set namecell to Player.GetCellRef

set rCell to player.GetParentCell (note that it's not really the name of the cell, but the FormID/Reference of the cell)
The syntax "SetRace" to change the race of an actor is always for the version OBSE v0019 ?

OBSE will always be backwards compatible. If they need to change the syntax they'll create a SetRace2. Oh... wait, there is no SetRace - did you mean 'Will there be a SetRace' in v19?
User avatar
Mrs Pooh
 
Posts: 3340
Joined: Wed Oct 24, 2007 7:30 pm

Post » Fri May 27, 2011 8:13 am

1. set rCell to player.GetParentCell... Thank you very much haama!

2. Yes..., because two or three months ago somebody had already asked this question, and an answer evoked a possibility in the future version 19!

Here : http://www.gamesas.com/bgsforums/index.php?s=&showtopic=1013487&view=findpost&p=14702418

The last sentence :
We actually have a basic implementation of this but it is error-prone when changing the race of loaded NPCs or changing between races that use the default skeleton and those that use the beast skeleton. We can do some further investigation for 0019.
User avatar
cassy
 
Posts: 3368
Joined: Mon Mar 05, 2007 12:57 am

Post » Fri May 27, 2011 1:40 am

1. set rCell to player.GetParentCell... Thank you very much haama!

2. Yes..., because two or three months ago somebody had already asked this question, and an answer evoked a possibility in the future version 19!

Here : http://www.gamesas.com/bgsforums/index.php?s=&showtopic=1013487&view=findpost&p=14702418

The last sentence :
We actually have a basic implementation of this but it is error-prone when changing the race of loaded NPCs or changing between races that use the default skeleton and those that use the beast skeleton. We can do some further investigation for 0019.


Just to be clear - we may look for the SetRace functionality for v19, but really all we have done is add it to the list of things we could pursue. Generally the list is much, much larger than what can actually be accomplished. So at this point I can say that we'll see what we find time to do. However I wouldn't count on this functionality any time soon. We're still sorting out the issues with v18, and after that we need to get FOSE v2 out the door (they have been waiting a year for a new version).
User avatar
Marcia Renton
 
Posts: 3563
Joined: Fri Jan 26, 2007 5:15 am

Post » Thu May 26, 2011 9:57 pm

Thank you.


1. set rCell to player.GetParentCell... Thank you very much haama!

"GetParentCell", another remark :
http://cs.elderscrolls.com/constwiki/index.php/GetParentCell
The last sentence :
In the commands.txt of OBSE v0004, this function was called GetPlayerCell.

==> but this syntax "GetPlayerCell" does not exist in OBSE?! (http://cs.elderscrolls.com/constwiki/index.php/List_of_Functions#C)
User avatar
Mélida Brunet
 
Posts: 3440
Joined: Thu Mar 29, 2007 2:45 am

Post » Fri May 27, 2011 11:31 am

Thank you.



"GetParentCell", another remark :
http://cs.elderscrolls.com/constwiki/index.php/GetParentCell
The last sentence :
In the commands.txt of OBSE v0004, this function was called GetPlayerCell.

==> but this syntax "GetPlayerCell" does not exist in OBSE?! (http://cs.elderscrolls.com/constwiki/index.php/List_of_Functions#C)

Correct - GetPlayerCell never existed on OBSE. It was a typo in the command documentation provided with version v0004. I mistyped when doing the documentation. GetPlayerCell would imply that no reference is needed to make the call - but it implicitly took the player reference only. GetParentCell requires a reference and returns the parent cell of that reference.

If I remember correctly, the original goal was to return the cell of the player - so I had implemented it just to use the player. But it was trivial to support any reference, so it was changed before it was released. But that was before we used source control, so I honestly don't remember if that was the case or not.
User avatar
danni Marchant
 
Posts: 3420
Joined: Sat Oct 07, 2006 2:32 am

Post » Fri May 27, 2011 9:19 am

How many variables can 1 array hold?
How do you reference array variables in another script?
MYTESTQUEST.ArrayVariable[0][1]
Like that?
User avatar
Sarah Unwin
 
Posts: 3413
Joined: Tue Aug 01, 2006 10:31 pm

Post » Fri May 27, 2011 7:08 am

GetBookText will crash when the book text is above 16440 (or something, maybe it's been increased since the last time I checked) because that is the maximum (internal) buffer size for strings in OBSE. You'll also get a crash with the pre-v17 (sv_Set, sv_Construct, any function that takes a format string) functions if the string exceeds that length. The new assignment string manipulation (let and := does not seem suffer from this limit though.


Thanks Kyoma,

Is it possible to have GetBookText return only the first 16k characters to avoid a CTD? Perhaps, it can include a message at the end of the string "Text incomplete as it exceeds allowed length."

thanks everyone,
a
User avatar
Rude_Bitch_420
 
Posts: 3429
Joined: Wed Aug 08, 2007 2:26 pm

Post » Fri May 27, 2011 2:45 am

Thanks Kyoma,

Is it possible to have GetBookText return only the first 16k characters to avoid a CTD? Perhaps, it can include a message at the end of the string "Text incomplete as it exceeds allowed length."

thanks everyone,
a


I'll see what I can do. I took a look a the code - the first part is all Bethesda code - it is the turning it into a string variable that is ours. In that code we use a 16k buffer (16384 bytes) and if things are larger we may stomp over that - although the function internally looks like it will exit early if the size is too large. I guess I need to run a test where the size of the book is actually too large and reproduce the crash.
User avatar
james reed
 
Posts: 3371
Joined: Tue Sep 18, 2007 12:18 am

Post » Fri May 27, 2011 2:23 am

How many variables can 1 array hold?
How do you reference array variables in another script?
MYTESTQUEST.ArrayVariable[0][1]
Like that?

1. I'm not sure if you're referring to the number of elements allowed within a single-dimensional array, or the number of allowed dimensions. Both are unlimited for practical purposes. You will run up against other limitations (memory, game performance) before you approach any limits on the amount of storable data.
2. That's correct.
User avatar
lucile
 
Posts: 3371
Joined: Thu Mar 22, 2007 4:37 pm

Post » Fri May 27, 2011 4:55 am

1. I'm not sure if you're referring to the number of elements allowed within a single-dimensional array, or the number of allowed dimensions. Both are unlimited for practical purposes. You will run up against other limitations (memory, game performance) before you approach any limits on the amount of storable data.
2. That's correct.

Thanks.
Is there anyway to see if arrayvar[0] hasn't been set to anything?
User avatar
Marnesia Steele
 
Posts: 3398
Joined: Thu Aug 09, 2007 10:11 pm

Post » Fri May 27, 2011 12:12 am

Thanks.
Is there anyway to see if arrayvar[0] hasn't been set to anything?

You mean, if an element exists with a specific index?
Depends on the type of the array. For all types (Map, StringMap, Array) you can use:
if eval ar_HasKey arrayvar index

For Array types you can also use:
if eval (ar_Size arrayvar) < index

User avatar
Carlos Rojas
 
Posts: 3391
Joined: Thu Aug 16, 2007 11:19 am

Post » Fri May 27, 2011 12:43 pm

What's the index? Like the [1:15] thing?
User avatar
Kelli Wolfe
 
Posts: 3440
Joined: Thu Aug 23, 2007 7:09 am

Post » Fri May 27, 2011 1:24 pm

What's the index? Like the [1:15] thing?


The index is a 0-based count of items. The first item in the array is at index 0, the second and index 1, through the last at ar_Size - 1.


[1:15] would describe a range of items from the second through the 16th item.
User avatar
Juanita Hernandez
 
Posts: 3269
Joined: Sat Jan 06, 2007 10:36 am

Post » Fri May 27, 2011 2:17 pm

I have some questions that I hope can be clarified (I am very new to scripting with OBSE, so excuse anything basic)...

GetSpecialAnims

I thought this would return a list of all the KF files in the "Meshes\Characters\_male\specialanims" folder, but it appears to only return active KF files. When I look at the available KF files on the animations tab in CS, all available KF files are shown.

1. Is there a way to return all the KF files in the special animations folder?

ToggleSpecialAnim

If you change the current state of a specific animation, it only seems to take effect when you move to another cell. The change does not seem to persist over a save and reload of the game.

2. Is there a way to force the change to have an immediate effect?
3. Is there something special I need to do in order to have the change persist across saved games (ie without having to do do the toggle again)?

Additional Information

This is the script that I am trying to get to work...

ref rNPCarray_var aAnimsset rNPC to GetFirstRef 69while (rNPC)if rNPC.IsFemale   let aAnims := rNPC.GetSpecialAnims   if eval (ar_Find "CustomWalk.kf" aAnims) >= 0	 if rNPC.ToggleSpecialAnim "CustomWalk.kf" 1	  message "Animation activated"	 else	  message "Animation already active"	 endif   else	 message "KF file has not been installed"   endifendifset rNPC to getNextRefloop


Many thanks for any help, advice or guidance you can provide ? it will be very much appreciated.
User avatar
Cartoon
 
Posts: 3350
Joined: Mon Jun 25, 2007 4:31 pm

Post » Fri May 27, 2011 2:13 am

I have some questions that I hope can be clarified (I am very new to scripting with OBSE, so excuse anything basic)...

GetSpecialAnims

I thought this would return a list of all the KF files in the "Meshes\Characters\_male\specialanims" folder, but it appears to only return active KF files. When I look at the available KF files on the animations tab in CS, all available KF files are shown.

1. Is there a way to return all the KF files in the special animations folder?

ToggleSpecialAnim

If you change the current state of a specific animation, it only seems to take effect when you move to another cell. The change does not seem to persist over a save and reload of the game.

2. Is there a way to force the change to have an immediate effect?
3. Is there something special I need to do in order to have the change persist across saved games (ie without having to do do the toggle again)?

Additional Information

This is the script that I am trying to get to work...

ref rNPCarray_var aAnimsset rNPC to GetFirstRef 69while (rNPC)if rNPC.IsFemale   let aAnims := rNPC.GetSpecialAnims   if eval (ar_Find "CustomWalk.kf" aAnims) >= 0	 if rNPC.ToggleSpecialAnim "CustomWalk.kf" 1	  message "Animation activated"	 else	  message "Animation already active"	 endif   else	 message "KF file has not been installed"   endifendifset rNPC to getNextRefloop


Many thanks for any help, advice or guidance you can provide ? it will be very much appreciated.

GetSpecialAnims returns the animations in the special anims folder which have been enabled (checked in the CS Anims tab) for the base actor.
ToggleSpecialAnim affects the base actor and is not saved with the savegame; as pointed out in the docs it is of limited use for changing the anims of actors loaded in middle-high or high process. Support for more dynamic anim switching will have to wait for further decoding of actor process states.
User avatar
RObert loVes MOmmy
 
Posts: 3432
Joined: Fri Dec 08, 2006 10:12 am

Post » Fri May 27, 2011 9:38 am

GetSpecialAnims returns the animations in the special anims folder which have been enabled (checked in the CS Anims tab) for the base actor.
ToggleSpecialAnim affects the base actor and is not saved with the savegame; as pointed out in the docs it is of limited use for changing the anims of actors loaded in middle-high or high process. Support for more dynamic anim switching will have to wait for further decoding of actor process states.


Many thanks for the rapid response.

I guess my plans for being able to change animations for all NPC's without manually checking the anim via CS will have to wait :(

Did learn a fair amount in trying though :)
User avatar
joannARRGH
 
Posts: 3431
Joined: Mon Mar 05, 2007 6:09 am

Post » Fri May 27, 2011 11:46 am

Just wanted to post real quick to say that apparently I've accidentally walked into beta tasting :wacko:

I recently posted http://www.gamesas.com/bgsforums/index.php?showtopic=1045941 about a problem I found while trying nGCD, but since I had the most recent OBSE 0017, I tried the 0018 beta 4 from the first post of this thread. I was getting the Operator [ failed to evaluate error with a saved game, but a new game was fine, so I was pointed to the beta 5 patch, which I've just downloaded.

So...I'm an accidental tester it seems, which is fine with me although all I can do is :ahhh: and tell you what my game's doing, because coding isn't my forte, and I'm definitely not a modder. I'll post further observations here, whether things work fine or go wonky.
User avatar
Your Mum
 
Posts: 3434
Joined: Sun Jun 25, 2006 6:23 pm

Post » Thu May 26, 2011 10:21 pm

Bit of a silly question: CloneForm and Placeatme. Are the Cloneformed items saved in the save.obse file and the Placeatme items saved in the save.ess file?

I'm trying to see how much of an impact ten to sixteen items (five to eight each of cloneform and placeatme) per armor stand would have on a savegame.
User avatar
kevin ball
 
Posts: 3399
Joined: Fri Jun 08, 2007 10:02 pm

Post » Fri May 27, 2011 9:33 am

I'll see what I can do. I took a look a the code - the first part is all Bethesda code - it is the turning it into a string variable that is ours. In that code we use a 16k buffer (16384 bytes) and if things are larger we may stomp over that - although the function internally looks like it will exit early if the size is too large. I guess I need to run a test where the size of the book is actually too large and reproduce the crash.


Thanks Behippo. I appreciate you looking into it.

a
User avatar
David John Hunter
 
Posts: 3376
Joined: Sun May 13, 2007 8:24 am

Post » Fri May 27, 2011 12:17 am

Bit of a silly question: CloneForm and Placeatme. Are the Cloneformed items saved in the save.obse file and the Placeatme items saved in the save.ess file?

I'm trying to see how much of an impact ten to sixteen items (five to eight each of cloneform and placeatme) per armor stand would have on a savegame.

Cloned forms are stored in the TES save game (.ess) - just like player-made potions, spells and enchantments. Placeatme references are also stored in the save game.
User avatar
Claire Lynham
 
Posts: 3432
Joined: Mon Feb 12, 2007 9:42 am

Post » Fri May 27, 2011 6:19 am

As stated above, scripts run during the Load/Waiting menu, even if the game is just being loaded from a save. That is, if you have a script
scn aaaTestScriptlong  Workingbegin GameMode	if Working != -1		if Working == 1			message "Working"			printc "Working"		else			message "Not Working"			printc "Not Working"		endif		set Working to -1	endifendbegin MenuMode	if Working == 0 || Working == 1		set Working to 1	endifend

With Beta 4, you'll see "Working". With Beta 5, you won't see anything at all. If the script was running in GameMode block, then Working would be 0 and you'd see "Not Working".

Testing with the above scripts I see no difference between beta 4 and beta 5. Both produce a "Working" message from the second script and no output from the first.

--------------------------

I am not sure if we should attribute the decline in bug reports to the fix in beta 5, or to the assumption that we already know about issues and are working on them, or something else.
If anyone is experiencing unexplainable errors with beta 5 please speak up.

EDIT: Umm, don't speak up just yet, actually, wait for a new thread.
User avatar
Destinyscharm
 
Posts: 3404
Joined: Sun Jul 23, 2006 6:06 pm

PreviousNext

Return to IV - Oblivion