Frictional Games Forum (read-only)
Creating new parameters question - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Creating new parameters question (/thread-22278.html)



Creating new parameters question - PutraenusAlivius - 07-30-2013

So I was learning about creating new functions in the wiki article. Now I was reading about it and I just made a function line like this.
Code:
int FUNCTION(sig 1, sig 2, and so on)
{
}

Like so right? But, how do I know that the new parameter will do exactly what I said, I mean what happens if something's wrong? Is it tested that it'll do exactly what I describe?

NOTE: I haven't test it, in fact I just found them today.


RE: Creating new parameters question - Your Computer - 07-30-2013

The parser (or compiler) will exit with an error if the function is improperly formed or does not exist when called.


RE: Creating new parameters question - Adrianis - 07-30-2013

^ this, but also...
Quote: how do I know that the new parameter will do exactly what I said
The parameter will do what you tell it to do in the logic of the function. Parameters are simply variables of a given type that you provide to the function when you call it, they don't 'do' anything in-and-of themselves
Quote: Is it tested that it'll do exactly what I describe?
You haven't 'described' anything for it to do. When you write some code in the function, you should have a good idea of how to test if it's working