Frictional Games Forum (read-only)

Full Version: Script Problem!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
My Script won't work, what's wrong with it? Blush

Code:
////////////////////////////
// Run when starting map
void OnStart()
{
AddEntityCollideCallback("Player", "Storage_Scare", "Storage_Scare", true, 0);
}


void Storage_Scare(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Storage_Enemy, true);
AddEnemyPatrolNode("Storage_Enemy", "PathNodeArea_1", "0.1", "";
AddEnemyPatrolNode("Storage_Enemy", "PathNodeArea_2", "0.1", "";
AddEnemyPatrolNode("Storage_Enemy", "PathNodeArea_3", "0.1", "";
AddEnemyPatrolNode("Storage_Enemy", "PathNodeArea_4", "0.1", "";
AddEnemyPatrolNode("Storage_Enemy", "PathNodeArea_5", "0.1", "";
AddEnemyPatrolNode("Storage_Enemy", "PathNodeArea_6", "0.1", "";
AddEnemyPatrolNode("Storage_Enemy", "PathNodeArea_7", "0.1", "";
AddEnemyPatrolNode("Storage_Enemy", "PathNodeArea_8", "0.1", "";
AddEnemyPatrolNode("Storage_Enemy", "PathNodeArea_9", "0.1", "";
}

void FirstDiary(string &in item, int index)
{
ReturnOpenJournal(true);
}

////////////////////////////
// Run when entering map
void OnEnter()
{
PlayMusic("04_amb.ogg", true, 0.7, 0.1, 0, true);
}

////////////////////////////
// Run when leaving map
void OnLeave()
{
StopMusic(0.4, 0);
}
("Storage_Enemy, true);
->
("Storage_Enemy", true);
Ok, now that is working it seems that the path nodes (I think) are not working as I got a lot more errors than before!
AddEnemyPatrolNode("Storage_Enemy", "PathNodeArea_4", "0.1", ""; should be changed to AddEnemyPatrolNode("Storage_Enemy", "PathNodeArea_4", "0.1", "");
*you have to remember to add the ending parenthesis! Fix that on all of your patrol nodes and it should work!*
(07-18-2011, 09:39 PM)JenniferOrange Wrote: [ -> ]AddEnemyPatrolNode("Storage_Enemy", "PathNodeArea_4", "0.1", ""; should be changed to AddEnemyPatrolNode("Storage_Enemy", "PathNodeArea_4", "0.1", "");
*you have to remember to add the ending parenthesis! Fix that on all of your patrol nodes and it should work!*

Oh thanks, aha that, was just a silly mistake which I didn't see some reason!Tongue
(07-18-2011, 10:14 PM)JoeBradleyUK Wrote: [ -> ]
(07-18-2011, 09:39 PM)JenniferOrange Wrote: [ -> ]AddEnemyPatrolNode("Storage_Enemy", "PathNodeArea_4", "0.1", ""; should be changed to AddEnemyPatrolNode("Storage_Enemy", "PathNodeArea_4", "0.1", "");
*you have to remember to add the ending parenthesis! Fix that on all of your patrol nodes and it should work!*

Oh thanks, aha that, was just a silly mistake which I didn't see some reason!Tongue

Another thing, do monsters disappear on their own? If not how would I make them disappear at a certain pathnode?
Monsters disappear, if they are hallucinations (coming near to you), or if they are standing around and have nothing to do.

If you want them to disappear at a certain pathnode:

Code:
void OnStart(){
AddEntityCollideCallback("grunt", "pathnode", "function", true, 1);
}

void function(string &in asParent, string &in asChild, int alState){
FadeEnemyToSmoke("grunt", false);
}
(07-18-2011, 10:25 PM)MrCookieh Wrote: [ -> ]Monsters disappear, if they are hallucinations (coming near to you), or if they are standing around and have nothing to do.

If you want them to disappear at a certain pathnode:

Code:
void OnStart(){
AddEntityCollideCallback("grunt", "pathnode", "function", true, 1);
}

void function(string &in asParent, string &in asChild, int alState){
FadeEnemyToSmoke("grunt", false);
}

Thanks! You guys on the forum are really helpful Big Grin