assassinhawk45
Junior Member
Posts: 31
Threads: 11
Joined: Dec 2012
Reputation:
0
|
Monster Path
I have been trying to set a monster and its path nodes. When I open the map, it just stands there. Another problem that I am having is that when ever I put a monster in, it always looks along the x-axis, even though it has been rotated in the editor.
Any ways here is my script. I have already checked the names of everything.
////////////////////////////
// Run when starting map
void OnStart()
{
SetEntityCallbackFunc("tinder", "OnPickup");
SetEntityCallbackFunc("scroll", "OnPickup2");
AddEntityCollideCallback("Player", "trigger", "monster", true, 1);
AddEntityCollideCallback("servant_grunt_1", "disable", "disable", true, 1);
}
void OnPickup(string &in asEntity, string &in type)
{
SetEntityActive("body", true);
PlaySoundAtEntity("", "react_scare.snt", "Player", 0.0f, false);
AddTimer("", 0.7, "scared");
}
void scared(string &in asTimer)
{
SetEntityActive("body", false);
}
void OnPickup2(string &in asEntity, string &in type)
{
SetEntityActive("fish", true);
PlaySoundAtEntity("", "impact_water_high.snt", "Player", 0.0f, false);
PlaySoundAtEntity("", "react_scare.snt", "Player", 0.0f, false);
GiveSanityDamage(15, true);
AddTimer("", 0.4, "look");
}
void look(string &in asTimer)
{
StartPlayerLookAt("fish", 3, 5, "");
}
void monster(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_1", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_6", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_7", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_8", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_10", 1, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_11", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_12", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_13", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_14", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_15", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_16", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_17", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_18", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_19", 0, "");
}
void disable(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", false);
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
AutoSave();
}[/code]
If you can spot what I did wrong, I'd appreciate it.
The Necromancer's Touch: WIP Coming March 2013
(This post was last modified: 02-08-2013, 03:09 AM by assassinhawk45.)
|
|