(09-09-2012, 12:57 AM)beecake Wrote: It's actually pretty easy
Colliding = (string &in asParent, string &in asChild, int alState)
Because:
asParent = 1st object
asChild = 2nd object
alState = How do they collide? When 1 goes inside? When 1 goes outside? Both?
Interacting = (string &in asEntity)
Because:
asEntity = The entity you interact with. There can only be 1 thing that is cabable of interacting and that is the player.
Use Item = (string &in asItem, string &in asEntity)
Because:
asItem = The item you use.
AsEntity = The entity you use it on
Look-at function = (string &in asEntity, int alState)
Because:
asEntity = The entity you look at
alState = Defining if you are: Looking at it? Looking away from it? Both?
You can actually use those guys (asEntity, asItem, alState, etc.) in scripts like:
void CollideFunction(string &in asParent, string &in asChild, int alState)
{
if(alState == -1) //If you are walking out of the area.
{
GiveSanityDamage(5);
}
}
I hope you understood
I think that uploading this to the wiki would be a good idea. Anyway, in my custom story I work too with these. I can upload my script, and then you can compare them (it's always good to search for yourself what you've done wrong). Nevermind, sometimes is good to post it, so people can see possible issues. Well, here you have:
void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_2", "Explore_deep", true, 1);
}
void Explore_deep (string &in asParent, string &in asChild, int alState)
{
ChangeMap("map_2.map", "Castle", "", ""); ///Castle is the startarea of the other map.
}