(07-21-2013, 06:09 PM)ClayPigeon Wrote: (07-21-2013, 05:56 PM)goregrinder99 Wrote: (07-21-2013, 05:46 PM)ClayPigeon Wrote: void OnStart()
{
AddEntityCollideCallback("MonsterEntity", "Area", "StopLook", false, 1);
}
void OnMonsterSpawns // Change this to whenever the enemy spawns
{
StartPlayerLookAt("MonsterEntity", 1.0f, 1.5f, "LookedAt");
}
void LookedAt()
{
StartPlayerLookAt("MonsterEntity", 1.0f, 1.0f, "LookedAt");
}
void StopLook(string &in par, string &in chi, int state)
{
StopPlayerLookAt();
}
So, where do I put what exactly? I'm assuming "MonsterEntity" is the monster name, what do I put in for "Area", "StopLook, and "LookedAt"?
The code that is under OnMonsterSpawns - You said that the monster spawns when the player interacts with a certain entity.
That means, that there is a callback for that interaction. Put the line there.
What's in OnStart - Just paste it in your OnStart callback.
The other ones - Paste them anywhere in your script OUTSIDE any callback.
MonsterEntity is the name of the monster indeed, and the Area is the Script Area the the monster collides with in order to dissapear, which will stop the looking session.
I'm sorry, I still don't get it, I'm a little slow. :\ This is my whole hps. Could you put in the follow script as it needs to be for me?
////////////////////////////
// Run first time starting map
void OnStart()
{
PlaySoundAtEntity("", "amb_idle.snt", "Player", 0, false);
SetPlayerActive(false);
SetPlayerCrouching(true);
FadeOut(0);
FadeIn(3);
AddTimer("T1", 3, "Intro");
AddTimer("T2", 6, "Intro");
AddTimer("T3", 8, "Intro");
AddTimer("T4", 10, "Intro");
AddTimer("T5", 12, "Intro");
AddEntityCollideCallback("Player", "MonsterSpawn", "SpawnMonster", true, 1);
AddUseItemCallback("", "key_tower_1", "level_wood_1", "AtticUnlock", true);
}
void Intro(string &in asTimer)
{
string x = asTimer;
if (x == "T1")
{
PlaySoundAtEntity("", "react_breath.snt", "Player", 0, false);
FadeOut(3);
}
else if (x == "T2")
{
FadeIn(3);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
StartPlayerLookAt("ScriptArea_1", 2, 2, "");
}
else if (x == "T3")
{
StopPlayerLookAt();
StartPlayerLookAt("ScriptArea_2", 2, 2, "");
}
else if (x == "T4")
{
PlaySoundAtEntity("", "react_sigh.snt", "Player", 0, false);
StopPlayerLookAt();
}
else if (x == "T5")
{
SetPlayerCrouching(false);
SetPlayerActive(true);
}
}
void SpawnMonster(string &in asParent, string &in asChild, int alState)
{
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 0, "");
SetEntityActive("servant_grunt_1", true);
}
void AtticUnlock(string &in asItem, string &in asDoor)
{
SetLevelDoorLocked("level_wood_1", false);
PlayGuiSound("door_sewer_unlock.snt", 100);
RemoveItem("key_tower_1");
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}