SeraphTC Posted September 12, 2012 Author Share Posted September 12, 2012 Thanks - I've already tried something similar. The problem is that player.removeitem won't work until the player is the container for the book - at OnRead they are not, so the book doesn't get removed. Your code is a little different to mine though - I'll give it another shot. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted September 12, 2012 Share Posted September 12, 2012 Thanks - I've already tried something similar. The problem is that player.removeitem won't work until the player is the container for the book - at OnRead they are not, so the book doesn't get removed.I didn't even think about that... If it doesn't work, replace "Player" with "Self" and try again Link to comment Share on other sites More sharing options...
SeraphTC Posted September 12, 2012 Author Share Posted September 12, 2012 Nope - afraid not. neither player or self work. :( Looks like I'll need another method. What about if the book isn't a book..... Could I create some sort of item in the game which, when selected, displays a message on the players screen and then disappears? Could I then simply give that object the art asset of a book? Link to comment Share on other sites More sharing options...
IsharaMeradin Posted September 12, 2012 Share Posted September 12, 2012 maybe wrapping the whole process in a quest? gets initiated at game startadvances on book readand when quest stage is equal to after book read stage the quest script removes the book, applies the variable and shuts down the quest so it doesn't try to keep running after the mod has been removed... how to do that, i don't know Link to comment Share on other sites More sharing options...
SeraphTC Posted September 13, 2012 Author Share Posted September 13, 2012 Thanks for the suggestion, but I'd really rather avoid using a quest. I want to keep it really clean and simple. I'll see if I can figure something out with a trigger or spellbook. I'll update here in case anyone is interested. I'd still appreciate any ideas or suggestions anyone can offer :) Link to comment Share on other sites More sharing options...
SeraphTC Posted September 13, 2012 Author Share Posted September 13, 2012 I've made some progress! Scriptname STCAS_AncientNordSmithingSkillBook extends ObjectReference GlobalVariable Property STCAS_CraftAncientNord Auto Event OnRead() stcas_craftancientnord.setvalueint(1) debug.messagebox("Read by Player") disable() delete() EndEvent When the player opens the book it still opens, and the messagebox is still displayed. If the user puts the book down, then it gets removed (perfect!). Now I can probably write something to have it do the same on container change, but what I'd prefer is that it worked like a spell book. ie, the player doesn't have the option to read, only to pickup, and when they read it the book is removed from the inventory and *something* happens. I'm pretty sure the onequip function is called when an item is clicked on in the inventory, but using player.removeitem doesn't work when a book is being read, and that's the default function for books with onequip, unless they are set to teach a spell. I guess what i need to figure out how to do is recreate a spell book with a script? Still working on this.... Again, I'd appreciate any input anyone can offer! Thanks! Link to comment Share on other sites More sharing options...
SeraphTC Posted September 13, 2012 Author Share Posted September 13, 2012 Ok - I'm making my life easy and blagging it. I've pasted an absolute load of meaningless gibberish into the book text, formatted it and changed the font to draconic. Now I don't have to worry about the book being read and needing to remove it :D Thanks for the suggestions :) Link to comment Share on other sites More sharing options...
IsharaMeradin Posted September 13, 2012 Share Posted September 13, 2012 ROFL!!!!!!!!!!!!!!!!!! Just toss a script onto one or all of your custom pieces that does this... when equipped looks to see if the book is present in the player's inventoryIf book is present, remove it.if book is not present, skip this event don't put the script on default items, only on your custom stuff. so might be possible for the book to remain, but also possible for it to disappear :P Link to comment Share on other sites More sharing options...
SeraphTC Posted September 13, 2012 Author Share Posted September 13, 2012 ROFL!!!!!!!!!!!!!!!!!! Just toss a script onto one or all of your custom pieces that does this... when equipped looks to see if the book is present in the player's inventoryIf book is present, remove it.if book is not present, skip this event don't put the script on default items, only on your custom stuff. so might be possible for the book to remain, but also possible for it to disappear :P hehe - I tried that already. When the item is a book it will open to be read. Whilst it's open you can't remove it from the inventory using removeitem or disable()/delete(). As soon as you click the book in the inventory it calls onread prior to calling onequip. The only way that I can see to do it would be to either have an item that is *not* a book but uses the art for one (but then it won't appear in the correct inventory page), or to recreate part of the method for teaching spells. You'll notice that with a spell book you don't have the option to read it. You can pick it up, and you can click it in the inventory, but it never goes into the OnRead state (it doesn't 'open' on the screen). I had a thought about doing this, and I've inquired in a few places to see if it's possible, but I've not managed to get a straight answer yet :) I think it might be more hassle than it's worth at this point. The draconic text and a message box description is seemless and it works within the context of what I want the book to do. I'll probably just stick with it - it's nice and simple :) Link to comment Share on other sites More sharing options...
IsharaMeradin Posted September 14, 2012 Share Posted September 14, 2012 no no no you missed it. I said put the script on one of the custom pieces of armor I left off the "of armor" initially Link to comment Share on other sites More sharing options...
Recommended Posts