Difference between revisions of "FAQ: My Script Doesn't Work!"

Jump to navigation Jump to search
no edit summary
imported>ScarabMonkey
imported>Jimhsu
Line 53: Line 53:


Skyrim also includes [[:Category:Console_Commands|console commands]] that can help you track down what might be the problem. If your script is attached to a quest, type in “'''[[ShowQuestVars|sqv <quest>]]'''” into the console to get a list of every Papyrus script attached to the quest, and the contents of all its variables and properties. If your script is attached to a reference, target the reference with your mouse while the console is up (or use the “'''[[PickRefByID|prid <reference id>]]'''” command) and then type in “'''[[ShowVars|sv]]'''” to see the same amount of information, but for the reference. (PgUp and PgDown scroll the console output!) If your script is supposed to be registered for update events, type in “dpu” to have the game dump a list of every single updating form to the Papyrus log so you can see if your script is there. Or, if you think your script might actually be stuck inside an infinite while loop, or taking a while to respond, “dps” will dump everything Papyrus is currently doing to the log for your analysis.
Skyrim also includes [[:Category:Console_Commands|console commands]] that can help you track down what might be the problem. If your script is attached to a quest, type in “'''[[ShowQuestVars|sqv <quest>]]'''” into the console to get a list of every Papyrus script attached to the quest, and the contents of all its variables and properties. If your script is attached to a reference, target the reference with your mouse while the console is up (or use the “'''[[PickRefByID|prid <reference id>]]'''” command) and then type in “'''[[ShowVars|sv]]'''” to see the same amount of information, but for the reference. (PgUp and PgDown scroll the console output!) If your script is supposed to be registered for update events, type in “dpu” to have the game dump a list of every single updating form to the Papyrus log so you can see if your script is there. Or, if you think your script might actually be stuck inside an infinite while loop, or taking a while to respond, “dps” will dump everything Papyrus is currently doing to the log for your analysis.
===I can't remove an item from a player===
*If you are using AddItem with a negative value, that does not seem to work (even though it works in the console). Use RemoveItem instead and check for the sign with a conditional.


===My script can't compile and all I'm using is an Editor ID!===
===My script can't compile and all I'm using is an Editor ID!===
Line 70: Line 67:
(GetLinkedRef() as Actor).IsInFaction(BanditFaction)
(GetLinkedRef() as Actor).IsInFaction(BanditFaction)
</source>
</source>
==Items==
===I can't remove an item from a player===
*If you are using AddItem with a negative value, that does not seem to work (even though it works in the console). Use RemoveItem instead and check for the sign with a conditional.
===I can't get a script to run on an item, and I'm sure that the script works properly===
*Adding or renaming new scripts on items that already exist as ObjectReferences in game ''does not work properly''. More details for reading [[Save_File_Notes_(Papyrus)#Scripts|here]].


==Object Creation==
==Object Creation==
Anonymous user

Navigation menu