Category talk:Functions


Revision as of 18:49, 4 February 2009 by SnakeChomp (Talk | contribs) (Functions or Methods)

Syntax differences

Looking at all the different function pages, one thing I can't help but notice is that, depending on who added the information, many functions seem to have different syntax - especially reference functions. Not only are some reference functions missing their reference syntax entirely, but a lot of them have small inconsistencies as well, for example:

[ActorID|ContainerID.]AddItem ObjectID, Count, MessageHiddenFlag

In these examples, ActorREF and ActorID mean the same thing. This may not be so clear, however, to some people - especially those still new to the syntax used in Fallout 3.

Parameter syntax is also not consistent. While I realise that various different methods can be used (e.g. commas/no commas), I think the Wiki should probably have this standardised as well. Here are some examples of inconsistencies:

[ActorREF].SexChange [0/1]
[ActorREF].SetUnconscious ''0/1''
SetPCYoung 0/1
[ActorID.]UnEquipItem ObjectID NoEquipFlag HideEquipMessage
ShowMessage MessageID, [var1], ..., [var9]

I think it wouldn't be a bad idea to get, if not a completely standardised syntax for use in the Wiki, then at least guidelines in order to reduce possible confusion. If this happened, I'd volunteer to change/add function syntaxes to fit a standard/guidelines.
-- Cipscis 07:58, 15 January 2009 (UTC)

I agree. I'm trying to get into modding but with some of these inconsistencies I'm getting pretty confused. I'm assuming [ActorWhatever.] means an actor object reference. So ActorREF and ContainerREF, when applicable, make the most sense (though I might squabble over the capitalization).
TastyWheat (talk - contribs) 17:26, 4 February 2009 (UTC)
A little while after I made that "post", I noticed this page - Template:Function. It looks like that's the way to go for consistency.
-- Cipscis 21:16, 4 February 2009 (UTC)

Functions or Methods

I'm probably just splitting hairs here, but since most of these "functions" require a preceding object reference doesn't that make these methods instead of functions? Yes, the preceding object reference (i.e. ActorREF) is often optional, making them behave like functions, but they are still associated with an object (the Player in those cases). I know most of you are used to this terminology, but newcomers with programming experience may learn faster if the proper terms were used.
TastyWheat (talk - contribs) 17:49, 4 February 2009 (UTC)

These "Methods" are usually referred to as Reference functions. As stated in the article, reference syntax is optional in reference scripts as if it is absent it is implied that the scripted reference is the calling reference.
-- Cipscis 21:16, 4 February 2009 (UTC)
Far be it from me to correct the official lingo, I just think "method" is more technically correct.
TastyWheat (talk - contribs) 22:44, 4 February 2009 (UTC)
Method is typically used to refer to a member function in an object oriented system, but what is the "more correct" term depends on the language. In Java they are methods for sure, but in C++ they are more correctly called member functions.
Anyway, Fallout scripts aren't object oriented at all. The ref.Function args syntax is shorthand for Function args ref, and in fact some functions do not support the ref.Function syntax and instead require use of the Function ref syntax. So, method isn't really accurate here.
--SnakeChomp 23:00, 4 February 2009 (UTC)
"Method" only really applies in a truly Object-Oriented language, where the functions are part of the class. These functions are not - they are functions, and the supplied reference is really just a strangely-indicated argument. It's done for parallelism with OO programming (specifically C++), but since this is not actually C++, the term "Method" does not really apply (though at least the C++ text/class that I had claimed "Methods" and "Member Functions" meant the same thing, though SnakeChomp may know something that I don't). Regardless, calling them Functions has been the custom since Morrowind, and that's not changing now for any reason, even if it's a good one. Too much to change and too many people would be confused.
DragoonWraith · talk · 23:11, 4 February 2009 (UTC)
For all reasonable intents and purposes, method and member function are synonymous. You'll occasionally find a few people online who will give you a hard time using method to talk about C++ functions, but it really doesn't matter which term is used.
--SnakeChomp 23:49, 4 February 2009 (UTC)
Personal tools