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

Jump to navigation Jump to search
134 bytes added ,  19:05, 7 September 2013
m
See Also headline added
imported>Ereksen
m
imported>Scrivener07
m (See Also headline added)
 
Line 4: Line 4:
Acclimating to [[:Category:Papyrus|Papyrus]] can be a difficult process - this page is here to help!  The goal of this page is to collect the most common stumbling blocks and hurdles we all encounter when trying to work with Papyrus scripts, especially early on.   
Acclimating to [[:Category:Papyrus|Papyrus]] can be a difficult process - this page is here to help!  The goal of this page is to collect the most common stumbling blocks and hurdles we all encounter when trying to work with Papyrus scripts, especially early on.   


=FAQ=
Your contributions matter!  If you've found a way around some sticking point, please add to this FAQ.  Links are strongly encouraged here as are code fragments to demonstrate what you're talking about.
Your contributions matter!  If you've found a way around some sticking point, please add to this FAQ.  Links are strongly encouraged here as are code fragments to demonstrate what you're talking about.


=FAQ=
 


==General==
==General==
===My Script compiles, but doesn't work!  How can I debug this?===
===My Script compiles, but doesn't work!  How can I debug this?===
When you begin working with Papyrus, you'll want to activate script logging.  This feature is disabled by default - most users don't need it, and logging consumes a small amount of your PC performance in-game.   
When you begin working with Papyrus, you'll want to activate script logging.  This feature is disabled by default - most users don't need it, and logging consumes a small amount of your PC performance in-game.   
Line 66: Line 66:
(GetLinkedRef() as Actor).IsInFaction(BanditFaction)
(GetLinkedRef() as Actor).IsInFaction(BanditFaction)
</source>
</source>


==Items==
==Items==
===I can't remove an item from a player===
===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.
*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.
Line 74: Line 75:
===I can't get a script to run on an item, and I'm sure that the script works properly===
===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]].
*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==
=== I Cannot create a new object ===
=== I Cannot create a new object ===
*Problem: I can't create a new object.
*Problem: I can't create a new object.
Line 86: Line 88:
*Explanation: Casting will only work if the reference casted actually has its script attached. For instance, the TestReference base object needs to have the TestReference script attached in the editor form window for it to be castable from ObjectReference to TestReference.
*Explanation: Casting will only work if the reference casted actually has its script attached. For instance, the TestReference base object needs to have the TestReference script attached in the editor form window for it to be castable from ObjectReference to TestReference.
*Solution: Use the editor and attach the script to the object you're actually casting. For instance, if TestReference is supposed to refer to a book, open up the book you want to cast in the editor window, goto the scripts section, and attach the TestReference script from there.
*Solution: Use the editor and attach the script to the object you're actually casting. For instance, if TestReference is supposed to refer to a book, open up the book you want to cast in the editor window, goto the scripts section, and attach the TestReference script from there.


==Quests==
==Quests==
===I can't get my alias to point to a reference ===
===I can't get my alias to point to a reference ===
*Several possibilities here:
*Several possibilities here:
Line 104: Line 107:
**'''You may need to rename the script to get the Properties window to work. Go to the "Advanced" tab and click "Rename Script" and give it a new name.'''
**'''You may need to rename the script to get the Properties window to work. Go to the "Advanced" tab and click "Rename Script" and give it a new name.'''
**Click on the properties window on the lower right side (next to TIF_ or whatever name you gave the script) to add the new property.
**Click on the properties window on the lower right side (next to TIF_ or whatever name you gave the script) to add the new property.
=See Also=
*[[Papyrus Compiler Errors]]
*[[Papyrus Runtime Errors]]
*[[INI Settings (Papyrus)]]
*[[Console_Commands_(Papyrus)]]


{{Languages}}
{{Languages}}
[[Category:Papyrus]]
[[Category:Papyrus]]
[[Category:Solutions]]
[[Category:Solutions]]
Anonymous user

Navigation menu