![]() |
[SCRIPT] What is this-> (string &in asParent, string &in asChild, int alState)? - 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: [SCRIPT] What is this-> (string &in asParent, string &in asChild, int alState)? (/thread-19509.html) |
What is this-> (string &in asParent, string &in asChild, int alState)? - 4WalledKid - 12-10-2012 Ok so I've been quite a long time doing scripts for Amnesia but today I discovered that I don't know what void example_function (string &in asParent, string &in asChild, int alState) do in a called function. I know it is necessary to make it work, but why? What doe's it mean? Thanks! RE: What is this-> (string &in asParent, string &in asChild, int alState)? - The chaser - 12-10-2012 Oh, when you make an AddEntityCollideCallback you do this: AddEntityCollideCallback("Player", "ScriptArea", "FUNC", true, 1); void FUNC (string &in asParent, string &in asChild, int alState) ///This means that the player is the parent (the "callbacker") for the ScriptArea (The affected item). The int alState is for the 1, because that 1 means if colliding or leaving the area. The "true" isn't relevant to the function, so we don't put it in the "FUNC". void FUNC (string &in asParent, string &in asChild, int alState) { //Do something because the player collided with the children } RE: What is this-> (string &in asParent, string &in asChild, int alState)? - 4WalledKid - 12-10-2012 (12-10-2012, 08:46 PM)The chaser Wrote: Oh, when you make an AddEntityCollideCallback you do this...Hmm.. I got that one. What about this one? (string &in asItem, string &in asEntity) RE: What is this-> (string &in asParent, string &in asChild, int alState)? - The chaser - 12-10-2012 (12-10-2012, 08:55 PM)4WalledKid Wrote:AddUseItemCallback("", "Itemname", "EntityUsed", "FUNC", true);(12-10-2012, 08:46 PM)The chaser Wrote: Oh, when you make an AddEntityCollideCallback you do this...Hmm.. I got that one. What about this one? void FUNC (string &in asItem, string &in asEntity) { } ////FUNC is called when the item is used in the entity. Basically, the parameters are the information of how does it receive the information, or that I think. This will help you a lot: http://www.frictionalgames.com/forum/thread-18368.html RE: What is this-> (string &in asParent, string &in asChild, int alState)? - 4WalledKid - 12-10-2012 (12-10-2012, 09:01 PM)The chaser Wrote: AddUseItemCallback("", "Itemname", "EntityUsed", "FUNC", true)...Thank you very much! ![]() |