Hey! I'm new to scripting, need some help.
Hey guys!
I'm a complete noob when it comes to making maps and scripting, and I've been struggling for hours for such a simple script, and I'm starting to feel stupid lol.
The game crashes when I start my Custom Story, and I'm using this script:
void OnStart()
{
if(ScriptDebugOn())
{
AddUseItemCallback("", "key_1", "door_1", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player", "ScriptArea_1", "ActivateMonster", true, 1);
SetEntityConnectionStateChangeCallback("lever_simple01_1", "func_secret_1");
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door_1", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "door_1", 0.0f, false);
RemoveItem("key_1");
AddDebugMessage("KeyOnDoor", false);
}
void ActivateMonster(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_brutehot_1", true);
AddEnemyPatrolNode("servant_brutehot_1", "PathNodeArea_1", 0, "Idle");
AddEnemyPatrolNode("servant_brutehot_1", "PathNodeArea_2", 0, "Idle");
}
void func_secret_1(string &in asEntity, int alState)
{
if (alState == 1)
{
SetMoveObjectState("secret_1",1.0f);
PlaySoundAtEntity("", "quest_completed.snt", "secret_1_move_1", 0, false);
return;
}
void OnEnter()
{
}
void OnLeave()
{
}
Ok, so, please tell me the mistakes and how to improve, would be awesome. ^^
|