Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Making your own functions
Bridge Offline
Posting Freak

Posts: 1,971
Threads: 25
Joined: May 2012
Reputation: 128
#9
RE: Making your own functions

(06-21-2013, 06:10 PM)Adrianis Wrote:
(06-21-2013, 05:49 PM)Bridge Wrote: You're referring to function overloading, right?

Not exclusively no, although that's one (probably more common) usage


Check out this post in this thread
http://www.frictionalgames.com/forum/thr...#pid193591

That's the kind of thing you can do by defining your own functions, the code bit is what's relevant, much of the explanation was to do with the topic at hand which was to do with reference parameters, which no one really need to worry about Tongue

Defining your own functions can be incredibly useful but it is very rarely necessary

I can't say in the case of Amnesia scripting because I don't actually do it but I don't think I've ever written a program without defining a single function. If a piece of code is repeated more than twice verbatim (or the only discrepancies are the values used) then defining a function for it is smart IMO. It saves a whole bunch of space (unless it's an inline function) and is much cleaner to read IMO.

Out of curiosity, why do you consider it to be rarely necessary in the case of Amnesia?
06-21-2013, 06:26 PM
Find


Messages In This Thread
Making your own functions - by Theforgot3n1 - 06-21-2013, 03:47 PM
RE: Making your own functions - by lizardrock17 - 06-21-2013, 04:02 PM
RE: Making your own functions - by DeAngelo - 06-21-2013, 04:30 PM
RE: Making your own functions - by richm0nkey - 06-27-2013, 07:28 AM
RE: Making your own functions - by ClayPigeon - 06-21-2013, 04:57 PM
RE: Making your own functions - by Theforgot3n1 - 06-21-2013, 05:08 PM
RE: Making your own functions - by Adrianis - 06-21-2013, 05:43 PM
RE: Making your own functions - by Bridge - 06-21-2013, 05:49 PM
RE: Making your own functions - by Adrianis - 06-21-2013, 06:10 PM
RE: Making your own functions - by Bridge - 06-21-2013, 06:26 PM
RE: Making your own functions - by Adrianis - 06-21-2013, 06:42 PM
RE: Making your own functions - by Bridge - 06-21-2013, 07:26 PM



Users browsing this thread: 2 Guest(s)