Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
IN NEED OF SCRIPTING HELP
Author Message
Nuite Offline
Junior Member

Posts: 2
Joined: Sep 2011
Reputation: 0
Post: #1
IN NEED OF SCRIPTING HELP
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
09-17-2011 12:59 PM
Find all posts by this user Quote this message in a reply
Elven Offline
Posting Freak

Posts: 844
Joined: Aug 2011
Reputation: 25
Post: #2
RE: IN NEED OF SCRIPTING HELP
U sure u didn't want to post that into amnesia custom story helps Tongue?

The Interrogation
Chapter 1

My tutorials
09-17-2011 09:05 PM
Find all posts by this user Quote this message in a reply
JenniferOrange Offline
Senior Member

Posts: 380
Joined: Jun 2011
Reputation: 24
Post: #3
RE: IN NEED OF SCRIPTING HELP
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

"To climb steep hills requires a slow pace at first." ~William Shakespeare

09-17-2011 10:14 PM
Find all posts by this user Quote this message in a reply
Nuite Offline
Junior Member

Posts: 2
Joined: Sep 2011
Reputation: 0
Post: #4
RE: IN NEED OF SCRIPTING HELP
Did that now, result: Game crashes while loading my map, ideas?
09-17-2011 11:07 PM
Find all posts by this user Quote this message in a reply
neocrawler Offline
Junior Member

Posts: 27
Joined: Sep 2011
Reputation: 0
Post: #5
RE: IN NEED OF SCRIPTING HELP
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
09-29-2011 10:36 PM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 3 Guest(s)