ShylaEighteen Posted August 15, 2008 Share Posted August 15, 2008 So TES Construction Set has a checkable "pc start spell" box, but it never works. how do i get my spell to my character? it's not a new animation, basically just an enhanced flame spell, then an enhanced lightening and etc. i don't want to replace them with a spell already made because i don't want any npc's getting a hold of them. I know how to set items into an npc's items inventory for sale or in their self use inventory, but how would i put it into my inventory or into an npc's inventory that i can buy from them. any and all HELP is greatly appreciated. Link to comment Share on other sites More sharing options...
quistena Posted August 15, 2008 Share Posted August 15, 2008 Hello, ShylaEighteen. I once experienced the same problem as yours. It seems that "pc start spell" doesn't work perfectly, or at least I guess so. Therefore, some other methods would be nice. I would suggest the followings. Method 1 (Console):It is possible to add your spell to your character's spell list through console. Method 2 (Vendor):Since you already know how to set items into an NPC's inventory, how about adding the spell into the spell list of an NPC who can sell spells? For NPCs can sell spells that they can use. I would recommend you to add the spell to an exsisting spell-merchant if you will do. As you may already know, the "Spell List Tab" lies near the "Inventory Tab" in the window to edit an NPC. You can set spells into an NPC's spell list by Drag & Drop as you set items. Method 3 (Script):The script can add spells to the spell list of a PC/ an NPC. The following is an altered script of my own mod. This script allows a PC/an NPC to learn a spell automatically when he/she has the object to which this script is attached. XXXXXX is the ID of the object. (e.g. a book. Actually any object will do if they can be carried)YYYYYY is the ID of the spell that you wish to add. ---------script--------Begin gamemode ref npc set npc to GetContainer if(npc.GetItemCount XXXXXX>0) npc.addspell YYYYYY endifEnd---------script-------- For example:1. Create a new book by changing the ID of an existing book and saying Yes to the question that asks if you wish to create a new form.2. Open the script-editer and copy and paste the above script. Then, replace XXXXXX with the book's ID and replace YYYYYY with the spell's ID that you wish to add.3. Attach the script to the book.4. Set the book any place you like with Render Window.5. Get the book in your game. When you take the book in you game, your character will learn the spell automatically. After your character learns, the book won't be needed any longer. Wish at least one of the above methods could be of any help to you. Good luck. :) EDIT1 : Some misspells in the above have been corrected, sorry.EDIT2 : Some information has been added. Link to comment Share on other sites More sharing options...
ShylaEighteen Posted August 15, 2008 Author Share Posted August 15, 2008 thank ya much, i think this answer was perfect. Link to comment Share on other sites More sharing options...
gurka Posted August 15, 2008 Share Posted August 15, 2008 The Pc Start Spell adds the spell to the player if he/she has chosen the school for the spell in his/her classActually you could make a new quest and use this script: step 1.Open the quest window and create a new quest.name it 1AddMySpellsToPlayerQuestMake sure that the Start Game Enabled is checked step 2.open the scriptedit window and make a new script.then paste this script into the scripteditbox. ========== Script ======== scn 1AMSTPQScript Begin GameMode Player.addspell spellID ;The spellID Should be the editor Id of your spellStopquest 1AddMySpellsToPlayer End ======================= Step 3. Open 1AddMySpellsToPlayerQuest in the quest window.Then add 1AMSTPQScript to the quest Step 4. Save your mod. Step 5. Play the game with your mod and the spell will be added to the player after a few seconds. Link to comment Share on other sites More sharing options...
nosisab Posted August 15, 2008 Share Posted August 15, 2008 I shall alert against using Begin GameMode whenever possible in scripting. not good idea a script running at each frame for nothing. In the book's case, like items in general, better would be using combinations of OnAdd/OnDrop/OnEquip/OnUnequip blocks. But being books from the activators type this feature can be used so the effect will be given when it is read instead just picked. There are some issues with OnActivate blocks than users must be aware before using them (The Wiki documentation is something all interested in modding shall read). Example: books with scripts using OnActivate loses the default activation characteristic being impossible reading it a second time. A modder need to care about this if rereading the book is needed, but he can simply "disable" the book simulating it disappearing after being used. Or make the effect itself a spell and placing it into a scroll that is wasted after being cast. Link to comment Share on other sites More sharing options...
quistena Posted August 16, 2008 Share Posted August 16, 2008 thank ya much, i think this answer was perfect.It's okay. Glad to hear that helped you. :) By the way, Nosisab is right. We shouldn't use the "Begin Gamemode" block too much. So, I've got to suggest another script. The script in my previous post can teach a spell to an NPC, and by adding some more lines, you can remove the spell when the book is removed. In short, a person who has the book can use the spell. But if you wish to give the spell to only a player character, the following script will do simply. When you take the book, your character will learn the spell, and this script won't run any longer as long as you don't take it again. As Nosisab told us, it would be even better. Thank you, Nosisab. :) ------Script-------Begin OnAdd playerplayer.addspell YYYYYYEnd------Script------- YYYYYY is the ID of the spell that you wish to add. I forgot to write the script name, so name the script name you like, and choose it in attaching it to the book. In the following example, "AddSpellScript" is the script name. ------Script-------scn AddSpellScriptBegin OnAdd playerplayer.addspell YYYYYYEnd------Script------- Thank you all. :) Link to comment Share on other sites More sharing options...
gurka Posted August 16, 2008 Share Posted August 16, 2008 I shall alert against using Begin GameMode whenever possible in scripting. not good idea a script running at each frame for nothing. In the book's case, like items in general, better would be using combinations of OnAdd/OnDrop/OnEquip/OnUnequip blocks. But being books from the activators type this feature can be used so the effect will be given when it is read instead just picked. There are some issues with OnActivate blocks than users must be aware before using them (The Wiki documentation is something all interested in modding shall read). Example: books with scripts using OnActivate loses the default activation characteristic being impossible reading it a second time. A modder need to care about this if rereading the book is needed, but he can simply "disable" the book simulating it disappearing after being used. Or make the effect itself a spell and placing it into a scroll that is wasted after being cast. I thought that the stopquest function made so that the quest wouldn't run on every frame.It seems that I've still got a lot to learn. Thank you noisab! Link to comment Share on other sites More sharing options...
LoginToDownload Posted August 16, 2008 Share Posted August 16, 2008 I thought that the stopquest function made so that the quest wouldn't run on every frame.I'm almost certain that StopQuest does stop the script running. Incidentally, Quest GameMode scripts only run every five seconds unless otherwise specified, not every frame. Example: books with scripts using OnActivate loses the default activation characteristic being impossible reading it a second time. A modder need to care about this if rereading the book is needed, but he can simply "disable" the book simulating it disappearing after being used. Or make the effect itself a spell and placing it into a scroll that is wasted after being cast.You can still activate it normally via the "Activate" scripting function. For example, a door/container/actor/item with a script that goes... Begin OnActivate ref opener set opener to GetActionRef activate opener end...would still work perfectly normal when being activated. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.