The meaning of Parameters - 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 Articles (https://www.frictionalgames.com/forum/forum-40.html) +---- Thread: The meaning of Parameters (/thread-18368.html) Pages:
1
2
|
The meaning of Parameters - FlawlessHappiness - 09-16-2012 Have you ever wondered what it is when people talk about a parameter? Don't you know how it works? Well, I'll tell you. A parameter is the little amount of text inside these ( Parameter) They always come after: void function() <-- parameter goes in here parameters are used to specify what kind of callback you want. Here are some common examples: AddEntityCollideCallback Colliding = (string &in asParent, string &in asChild, int alState) Spoiler below!
Interacting = (string &in asEntity) Spoiler below!
Use Item = (string &in asItem, string &in asEntity) Spoiler below!
Look-at function = (string &in asEntity, int alState) Spoiler below!
CheckPoint Checkpoint function = (string &in asName, int alCount) Spoiler below!
Timer function = (string &in asTimer) Spoiler below!
SetEntityCallbackFunc = (string &in asEntity, string &in asType) Spoiler below!
If you don't know what an if-statement is then you should check that out first, because that will make your scripting even better! I will give you some function examples for each of the codes i have listed above: AddEntityCollideCallback("Player", "ScriptArea_1", "CollideFunction", true, 0); Spoiler below!
Spoiler below!
AddUseItemCallback("", "Item_1", "ScriptArea_1", "UseItemFunction", true); AddUseItemCallback("", "Item_2", "ScriptArea_1", "UseItemFunction", true); Spoiler below!
Spoiler below!
**Also notice that I am calling 2 timers. The first is called in 5 seconds. The second is called in 10 seconds. Both of them is calling the same function, but they have different asName** AddTimer("Timer_1", 5, "TimerFunction"); AddTimer("Timer_2", 10, "TimerFunction"); Spoiler below!
SetEntityCallbackFunc("candle_1", "CallbackFunction"); Spoiler below!
RE: The meaning of Syntaxes - Your Computer - 09-16-2012 Note: Syntax is the rules of the language. While parameters and arguments concern syntax, syntax is not limited to just that. RE: The meaning of Syntaxes - nemesis567 - 09-16-2012 Do you even know the meaning of the word Syntax? Quote:A syntax(...)---- RE: The meaning of Syntaxes - Melvin - 09-16-2012 Thanks for this information! RE: The meaning of Syntaxes - FlawlessHappiness - 09-16-2012 (09-16-2012, 05:01 PM)nemesis567 Wrote: Do you even know the meaning of the word Syntax?No i do not know the precise definition of the word "Syntax", but since i couldn't find any thread about these, and more and more people have been asking about this, i felt i should do something. Thats why i made this. And so what if they use the wrong word in a wrong context, as long as people understand each other, and they are only making custom stories for fun! I just wanted to make a tutorial that was easy to understand. RE: The meaning of Syntaxes - nemesis567 - 09-16-2012 Avoiding any further conflict I must say that from the two ways of learning something, it's quite better to use the plain rock one, instead of walking over sand. RE: The meaning of Syntaxes - FlawlessHappiness - 09-16-2012 Yea, you might be right That was also how i learned it... But there is just people out there who takes a bridge at one place, copy it, and then crosses the hole without knowing what they did, why they get an error, or why it doesnt work I understand what you mean And if i did a bad thing, i am sorry RE: The meaning of Syntaxes - nemesis567 - 09-17-2012 You didn't do a bad thing if you felt you did the right thing. RE: The meaning of Syntaxes - FlawlessHappiness - 09-17-2012 No that sounds about right RE: The meaning of Syntaxes - The chaser - 11-26-2012 (09-16-2012, 07:47 PM)beecake Wrote: Yea, you might be right That was also how i learned it... But there is just people out there who takes a bridge at one place, copy it, and then crosses the hole without knowing what they did, why they get an error, or why it doesnt work I understand what you mean And if i did a bad thing, i am sorrySorry for bumping this, but I felt that I had to do it: This post has the smiley : ) amount record. |