IN NEED OF SCRIPTING HELP - Printable Version +- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum) +-- Forum: Open Source Collaboration (https://www.frictionalgames.com/forum/forum-27.html) +--- Forum: HPL1 Engine (https://www.frictionalgames.com/forum/forum-28.html) +--- Thread: IN NEED OF SCRIPTING HELP (/thread-10367.html) |
IN NEED OF SCRIPTING HELP - Nuite - 09-17-2011 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! RE: IN NEED OF SCRIPTING HELP - Elven - 09-17-2011 U sure u didn't want to post that into amnesia custom story helps ? RE: IN NEED OF SCRIPTING HELP - JenniferOrange - 09-17-2011 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! RE: IN NEED OF SCRIPTING HELP - Nuite - 09-17-2011 Did that now, result: Game crashes while loading my map, ideas? RE: IN NEED OF SCRIPTING HELP - neocrawler - 09-29-2011 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 |