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 What is this-> (string &in asParent, string &in asChild, int alState)?
4WalledKid Offline
Member

Posts: 107
Threads: 23
Joined: Oct 2012
Reputation: 1
#1
Question  What is this-> (string &in asParent, string &in asChild, int alState)?

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!

[Image: 4walledkidbanner_zps1514b7f6.png]
12-10-2012, 08:39 PM
Website Find Reply
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#2
RE: What is this-> (string &in asParent, string &in asChild, int alState)?

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
}

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
12-10-2012, 08:46 PM
Find Reply
4WalledKid Offline
Member

Posts: 107
Threads: 23
Joined: Oct 2012
Reputation: 1
#3
RE: What is this-> (string &in asParent, string &in asChild, int alState)?

(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)

[Image: 4walledkidbanner_zps1514b7f6.png]
12-10-2012, 08:55 PM
Website Find Reply
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#4
RE: What is this-> (string &in asParent, string &in asChild, int alState)?

(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

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
12-10-2012, 09:01 PM
Find Reply
4WalledKid Offline
Member

Posts: 107
Threads: 23
Joined: Oct 2012
Reputation: 1
#5
RE: What is this-> (string &in asParent, string &in asChild, int alState)?

(12-10-2012, 09:01 PM)The chaser Wrote: AddUseItemCallback("", "Itemname", "EntityUsed", "FUNC", true)...
Thank you very much! Big Grin

[Image: 4walledkidbanner_zps1514b7f6.png]
12-10-2012, 09:08 PM
Website Find Reply




Users browsing this thread: 1 Guest(s)