Difference between revisions of "Talk:Enable - ObjectReference"
Talk:Enable - ObjectReference (edit)
Revision as of 21:34, 21 November 2012
, 21:34, 21 November 2012→Parentheses Must Be Left Blank
imported>HawkFest |
imported>Cipscis |
||
Line 9: | Line 9: | ||
:Nope I've tested it myself and it's a plain fact. Don't use anything between parenthesis (leave blank) when the reference is of type Light, else it won't do anything even though it compiles ok. Which doesn't mean to get rid of parenthesis btw if I read correctly, they're still mandatory... | :Nope I've tested it myself and it's a plain fact. Don't use anything between parenthesis (leave blank) when the reference is of type Light, else it won't do anything even though it compiles ok. Which doesn't mean to get rid of parenthesis btw if I read correctly, they're still mandatory... | ||
:--[[User:HawkFest|HawkFest]] ([[User talk:HawkFest|talk]]) 21:25, 21 November 2012 (EST) | :--[[User:HawkFest|HawkFest]] ([[User talk:HawkFest|talk]]) 21:25, 21 November 2012 (EST) | ||
:: Sorry, I misspoke when I said "without parentheses". Like you guessed, I meant "with empty parentheses". The point I made still stands, though. For example, here is an example script showing various ways in which Enable can be called on an ObjectReference variable: | |||
<source lang="papyrus">ScriptName Test | |||
ObjectReference rLight | |||
Function Foo() | |||
rLight.Enable() | |||
rLight.Enable(true) | |||
rLight.Enable(false) | |||
EndFunction</source> | |||
:: When I compile this function, here is the output (in Papyrus assembly) for the function "Foo": | |||
<pre> .function Foo | |||
.userFlags 0 | |||
.docString "" | |||
.return NONE | |||
.paramTable | |||
.endParamTable | |||
.localTable | |||
.local ::nonevar none | |||
.endLocalTable | |||
.code | |||
CALLMETHOD Enable rLight ::nonevar false ;@line 6 | |||
CALLMETHOD Enable rLight ::nonevar true ;@line 7 | |||
CALLMETHOD Enable rLight ::nonevar false ;@line 8 | |||
.endCode | |||
.endFunction</pre> | |||
:: As you can see, lines 6 and 8 compile to be absolutely identical - the game could not tell them apart even if it wanted to. | |||
:: Would you mind elaborating on exactly how you tested this? I'm curious as to how you could have achieved that result. Unfortunately, although I usually have access to the Papyrus compiler and assembler, I don't often have the opportunity to actually test things in Skyrim. | |||
:: -- [[User:Cipscis|Cipscis]] ([[User talk:Cipscis|talk]]) 21:34, 21 November 2012 (EST) |