willochill
Member
Posts: 73
Threads: 27
Joined: Apr 2011
Reputation:
0
|
Scripting noob, help needed!
I just starting scripting a level i made and in this level there is a bone saw (named bone_saw_2) in one room, and another room is blocked off with wooden boards. basically this is what i want to happen: when you use the saw with the boards the boards fall apart, and a grunt in the blocked off room awakens. so i have a set of inactive broken wooden boards (right near the intact boards) which i want to activate, and the intact boards will be deactivated, to create the illusion of the boards breaking. the grunt in the room is inactive and i want to activate it as well once the saw hits the intact boards. i scripted this but when i test it in the map it's still not working. i copied/pasted the script i wrote for the level below. please tell me what i'm doing wrong here, very confused!
(P.S. to have a script .hps file correspond to a certain map, do you just need to name them the same thing, or is it more complicated than that? also, i have all the maps im testing and their scripts (or at least this one i wrote) in a folder in the "maps" folder in common/amnesia tdd. should they be somewhere else for the script to correspond to it?)
void OnStart ()
{
AddEntityCollideCallback("bone_saw_2", "wooden_boards_block_1", "SawGruntAlert", true, 1);
}
void SawGruntAlert(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("wooden_boards_block_1", false);
SetEntityActive("wooden_boards_block_broken_1", true);
SetEntityActive("servant_grunt_1", true);
}
|
|
05-22-2011, 04:45 AM |
|