Frictional Games Forum (read-only)

Full Version: What is this-> (string &in asParent, string &in asChild, int alState)?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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!
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
}
(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)
(12-10-2012, 08:55 PM)4WalledKid Wrote: [ -> ]
(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)
AddUseItemCallback("", "Itemname", "EntityUsed", "FUNC", true);

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
(12-10-2012, 09:01 PM)The chaser Wrote: [ -> ]AddUseItemCallback("", "Itemname", "EntityUsed", "FUNC", true)...
Thank you very much! Big Grin