Frictional Games Forum (read-only)

Full Version: IN NEED OF SCRIPTING HELP
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, i wanted something cool with prophealth so i did this:


void OnStart()
{
GiveItemFromFile("lantern", "lantern.ent");
AddEntityCollideCallback("door1", "chair1", "break1", true, 0);
}

void break1()
{
AddPropHealth("door1", -100);
}


That is my scripting so far, and in this case i wanted a chair (chair1) to break a door (door1) when it collided (i.e. throwing the chair at the door)
It doesn't seem to work...
what am i doing wrong? Thanks!Smile
U sure u didn't want to post that into amnesia custom story helps Tongue?
You forgot the callback syntax. ^^
void OnStart()
{
GiveItemFromFile("lantern", "lantern.ent");
AddEntityCollideCallback("door1", "chair1", "break1", true, 0);
}

void break1(string &in asParent, string &in asChild, int alState)
{
AddPropHealth("door1", -100);
}

TRY THAT! Big Grin
Did that now, result: Game crashes while loading my map, ideas?
void OnStart()
{
GiveItemFromFile("lantern", "lantern.ent");
AddEntityCollideCallback("chair1", "door1", "break1", true, 1);
}

void break1(string &in asParent, string &in asChild, int alState)
{
AddPropHealth("door1", -100);
}
try this it will maybe change something. Instead you say when door1 comes into chair's1 area break. you say when chair1 enters door's1 area break