Talk:Function Reference

From the CreationKit Wiki
Jump to navigation Jump to search

Calling Global Functions[edit source]

The examples show how to DEFINE a global function, but not how to CALL one. --RedwoodElf 05:55, 13 February 2012

First, please sign your contributions to Talk pages with ~~~~ to add a signature and timestamp. This helps us keep track of who says what.
Second, please put your new questions in their own header, surrounded by == on either side.
I have done both of these for you here.
As for your question, it certainly does show how to call one, here. Note that the term "global" here is misleading; what they're talking about would usually be thought of as a static method. This means that you still need an identifier indicating where the function is, since it is not truly "global".
I'm thinking the terminology here ought to be changed.
Dragoon Wraith TALK 09:27, 13 February 2012 (EST)

Self Discussion[edit source]

The long discussion of "self" on this page is very confusing. The first thing I'm going to do is remove all of the "jokes," since they make no sense and aren't actually funny. However I would appreciate it if somebody else could make the discussion more accessible because honestly I have read it a dozen or so times and it's still incomprehensible to me. Here is the crucial information that I feel needs to be here:

"Self" typically refers to the object that is executing the script.
"Self" is often assumed if no object is specified for the function. For example, "setstage(5)" in a script attached to a quest will set the calling quest to stage 5 and is identical to saying "self.setstage(5)", while "someOtherQuest.setstage(5)" will of course set a different quest to stage 5.
"Self" can be changed (?? Or at least I think it can? This one of the parts of the discussion that is really difficult to follow.)

Each item should have examples that are set out in the typical style of this wiki, not embedded in the text so that they become convoluted and difficult to follow.

I sense that if I had a degree in computer science or formal training in code writing, the conversation might make more sense to me. But if I had either of those things, would I really need it explained to me on a wiki? Lofgren (talk) 15:46, 15 January 2013 (EST)

Honestly, I'm not sure it belongs here at all. It seems to me that self deserves its own page.Lofgren (talk) 16:32, 15 January 2013 (EST)