Frictional Games Forum (read-only)
Whats Wrong with my hps cant get this combo to work - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Whats Wrong with my hps cant get this combo to work (/thread-12155.html)



Whats Wrong with my hps cant get this combo to work - jessehmusic - 12-28-2011

Hey iv been working with a combo a while now but cant get this to work i have this the things is im gonna make Stone Hammer door gonna open a Lockeddoor i cant get it to work here is all my hps
PHP Code:
void OnStart() 
{
SetEntityPlayerInteractCallback("Note_Test04""function"true);
AddUseItemCallback("""Rusty Key""door_1""KeyOnDoor"true); 
AddUseItemCallback("""Stone Hammer And Chipper""lockeddoor_1""HammerOnDoor"true); 

}


void KeyOnDoor(string &in asItemstring &in asEntity)
{
    
SetSwingDoorLocked("door_1"falsetrue);
    
RemoveItem("Rusty Key");
    
PlaySoundAtEntity("""unlock_door.snt""door_1"0.0ftrue);
}
void HammerOnDoor(string &in asItemstring &in asEntity)

void OnEnter() 
{
AddEntityCollideCallback("servant_grunt_1""servant_grunt_1_remove""RemoveMonster"true1);
}
{
AddCombineCallback("Stone Hammer And Chipper"stone_hammer_1stone_chipper_1StoneHammertrue);
}
void StoneHammer(string &in asItemAstring &in asItemB)
{
RemoveUseItemCallback("Stone Hammer And Chippper");
}

void OnLeave() 
{

}

void function(string&in item)
{
    
SetEntityActive("servant_grunt_1"true);
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_1"2"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_2"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_3"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_4"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_5"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_6"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_7"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_8"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_9"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_10"4"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_11"2"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_12"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_13"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_14"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_15"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_16"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_17"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_18"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_19"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_20"4"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_21"2"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_22"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_23"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_24"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_25"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_26"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_27"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_28"0"");
}
 
 
void RemoveMonster(string &in asParentstring &in asChildint alState)
{
    
SetEntityActive("servant_grunt_1"false);




RE: Whats Wrong with my hps cant get this combo to work - Statyk - 12-29-2011


(12-28-2011, 11:21 PM)jessehmusic Wrote: void OnStart()
{
SetEntityPlayerInteractCallback("Note_Test04", "function", true);
AddUseItemCallback("", "Rusty Key", "door_1", "KeyOnDoor", true);
AddUseItemCallback("", "Stone Hammer And Chipper", "lockeddoor_1", "HammerOnDoor", true);

}


void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door_1", false, true);
RemoveItem("Rusty Key");
PlaySoundAtEntity("", "unlock_door.snt", "door_1", 0.0f, true);
}
void HammerOnDoor(string &in asItem, string &in asEntity)

void OnEnter()
{
AddEntityCollideCallback("servant_grunt_1", "servant_grunt_1_remove", "RemoveMonster", true, 1);
}



You have no functions for the "stone chipper and hammer" to be used on.
Also, you have an extra "p" in "Stone Hammer and Chippper" here.

void StoneHammer(string &in asItemA, string &in asItemB)
{
RemoveUseItemCallback("Stone Hammer And Chippper");
}
I'm sorry, this script is ALL out of whack... You're also missing a callback here:


void OnEnter()
{
AddEntityCollideCallback("servant_grunt_1", "servant_grunt_1_remove", "RemoveMonster", true, 1);
}
((___________________________________________________))
{
AddCombineCallback("Stone Hammer And Chipper", stone_hammer_1, stone_chipper_1, StoneHammer, true);
}
void StoneHammer(string &in asItemA, string &in asItemB)
{





Fuckit... just try this:

//________________________________________
void OnStart()
{
SetEntityPlayerInteractCallback("Note_Test04", "function", true);
AddUseItemCallback("", "Rusty Key", "door_1", "KeyOnDoor", true);
AddUseItemCallback("", "Stone Hammer And Chipper", "lockeddoor_1", "HammerOnDoor", true);
AddCombineCallback("Stone Hammer And Chipper", "stone_hammer_1", "stone_chipper_1", "StoneHammer", true);
}


void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door_1", false, true);
RemoveItem("Rusty Key");
PlaySoundAtEntity("", "unlock_door.snt", "door_1", 0.0f, true);
}
void HammerOnDoor(string &in asItem, string &in asEntity)

void OnEnter()
{
AddEntityCollideCallback("servant_grunt_1", "servant_grunt_1_remove", "RemoveMonster", true, 1);
}
void StoneHammer(string &in asItemA, string &in asItemB)
{
RemoveUseItemCallback("Stone Hammer And Chipper");
}

void OnLeave()
{

}

void function(string&in item)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_10", 4, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_11", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_12", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_13", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_14", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_15", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_16", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_17", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_18", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_19", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_20", 4, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_21", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_22", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_23", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_24", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_25", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_26", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_27", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_28", 0, "");
}

void RemoveMonster(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", false);
}