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
Script Help Splitting cycles - best scripting habits.
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#5
RE: Splitting cycles - best scripting habits.

(05-07-2012, 12:35 PM)Cranky Old Man Wrote: Yes, well, say we have an object like a key. If I use an interact callback (with SetEntityPlayerInteractCallback()) and every object already comes with empty CallbackFunc properties, then I would be going against DRY by creating a whole new function without using the one already there.
I've decided to go with interact callbacks, and tie them all together into a single function later, but if this method is somehow deprecated in HPL3 because it wasn't how the developers figured it would be, then I'd have a hard time converting to the next engine.

In the background the game would simply be calling the same functions available to scripts for the CallbackFunc property. I personally recommend doing it all through scripts (for practical reasons), but there's technically little to no difference between how you setup an interaction callback. Nevertheless, the principles i stated apply more for when you're designing something from the ground up. In Amnesia scripting, you're pretty much starting from the middle. However, this is not to say that what one can learn by the DRY and KISS principles can't be applied to Amnesia scripting (e.g. one of the very purposes of functions is to not repeat yourself).

Tutorials: From Noob to Pro
05-07-2012, 12:49 PM
Website Find


Messages In This Thread
RE: Splitting cycles - best scripting habits. - by Your Computer - 05-07-2012, 12:49 PM



Users browsing this thread: 1 Guest(s)