Difference between revisions of "Template talk:Function"

From the Fallout3 GECK Wiki
Jump to navigation Jump to search
imported>DragoonWraith
imported>TastyWheat
Line 44: Line 44:
:I changed the template today so that if returnType is set to "void" nothing will be shown for return information as opposed to (void) appearing. If it is omitted an error will still be shown though. I don't think its necessary to explicitly show (void) or () or anything at all when the function has no return value. The fact that nothing is shown for return value (and the summary won't say anything about a return value either) should be enough indication that it doesn't return a value.
:I changed the template today so that if returnType is set to "void" nothing will be shown for return information as opposed to (void) appearing. If it is omitted an error will still be shown though. I don't think its necessary to explicitly show (void) or () or anything at all when the function has no return value. The fact that nothing is shown for return value (and the summary won't say anything about a return value either) should be enough indication that it doesn't return a value.
:--[[User:SnakeChomp|SnakeChomp]] 00:24, 31 January 2009 (UTC)
:--[[User:SnakeChomp|SnakeChomp]] 00:24, 31 January 2009 (UTC)
::I can't say I'm crazy about the return type being surrounded by parenthesis, but if that's what you're all used to I can deal with it.  I do however think void types should be explicitly displayed.  Almost every other programming language explicitly labels void functions as such.<br>
::-[[User:TastyWheat|TastyWheat]] <small>([[User_talk:TastyWheat|talk]] - [[Special:Contributions/TastyWheat|contribs]])</small> 15:47, 9 February 2009 (UTC)


===CategoryList===
===CategoryList===

Revision as of 10:47, 9 February 2009

Testing

I added the template to GetAnimAction. As far as I'm concerned we're ready to put it to use on all function pages.
--Qazaaq 11:20, 16 January 2009 (UTC)

General

Looks pretty nice Qazaaq. I've been working on some ideas and placed them on the other wiki's Syntax page. I've gotta' run so I'll look at this some more later.
--Haama 17:16, 12 December 2008 (UTC)

OK, got to look at it a bit more.
  • For the link to the CS wiki page, should we assume that it has the same name (if there is one)? That would be one less field to worry about.
  • We should add a statement about the origin before the syntax, as on the CS wiki.
--Haama 19:56, 12 December 2008 (UTC)
I've divided your answer into sections below with my response. This should be easier to follow.
--Qazaaq 23:16, 12 December 2008 (UTC)
I've created the Sandbox so we can test this out.
--Haama 06:09, 13 December 2008 (UTC)

Discussion about individual fields

CS Wiki link

For the link to the CS wiki page, should we assume that it has the same name (if there is one)? That would be one less field to worry about.
--Haama 19:56, 12 December 2008 (UTC)

There has to be at least one field for CS Wiki link to determine if there has to be one or not. Whether this is a boolean of some sort or the name of the article doesn't matter. Using the article name will allow for more flexibility. When the field is omitted the entire notice is left out.
--Qazaaq 23:16, 12 December 2008 (UTC)

Origin

We should add a statement about the origin before the syntax, as on the CS wiki.
--Haama 19:56, 12 December 2008 (UTC)

There's already a statement for the origin in there. It's just not showing in the example. It will display an error message if it's omitted, the current GECK should be specified with GECK1, FOSE function will probably have room for a version number and display a notice.
--Qazaaq 23:16, 12 December 2008 (UTC)
The Geck1 option was blank, so I filled it out.
--Haama 06:44, 13 December 2008 (UTC)

ReturnVal

Currently, if the return value is omitted this will show an error. If it's left empty it will show the empty braces () Haama suggested at the CS Wiki, if it's filled in it will obviously be filled in. I've chosen to fill in void in the example because I think that's clearer. Any thoughts?
--Qazaaq 23:26, 12 December 2008 (UTC)

I changed the template today so that if returnType is set to "void" nothing will be shown for return information as opposed to (void) appearing. If it is omitted an error will still be shown though. I don't think its necessary to explicitly show (void) or () or anything at all when the function has no return value. The fact that nothing is shown for return value (and the summary won't say anything about a return value either) should be enough indication that it doesn't return a value.
--SnakeChomp 00:24, 31 January 2009 (UTC)
I can't say I'm crazy about the return type being surrounded by parenthesis, but if that's what you're all used to I can deal with it. I do however think void types should be explicitly displayed. Almost every other programming language explicitly labels void functions as such.
-TastyWheat (talk - contribs) 15:47, 9 February 2009 (UTC)

CategoryList

We need something clever for to handle the categories. I'm open to suggestions.
--Qazaaq 23:26, 12 December 2008 (UTC)

This refreshed my memory a bit (still looking through it, though) and may be useful for first timers.
--Haama 23:36, 12 December 2008 (UTC)
Why do we need something clever for categories? I don't see any benefit to putting the [[Category:Foo]] stuff into the template as an arugment when all the template does it repeat what you gave it verbatim. Categories can easily be specified outside of the template at the bottom of the page, which is conventional here, at least in terms of the pages beth created for us.
--SnakeChomp 17:06, 16 January 2009 (UTC)
Categories can be a pain to add, especially when we're talking about FOSE - for Oblivion, we needed one for Functions, another for OBSE Functions, another for the function type (i.e., Actor) and yet another for OBSE function type (i.e., OBSE Actor). The solution doesn't even need to be categories, though. Qzilla and Qazaaq created a Navbox for Projectile functions (again, Oblivion) that worked pretty well. If we can convince Bethesda to add some Javascript we can create Show/Hide/Collapsable boxes that contain a good number of links and let the reader know just what other functions are around.
--Haama 21:27, 19 January 2009 (UTC)

Dot Syntax and OBSE (expected FOSE) functions

Dot syntax is a weird one. For (99% of?) vanilla functions it is required, but the Self reference is assumed for all object (even those in inventory) and magic effect scripts. To make it even stranger, quite a few OBSE functions treat it as "Either...or" and you would have to place a reference record before the function (dot syntax) or place a base record after the function.

Display suggestions - Required/vanilla dot syntax should look the same as a required field. It's closer to a required field (necessary for Quest scripts) than an optional field, and the dot itself should disambiguate it from other required fields. Either...or syntax should also look required, but both the ref and base parameters should have an asterisk next to them.

Template suggestions - The dot syntax should be explicitly be named as such (DotArg as opposed to Arg0). If I've got this right, there are basically three types of dot syntax - None, Normal, Either...or. These three options should be the template parameter input.
--Haama 06:31, 13 December 2008 (UTC)

Function Parameter Types

I still prefer show/hide boxes. These would allow new readers to easily find the information (right on the page) and those who want a reminder to glance at it. More importantly, some of the parameter information is rather long and this would allow readers to easily (and by default) see the rest of the page. Do you think we should ask about them again?

As for the template, I think it would be straight-forward. Each function parameter would have an optional template parameter "Sub-Type". If Sub-Type is filled, then show the template {{Sub-Type}}.

Further expanding on this is not so straight forward (especially when I should be asleep :P). I'm thinking the layout should be

==Parameter Info== Show/Hide
#Parameter 1 Name: Parameter information (i.e., ''RunOnActivate'' runs the script)
Parameter 1 Sub-Type Information Template - Show/Hide


--Haama 06:30, 13 December 2008 (UTC)

This worth considering. Most of the functions don't have a lot of parameters, but hiding parts of the syntax information would be very useful for the larger ones.
--Qazaaq 11:40, 13 December 2008 (UTC)

Displaying the whole page, instead of the summary only

I was interested whether we could set up the rest of the page - the Example, Notes, etc. sections. This would help standardization, etc. So, I simply added

...
{{{summary}}}

==Notes==<!--
...

This does display the Notes section correctly on the page (see Sandbox), however when you edit the section you get the rest of the template

==Notes==<!--

categorization code (needs something clever):
-->
{{{CategoryList|}}}</includeonly>

--Haama 06:48, 13 December 2008 (UTC)

The example section shouldn't be a problem. The rest - maybe it's best to leave that of the template. It's simple enough (only two headers), and adding it to the template complicates things unnecessarily. Leaving it out would also allow for additional section if a function requires them.
--Qazaaq 11:36, 13 December 2008 (UTC)

See Also

Is there a way to shove it to the bottom of the page? (I have tried to find one, but never had any luck). As of now, there's no way to put anything between the example and See Also.
--Haama 20:38, 7 January 2009 (UTC)

Hmm, good point. No, I don't believe there is any way to force it to the bottom. Maybe then See Also should not be part of the template then. As it is the Template seems to do more than I would have it do, personally.
DragoonWraith · talk · 21:15, 7 January 2009 (UTC)
I've removed the See Also from the template.
--Qazaaq 10:55, 16 January 2009 (UTC)

Arguments

I did some playing around today with a Function Argument template to specify arguments instead of a bundle of template parameters and added an arguments parameter to the function template. It spits out its value verbatim, so you can use regular wiki syntax to markup function arguments if necessary. The main reason I experimented with this is that it is easier to maintain the sub template than it is to maintain the 40 arg0-arg9, optarg0-optarg9, arg0type-arg9type and optarg0type-optarg9type parameters. The other important thing about the function template is it will let you specify a set of valid values that you can pass to the argument, which is useful when function arguments take a specific set of values (as PipBoyRadio does, which also has a real world example of using the function argument template).

What do you folks think? I'm not married to the style I ended up with, but that's easy to tweak.
--SnakeChomp 00:22, 31 January 2009 (UTC)

The function arguments are excellent, I especially like the enum-type thing. Something I'm not certain about is having the alias in the Syntax. It's nice to have everything on one Syntax line, but I think it may be confusing. I don't have a better solution, so if no one else has any input on this I think we're done here.
--Qazaaq 17:32, 5 February 2009 (UTC)
Changed the way the alias is handled to give it a separate entry. The way the template gets used remains the same.
I vote "shortname" gets changed to "alias" - it usually is just a shorter name, but at least I seem to recall cases where it was used as a true alias. To be sure, Bethesda's GetSelf/This are true aliases.
DragoonWraith · talk · 20:24, 5 February 2009 (UTC)