Frictional Games Forum (read-only)
Another Problem - 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: Another Problem (/thread-10619.html)



Another Problem - jmayo - 10-05-2011

I Am Trying to make The monster Spawn When You Go To The Script Area And I Tried This:

AddEntityCollideCallback("Player", "monster", "MonsterStart", true, 1);
}

void MonsterStart(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "endNode", 9999.0f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 9999.0f, "");
}

But I Got an error Can You help me Exclamation


RE: Another Problem - Tanshaydar - 10-06-2011

Is this whole script file?
Also, what kind of error do you get?
Also, why did you write 9999.0f for the waiting time?



RE: Another Problem - jmayo - 10-06-2011

I Took That Part From Another Story
And No Its Not The Whole script The Rest is For Unlocking A Door


RE: Another Problem - Your Computer - 10-06-2011

You're going to need to post more than that and also provide us with the error you got.


RE: Another Problem - jmayo - 10-07-2011


[Image: erroris.png]

Here Is The Whole Script:

////////////////////////////+
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "Prisonkey_1", "prison_1", "usedkeyondoor", true);
}
void usedkeyondoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("prison_1", false, true);
PlaySoundAtEntity("", "unlock_door", "prison_1", 0, false);
RemoveItem("Prisonkey_1");
}

{
AddEntityCollideCallback("Player", "monster", "MonsterStart", true, 1);
}

void MonsterStart(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "endNode", 9999.0f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 9999.0f, "");
}
////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}


RE: Another Problem - Gamemakingdude - 10-07-2011

PHP Code:
////////////////////////////+
// Run first time starting map
void OnStart()
{
AddUseItemCallback("""Prisonkey_1""prison_1""usedkeyondoor"true);
AddEntityCollideCallback("Player""monster""MonsterStart"true1);
}
void usedkeyondoor(string &in asItemstring &in asEntity)
{
SetSwingDoorLocked("prison_1"falsetrue);
PlaySoundAtEntity("""unlock_door""prison_1"0false);
RemoveItem("Prisonkey_1");
}



void MonsterStart(string &in asParentstring &in asChildint alState)
{
SetEntityActive("servant_grunt_1"true);
AddEnemyPatrolNode("servant_grunt_1""endNode"9999.0f"");
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_5"9999.0f"");
}
////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{



Always put your call backs in the onStart() Proc and not anywhere in the code!