Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Solved Script Problem!
Author Message
JoeBradleyUK Offline
Member

Posts: 115
Joined: Jul 2011
Reputation: 0
Post: #1
Script Problem!
My Script won't work, what's wrong with it? Blush

////////////////////////////
// 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);
}

:Work In Progress:
Insanity
(This post was last modified: 07-18-2011 10:16 PM by JoeBradleyUK.)
07-18-2011 08:56 PM
Find all posts by this user Quote this message in a reply
Tanshaydar Offline
From Beyond

Posts: 3,091
Joined: Mar 2009
Reputation: 66
Post: #2
RE: Script Problem!
("Storage_Enemy, true);
->
("Storage_Enemy", true);

07-18-2011 08:58 PM
Visit this user's website Find all posts by this user Quote this message in a reply
JoeBradleyUK Offline
Member

Posts: 115
Joined: Jul 2011
Reputation: 0
Post: #3
RE: Script Problem!
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!

:Work In Progress:
Insanity
(This post was last modified: 07-18-2011 09:22 PM by JoeBradleyUK.)
07-18-2011 09:07 PM
Find all posts by this user Quote this message in a reply
JenniferOrange Offline
Senior Member

Posts: 428
Joined: Jun 2011
Reputation: 33
Post: #4
RE: Script Problem!
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!*

[Image: button.png]
07-18-2011 09:39 PM
Find all posts by this user Quote this message in a reply
JoeBradleyUK Offline
Member

Posts: 115
Joined: Jul 2011
Reputation: 0
Post: #5
RE: Script Problem!
(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?

:Work In Progress:
Insanity
(This post was last modified: 07-18-2011 10:17 PM by JoeBradleyUK.)
07-18-2011 10:14 PM
Find all posts by this user Quote this message in a reply
MrCookieh Offline
Member

Posts: 157
Joined: Jul 2011
Reputation: 0
Post: #6
RE: Script Problem!
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:

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
Find all posts by this user Quote this message in a reply
JoeBradleyUK Offline
Member

Posts: 115
Joined: Jul 2011
Reputation: 0
Post: #7
RE: Script Problem!
(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:

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

:Work In Progress:
Insanity
07-18-2011 10:34 PM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)