Found Bug in OBSE 18

Post » Fri May 27, 2011 8:40 am

er..sorry I mean I MAY have found a bug.

Something is wrong with GetPlayerSpell or with messagebox"%n"


set SpellLoaded to GetPlayerSpellif Spellloaded != 0messagebox"Doesn't work: %n"SpellLoadedendif



This will CTD everytime!


SpellLoaded is a REF

This is running in a quest script every .05 of a second.
User avatar
Ashley Campos
 
Posts: 3415
Joined: Fri Sep 22, 2006 9:03 pm

Post » Fri May 27, 2011 12:10 pm

Good eye. Wish i knew how to fix it so i could be more stable.
User avatar
maya papps
 
Posts: 3468
Joined: Mon Aug 07, 2006 3:44 pm

Post » Fri May 27, 2011 10:41 am

er..sorry I mean I MAY have found a bug.

Something is wrong with GetPlayerSpell or with messagebox"%n"


set SpellLoaded to GetPlayerSpellif Spellloaded != 0messagebox"Doesn't work: %n"SpellLoadedendif



This will CTD everytime!


SpellLoaded is a REF

This is running in a quest script every .05 of a second.
Not a bug actually, you are using the %n formatter with the normal MessageBox. You gotta use MessageBoxEx if you wanna use %n. :)
User avatar
Mrs. Patton
 
Posts: 3418
Joined: Fri Jan 26, 2007 8:00 am

Post » Fri May 27, 2011 4:19 pm

ok then there is an issue with GetPlayerSpell

I have the vanilla spell restore health in my casting slot but this:

set SpellLoaded to GetPlayerSpellif Spellloaded == 0message"working but ZERO"endifif Spellloaded != 0messageboxEX"Doesn't work: %n"SpellLoadedendif


ONLY returns the message"working but ZERO"
User avatar
Flesh Tunnel
 
Posts: 3409
Joined: Mon Sep 18, 2006 7:43 pm

Post » Fri May 27, 2011 11:03 am

I hope they get it fixed soon. Many of my mods use that function...

You probably already know this, but just checking. You haven't removed the player selected spell right?

From CSWiki:
Removing the active Spell should be done with caution. OBSE's developers have not found the player's spell list yet, so after you remove the active spell, GetActiveSpell will return 0 until the user selects a new spell. In the future it will always return the spell that will be cast, once we find that information.

User avatar
Kaylee Campbell
 
Posts: 3463
Joined: Mon Mar 05, 2007 11:17 am

Post » Fri May 27, 2011 10:11 am

I hope they get it fixed soon. Many of my mods use that function...

You probably already know this, but just checking. You haven't removed the player selected spell right?

From CSWiki:


I have not removed any spells.

And the spell in the cast slot now (in my test game) IS the one the new player starts with.

So this command DOES in fact have a bug, OK that answers a lot of questions.
User avatar
Adriana Lenzo
 
Posts: 3446
Joined: Tue Apr 03, 2007 1:32 am

Post » Fri May 27, 2011 6:26 am

What does that look like in game?
User avatar
TRIsha FEnnesse
 
Posts: 3369
Joined: Sun Feb 04, 2007 5:59 am

Post » Fri May 27, 2011 9:26 am

This code works just fine (using OBSE 18 Beta 4)

ScriptName RenTestQuestScriptref SpellLoadedref SpellLoadedBaseBegin GameMode	set SpellLoaded to GetPlayerSpell	if (Spellloaded == 0)		Message "Current Spell: 0"	else;set SpellLoadedBase to SpellLoaded.GetBaseObject		MessageEX "Current Spell: %n" SpellLoaded	endifEnd
I can successfully get it to output the name of the currently selected spell (I tested RGO's Corpse Carry and the vanilla Voice of the Emperor spell and both were outputted via MessageEX). The only issue I had was that in order for it to work I had to pick out a new spell from the in-game menu (it would not work on a spell if it was currently selected at save - it seems like the variable that OBSE uses isn't set until the player selects a spell, but after that it works a treat).
User avatar
Michelle Chau
 
Posts: 3308
Joined: Sat Aug 26, 2006 4:24 am

Post » Fri May 27, 2011 3:23 am

That still makes it unusable, unless there is an easy way to force a selection of a spell on reload of a save game?

OR...or...maybe I can just LOG what spell is in the cast slot, then on a reload use THAT if (Spellloaded == 0)?
:hehe:

Thinking about this: Log the spell every half second? or ONCE on a menu?

mmm...I know once coming OUT of a menu back to the game mode!

The only issue I had was that in order for it to work I had to pick out a new spell from the in-game menu (it would not work on a spell if it was currently selected at save - it seems like the variable that OBSE uses isn't set until the player selects a spell, but after that it works a treat).

User avatar
Crystal Clear
 
Posts: 3552
Joined: Wed Aug 09, 2006 4:42 am

Post » Fri May 27, 2011 4:15 am

Easy way would be to use SelectPlayerSpell and hold onto the ref returned by GetPlayerSpell. Use GetGameReloaded and just SelectPlayerSpell playerloadedspell or something like that.
User avatar
Enie van Bied
 
Posts: 3350
Joined: Sun Apr 22, 2007 11:47 pm

Post » Fri May 27, 2011 5:55 am

ok, turns out that scrolls give this :

-NO NAME-

for SpellLoaded.

ALL scrolls! :(

But at least it gives me one "trick" to know if the spell is a scroll or not.
Still not going to help me in the way I wanted in my particular situation.
User avatar
Steven Hardman
 
Posts: 3323
Joined: Sun Jun 10, 2007 5:12 pm

Post » Fri May 27, 2011 1:27 pm

I am worried this is going to turn into a duplicate thread of my question on the Constructions set threads.

http://www.gamesas.com/bgsforums/index.php?showtopic=1059079&pid=15378499&st=0&#entry15378499


So I think I may ask the moderator to lock this now as my questions was answered (the OBSE command is not doing what I need it to right now).

Thanks Reneer and Critterman and everyone for clearing this up.
User avatar
Michael Korkia
 
Posts: 3498
Joined: Mon Jul 23, 2007 7:58 pm


Return to IV - Oblivion