RE: Level Editor Glitch? Help!!
Here is my script if it helps at all. Im trying to get this custom story finished for PewDiePie.
////////////////////////////
// Run when entering map
void OnEnter()
{
}
void OnStart()
{
AddUseItemCallback("", "key4", "door1", "UsedKeyOnDoor1", true);
AddUseItemCallback("", "key2", "door3", "UsedKeyOnDoor2", true);
AddUseItemCallback("", "key3", "door2", "UsedKeyOnDoor3", true);
SetEntityPlayerInteractCallback("cabinet_nice_6", "cabscare", true);
SetEntityCallbackFunc("paper1", "OnPickup");
SetEntityCallbackFunc("paper2", "OnPickup2");
SetEntityCallbackFunc("laudanum", "OnPickup3");
SetEntityCallbackFunc("cabinet_nice_6", "OnPickup4");
AddEntityCollideCallback("Player", "ScriptArea_3", "grunt1", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_4", "monster1", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_5", "monster2", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_1", "doorscare", true, 1);
}
void monster1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("enemy1", true);
AddEnemyPatrolNode("enemy1", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("enemy1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("enemy1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("enemy1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("enemy1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("enemy1", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("enemy1", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("enemy1", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("enemy1", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("enemy1", "PathNodeArea_10", 0, "");
AddEnemyPatrolNode("enemy1", "PathNodeArea_11", 0, "");
AddEnemyPatrolNode("enemy1", "PathNodeArea_12", 0, "");
AddEnemyPatrolNode("enemy1", "PathNodeArea_13", 0, "");
AddEnemyPatrolNode("enemy1", "PathNodeArea_14", 0, "");
AddEnemyPatrolNode("enemy1", "PathNodeArea_15", 0, "");
}
void doorscare(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorLocked("mansion_3", true, true);
}
void monster2(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("enemy3", true);
ShowEnemyPlayerPosition("enemy3");
}
void OnPickup(string &in asEntity, string &in type)
{
SetEntityActive("paper1", true);
}
void OnPickup2(string &in asEntity, string &in type)
{
SetEntityActive("paper2", true);
}
void OnPickup3(string &in asEntity, string &in type)
{
SetEntityActive("laudanum", true);
}
void OnPickup4(string &in asEntity, string &in type)
{
SetEntityActive("enemy2", true);
PlaySoundAtEntity("", "Sound_2", "enemy2", 0, false);
}
void grunt1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("grunt1", true);
}
void UsedKeyOnDoor1(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door1", false, true);
PlaySoundAtEntity("", "unlock_door", "door1", 0, false);
RemoveItem("key4");
}
void UsedKeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door3", false, true);
PlaySoundAtEntity("", "unlock_door", "door3", 0, false);
RemoveItem("key2");
}
void UsedKeyOnDoor3(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door2", false, true);
PlaySoundAtEntity("", "unlock_door", "door2", 0, false);
RemoveItem("key3");
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
|