Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help HELP ME PLZZ!!!!!!!!!
mcjakki Offline
Junior Member

Posts: 2
Threads: 1
Joined: Jun 2012
Reputation: 0
#1
HELP ME PLZZ!!!!!!!!!

Hello if u read this plzz check my script error. I dont know what fails in my script.


This is Amnesia error:

FATAL ERROR; Could not load script file'custom_stories/Morso In Ur Ass/maps/Dodge.hps'!
main(47,2) : ERR : Unexpected end of file

And this is my script:


void OnStart()
{
AddUseItemCallback("", "avain_1", "ovi_2", "unLockDoor", true);
PlayMusic("01_amb_darkness.ogg", true, 1.0f, 0, 0, true);
SetEntityCallbackFunc("lantern_1", "Pickup1");
SetEntityCallbackFunc("avain_2", "Pickup2");
AddEntityCollideCallback("Player", "scare_area_1", "scare_1", true, 1);
}

void unLockDoor(string &in item, string &in door)
{
SetSwingDoorLocked("ovi_1", false, true);
PlaySoundAtEntity("", "unlock_door", "ovi_1", 0, false);
RemoveItem("avain_1");
}

void Pickup1(string &in asEntity, string &in type)
{
GiveSanityDamage(5.0f ,true);
SetEntityActive("mies_1" ,true);
PlaySoundAtEntity("Player", "24_iron_maiden.snt", "Player", 0, false);
}

void Pickup2(string &in asEntity, string &in type)
{
GiveSanityDamage(5.0f ,true);
SetEntityActive("servant_grunt" ,true");
ShowEnemyPlayerPosition("servant_grunt");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_10", 0, "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_11", 0, "");
}

void scare_1(string &in asParent, string &in asChild, int alState)
{
GiveSanityDamage(5.0f ,true);
SetEntityActive("scare_1" ,true);
PlaySoundAtEntity("Player", "24_iron_maiden.snt", "Player", 0, false);
}
06-02-2012, 04:26 PM
Find
i3670 Offline
Posting Freak

Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation: 36
#2
RE: HELP ME PLZZ!!!!!!!!!

Try this

void OnStart()
{
AddUseItemCallback("", "avain_1", "ovi_2", "unLockDoor", true);
PlayMusic("01_amb_darkness.ogg", true, 1.0f, 0, 0, true);
SetEntityCallbackFunc("lantern_1", "Pickup1");
SetEntityCallbackFunc("avain_2", "Pickup2");
AddEntityCollideCallback("Player", "scare_area_1", "scare_1", true, 1);
}

void unLockDoor(string &in item, string &in door)
{
SetSwingDoorLocked("ovi_1", false, true);
PlaySoundAtEntity("", "unlock_door", "ovi_1", 0, false);
RemoveItem("avain_1");
}

void Pickup1(string &in asEntity, string &in type)
{
GiveSanityDamage(5.0f, true);
SetEntityActive("mies_1", true);
PlaySoundAtEntity("Player", "24_iron_maiden.snt", "Player", 0, false);
}

void Pickup2(string &in asEntity, string &in type)
{
GiveSanityDamage(5.0f, true);
SetEntityActive("servant_grunt", true);
ShowEnemyPlayerPosition("servant_grunt");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_10", 0, "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_11", 0, "");
}

void scare_1(string &in asParent, string &in asChild, int alState)
{
GiveSanityDamage(5.0f, true);
SetEntityActive("scare_1", true);
PlaySoundAtEntity("Player", "24_iron_maiden.snt", "Player", 0, false);
}


You should/could put the PlayMusic in the OnEnter instead of OnStart

"What you think is irrelevant" - A character of our time

A Christmas Hunt
(This post was last modified: 06-02-2012, 06:23 PM by i3670.)
06-02-2012, 05:31 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#3
RE: HELP ME PLZZ!!!!!!!!!

The issue is in the Pickup2 function.

Tutorials: From Noob to Pro
06-02-2012, 06:09 PM
Website Find
mcjakki Offline
Junior Member

Posts: 2
Threads: 1
Joined: Jun 2012
Reputation: 0
#4
RE: HELP ME PLZZ!!!!!!!!!

(06-02-2012, 05:31 PM)i3670 Wrote: Try this

void OnStart()
{
AddUseItemCallback("", "avain_1", "ovi_2", "unLockDoor", true);
PlayMusic("01_amb_darkness.ogg", true, 1.0f, 0, 0, true);
SetEntityCallbackFunc("lantern_1", "Pickup1");
SetEntityCallbackFunc("avain_2", "Pickup2");
AddEntityCollideCallback("Player", "scare_area_1", "scare_1", true, 1);
}

void unLockDoor(string &in item, string &in door)
{
SetSwingDoorLocked("ovi_1", false, true);
PlaySoundAtEntity("", "unlock_door", "ovi_1", 0, false);
RemoveItem("avain_1");
}

void Pickup1(string &in asEntity, string &in type)
{
GiveSanityDamage(5.0f, true);
SetEntityActive("mies_1", true);
PlaySoundAtEntity("Player", "24_iron_maiden.snt", "Player", 0, false);
}

void Pickup2(string &in asEntity, string &in type)
{
GiveSanityDamage(5.0f, true);
SetEntityActive("servant_grunt", true);
ShowEnemyPlayerPosition("servant_grunt");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_10", 0, "");
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_11", 0, "");
}

void scare_1(string &in asParent, string &in asChild, int alState)
{
GiveSanityDamage(5.0f, true);
SetEntityActive("scare_1", true);
PlaySoundAtEntity("Player", "24_iron_maiden.snt", "Player", 0, false);
}


You should/could put the PlayMusic in the OnEnter instead of OnStart
Thank Dude it worksSmile
06-03-2012, 02:43 PM
Find
i3670 Offline
Posting Freak

Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation: 36
#5
RE: HELP ME PLZZ!!!!!!!!!

No problem, always glad to help.

"What you think is irrelevant" - A character of our time

A Christmas Hunt
06-03-2012, 05:13 PM
Find




Users browsing this thread: 1 Guest(s)