(09-17-2011, 09:23 PM)AmnesiaIsScary :S Wrote: (09-17-2011, 05:11 PM)Obliviator27 Wrote:
ok and how do I call a function when touching an entity ? like a door slams behind me ...
Depends on what you want. If you want a door to slam shut behind the player when they walk into a room, add a script area on the other side of the door. Then, it's a basic CollideCallback
void OnStart()
{
AddEntityCollideCallback("Player", "[Area]", "DoorSlam", true, 1);
}
void DoorSlam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("[Door Name]", true, true);
}
__________________________________________________________________________________________
Quote:quick question - what are those functions more: OnEnter and OnLeave ? For what they are used for ?
OnEnter are the changes/scripts that occur upon entering the map from another. OnLeave are changes that occur to that particular map when the player leaves it.