OK, what am I doing wrong here?

Post » Thu Jun 21, 2012 8:28 pm

I must be doing something terribly wrong. Thus far, the only script that is currently functional in my mod is one that someone else added; I thought the issue was because of the EditorIDs starting with numerals, but the issue has persisted.

Here's my code, although there's no reason this script shouldn't work. It's from a forum thread:

Scriptname IshtarAddSpellFromBook extends ObjectReferenceSpell Property IshtarInitialSummons AutoEvent OnContainerChanged(ObjectReference newContainer, ObjectReference oldContainer)	 if (newContainer == Game.GetPlayer())		  Game.GetPlayer().AddSpell(IshtarInitialSummons)	 endifEndEvent

http://i.imgur.com/v5elG.jpg my script as attached to my book (which compiled nicely, as you can see) and http://i.imgur.com/RWVhS.jpg the assigned spell property. When I pick up the book in game though, nothing happens! It's not just this script either; when I try to run even a debug.trace on ANY script that I have made (yes, even the tutorial on readable spell tomes that's supposed to provide the function above) no debug window pops up. Scripts I write just aren't running -- I wondered if they were compiling improperly, but they all have .pex files in the folder. Are there additional steps to the scripting process that I've missed? It's just add script that doesn't svck, assign properties, and go, right? What am I doing wrong here?

I'm cursed. :(
User avatar
Yonah
 
Posts: 3462
Joined: Thu Aug 02, 2007 4:42 am

Post » Thu Jun 21, 2012 8:09 pm

Just a quick note, that script would add that spell to the player every single time they pick up the book. So either make sure they can only do it once (One copy, and make it a quest object so it can't be dropped), or add conditions to that like a 'DoOnce' check.

As for why it's not working, I can't say.
User avatar
Anthony Santillan
 
Posts: 3461
Joined: Sun Jul 01, 2007 6:42 am

Post » Thu Jun 21, 2012 9:14 pm

Yeah, I simplified it for demonstrative purposes. The full script has the doOnce and is supposed to advance a quest, but this way everyone sees that it's not an issue with the script and can maybe help troubleshoot.
User avatar
Kayla Keizer
 
Posts: 3357
Joined: Tue Dec 12, 2006 4:31 pm

Post » Thu Jun 21, 2012 11:23 am

OnContainerChanged: Try 'akNewContainer' and 'akOldContainer'?

Or you could use an OnRead event since it's a BOOK form.
Event OnRead()	If !Game.GetPlayer().HasSpell(IshtarInitialSummons)		Game.GetPlayer().AddSpell(IshtarInitialSummons)	EndIfEndEvent

Prefixes: 'a' : Argument :: 'k' : *Constant?

*like in chemistry?
User avatar
Silencio
 
Posts: 3442
Joined: Sun Mar 18, 2007 11:30 pm

Post » Thu Jun 21, 2012 8:52 pm

http://i.imgur.com/XOYDz.jpg

http://i.imgur.com/gkJEs.jpg

And it still isn't doing anything in game. :(


EDIT: I'm absolutely sure that script would work for anyone else (It's not you, JustinOther, it's me!) Do I need to do anything with the book that I placed in the world? I gave it a reference name for awhile but it didn't seem to make a difference. I'm out of ideas.
User avatar
Anna Krzyzanowska
 
Posts: 3330
Joined: Thu Aug 03, 2006 3:08 am

Post » Thu Jun 21, 2012 11:34 pm

Just to be sure, you saved the plugin, right? I've spaced that a few times and been baffled. Otherwise, try removing, then reattaching the script to start with a clean slate? It should work as it is, but...

Edit: In the pic, it looks as though the property is not filled. You should see the http://i.imgur.com/5dbIa.png.
User avatar
Jeremy Kenney
 
Posts: 3293
Joined: Sun Aug 05, 2007 5:36 pm

Post » Thu Jun 21, 2012 8:32 am

I just detached, reattached, re-assigned the spell property, saved the plug-in, and completely closed out the CK. In game, nothing happens (my book is there, but the script doesn't run).

I might have to give up.

EDIT: Maybe I'll make Steam re-download it. The internet blows here in Afghaniland; I wouldn't be surprised if something corrupted over the initial four day download.

Edit 2: No, you can see the spell's FormId in the righthand column. The property just wasn't highlighted for that particular screenshot.

Edit 3: Just doublechecked. Yeah, the dropbox doesn't appear unless the property is clicked/highlighted. Once selected, the spell is there.
User avatar
Emily Rose
 
Posts: 3482
Joined: Sat Feb 17, 2007 5:56 pm

Post » Thu Jun 21, 2012 8:18 pm

my book is there, but the script doesn't run
Had you read the book to fire the OnRead event? If so, put a notification in there to make sure the event is firing.
User avatar
Céline Rémy
 
Posts: 3443
Joined: Sat Apr 07, 2007 12:45 am

Post » Thu Jun 21, 2012 2:24 pm

Yup, read the book and picked it up. I didn't have the spell, so I assumed it didn't fire. I'm out of time for now, but I'll re-initialize the debug tools in my .ini and try to post as many of those results as I can.
User avatar
helen buchan
 
Posts: 3464
Joined: Wed Sep 13, 2006 7:17 am

Post » Thu Jun 21, 2012 9:12 pm

Ahaaaah... I thought the debug tools weren't working because the debug tools didn't give me a popup in game. D'oh! The logs are a bit more enlightening, but I still can't make sense of them.


07:08:24AM] VM is thawing...[06/04/2012 - 07:08:41AM] The OnRead command is here[06/04/2012 - 07:08:41AM] error: No Spell or Shout passed to HasSpellstack:[ (00000014)].Actor.HasSpell() - "" Line ?[ (05003892)].IshtarAddSpellFromBook.OnRead() - "IshtarAddSpellFromBook.psc" Line 8[06/04/2012 - 07:08:41AM] The check to see if the player has the spell is here[06/04/2012 - 07:08:41AM] error: Cannot add a None spell to the actorstack:[ (00000014)].Actor.AddSpell() - "" Line ?[ (05003892)].IshtarAddSpellFromBook.OnRead() - "IshtarAddSpellFromBook.psc" Line 11[06/04/2012 - 07:08:41AM] The player is given the spell


Annnd my code I'm using for this result is as follows:

Scriptname IshtarAddSpellFromBook extends ObjectReferenceSpell Property IshtarInitialSummons AutoEvent OnRead()Debug.Trace("The OnRead command is here")If !Game.GetPlayer().HasSpell(IshtarInitialSummons)Debug.Trace("The check to see if the player has the spell is here")Game.GetPlayer().AddSpell(IshtarInitialSummons)Debug.Trace("The player is given the spell")EndIfEndEvent

It maybe looks like it isn't recognizing the spell property, but I'm doing it the same as all the tutorials I've watched. Selecting the reference/thingy you want from a dropdown menu isn't rocket science! Or maybe I'm just dumb; lemme try this again.

EDIT: No, that can't be the problem...
User avatar
Danial Zachery
 
Posts: 3451
Joined: Fri Aug 24, 2007 5:41 am

Post » Thu Jun 21, 2012 10:28 am

[06/04/2012 - 07:08:41AM] error: No Spell or Shout passed to HasSpell
[06/04/2012 - 07:08:41AM] error: Cannot add a None spell to the actor

Though it may look like your properties are filled - the above says they are not...
User avatar
Antony Holdsworth
 
Posts: 3387
Joined: Tue May 29, 2007 4:50 am

Post » Thu Jun 21, 2012 10:26 pm

http://i.imgur.com/MxNKZ.png That property has been filled. I don't know how else to fill it; is there another way?
User avatar
Cayal
 
Posts: 3398
Joined: Tue Jan 30, 2007 6:24 pm

Post » Thu Jun 21, 2012 12:21 pm

Do you know that the spell works; if you add it to the player via console (player.addspell ), does it appear and work as expected?
User avatar
Cool Man Sam
 
Posts: 3392
Joined: Thu May 10, 2007 1:19 pm

Post » Thu Jun 21, 2012 9:28 pm

it works when I add it via a spellbook; and by that, I mean the CK's built in "this book teaches this spell." I'll try and add it via FormID.

EDIT: The console command "player.addspell 01002DC8" does NOT work (the script doesn't compile?), but when added by the CKs spellbook mechanism, the spell is added and works just fine. Is the game not seeing the FormID?
User avatar
bonita mathews
 
Posts: 3405
Joined: Sun Aug 06, 2006 5:04 am

Post » Thu Jun 21, 2012 7:31 am

The first two digits should correspond to your mod's load order, so I don't think they can be "01" (I think skyrim.esm itself is generally 01 and update.esm would be 02).

That said, if the spell does work by spellbook then I doubt the spell is the problem. Hmm.

Totally random suggestion, but have you tried dropping the book and picking it up again, then reading it?
User avatar
daniel royle
 
Posts: 3439
Joined: Thu May 17, 2007 8:44 am

Post » Thu Jun 21, 2012 8:33 pm

That didn't work, either.

How would I go about changing the Form Id (and more importantly, could this be my problem)? I thought that it was automatically generated.

EDIT: OK, I understand the FormId prefix conventions now. The spell added to my player when I used the console command correctly. Since the spell itself is functional, and the game is able to recognize the Form Id, that's probably not the problem then. :(
User avatar
Romy Welsch
 
Posts: 3329
Joined: Wed Apr 25, 2007 10:36 pm

Post » Thu Jun 21, 2012 12:16 pm

You shouldn't need to change the form ID; as I said, if the spell demonstrably works, then that isn't the problem. (They are automatically generated, so the only way to change a form ID would be to re-create a new copy of the spell in the CK. However the first two digits are not auto-generated--rather, they correspond to your mod's place in the load order. This can be different in-game vs. in the CK.)
User avatar
Jinx Sykes
 
Posts: 3501
Joined: Sat Jan 20, 2007 11:12 pm

Post » Thu Jun 21, 2012 9:56 pm

Could be your skyrim is not up to date.

If it was, the formid for your spell would be 02xxxxxxx assuming your mod loaded immediately after update.esm.

00 = Skyrim.esm
01 = Update.esm
02 + = mod indexes

As far as I know, mods created with the CK do not work with pre 1.3 versions of skyrim.
User avatar
Cheville Thompson
 
Posts: 3404
Joined: Sun Mar 25, 2007 2:33 pm

Post » Thu Jun 21, 2012 9:22 am

I re-downloaded the game and an update a little over a month ago. Maybe Steam didn't pick up that I needed another one.

EDIT: Looks like I'm running 1.5.26.0.5. That sounds up to date to me. I was hoping that'd be an easy fix. :(
User avatar
John Moore
 
Posts: 3294
Joined: Sun Jun 10, 2007 8:18 am

Post » Thu Jun 21, 2012 10:53 pm

Yep, you're on the most current non-beta release.
Your issue is perplexing to say the least.
User avatar
Setal Vara
 
Posts: 3390
Joined: Thu Nov 16, 2006 1:24 pm

Post » Thu Jun 21, 2012 5:10 pm

If you can upload your mod-in-progress somewhere like 4shared/mediafire/dropbox, I and possibly other folks could give it a try, see if it works for us.
User avatar
Michael Russ
 
Posts: 3380
Joined: Thu Jul 05, 2007 3:33 am

Post » Thu Jun 21, 2012 8:24 am

http://www.speedyshare.com/a8FhR/IshtarPack.7z

The book is in the College of Winterhold's Arcaneum (right side, outside ring, a small stack of books on the floor by a chair). The player is supposed to read the book, which adds the summon spell (and advances the quest, but that's not my main concern right now). The summon spell summons my NPC to the player (this script DOES work, but only because JustinOther kindly fixed my .esp for me in another thread. It was entirely non-functional when I tried to make it work).
User avatar
Myles
 
Posts: 3341
Joined: Sun Oct 21, 2007 12:52 pm

Post » Thu Jun 21, 2012 6:46 pm

I suspect you will be both greatly relieved and strongly annoyed to know that it works fine for me--I read the book, get a notification in the upper left that the Summon Ishtar spell was added, I can see the spell in my spell list, and it casts fine, summoning the dude. No errors in the log:

[06/04/2012 - 01:12:05PM] The OnRead command is here
[06/04/2012 - 01:12:05PM] The check to see if the player has the spell is here
[06/04/2012 - 01:12:05PM] The player is given the spell

So either you have some quest/data corruption in whatever save game you're using to test, or your install is messed up somehow.

Edit: I should add that I'm using the 1.5.26.etc game version as well.
User avatar
luis dejesus
 
Posts: 3451
Joined: Sun Aug 19, 2007 7:40 am

Post » Thu Jun 21, 2012 9:37 pm

OMG

That is relieving/annoying... but at least now I have clear new steps to take to try and fix this. Thank you for checking it out DreamKing, and letting me know that it isn't my fault! I thought I was missing something obvious.

A corrupted install is likely, due to my terrible connection here. Maybe I can avoid the 3-day download though; I'm going to try a new save and and hope it works.

EDIT: It looks like it was my save file. I didn't even think about that possibility; the save I was using was a level 1 character I'd run straight to the college. I feel a bit sheepish now, I've been panicking up and down the forums for days. Thank you again for all your help!
User avatar
Solène We
 
Posts: 3470
Joined: Tue Mar 27, 2007 7:04 am


Return to V - Skyrim