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


Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Script area does not activate
Author Message
Peldan Offline
Junior Member

Posts: 16
Joined: Mar 2012
Reputation: 0
Post: #1
Script area does not activate

Hello guys.
See, I've got a really simple problem. It's weird how it won't work!

My script area doesn't activate when the Player collides with it.

Here's the code:
PHP Code: (Select All)
void OnStart()
{    
AddEntityCollideCallback("Player""ScriptArea_1""SpawnBrute"true1);
AddEntityCollideCallback("brute""BruteDeSpawn""DeSpawnBrute"true1);    
AddEntityCollideCallback("Player""brutescare""BruteWalk"true1);
}
void SpawnBrute(string &in asParentstring &in asChildint alState)
{    
AddDebugMessage("Scriptarea works"true);    
SetEntityActive("brute"true);    
PlaySoundAtEntity("""notice.snt""brute"0false);    
PlayMusic("search_brute.ogg"true0.8f00true);    
SetMessage("SetMessage""SM_Malo"0);    
AddEnemyPatrolNode("brute""PathNodeArea_1"0.1f"");    
AddEnemyPatrolNode("brute""PathNodeArea_2"0.1f"");    
AddEnemyPatrolNode("brute""PathNodeArea_3"0.1f"");    
AddEnemyPatrolNode("brute""PathNodeArea_4"0.1f"");    
AddEnemyPatrolNode("brute""PathNodeArea_5"0.1f"");    
AddEnemyPatrolNode("brute""PathNodeArea_6"0.1f"");    
AddEnemyPatrolNode("brute""PathNodeArea_7"0.1f"");    
AddEnemyPatrolNode("brute""PathNodeArea_8"0.1f"");    
AddEnemyPatrolNode("brute""PathNodeArea_9"0.1f"");    
AddEnemyPatrolNode("brute""PathNodeArea_10"0.1f"");    
AddEnemyPatrolNode("brute""PathNodeArea_11"0.1f"");
}
void DeSpawnBrute(string &in asParentstring &in asChildint alState)
{    
SetEntityActive("brute"false);    
StopMusic(1.0f0);    
SetMessage("SetMessage""SM_MaloGone"0);
}
void BruteWalk(string &in asParentstring &in asChildint alState)
{    
SetEntityActive("bruteoutside"true);    
PlaySoundAtEntity("""notice.snt""bruteoutside"0false);
PlayMusic("search_brute.ogg"true0.8f00true);    
AddEnemyPatrolNode("bruteoutside""PathNodeArea_12"0.1f"");    
AddEnemyPatrolNode("bruteoutside""PathNodeArea_13"0.1f"");    
AddEnemyPatrolNode("bruteoutside""PathNodeArea_14"0.1f"");    
AddEnemyPatrolNode("bruteoutside""PathNodeArea_15"0.1f"");    
AddEnemyPatrolNode("bruteoutside""PathNodeArea_16"0.1f"");    
AddEnemyPatrolNode("bruteoutside""PathNodeArea_17"0.1f"");
}
void OnEnter(){
}
void OnLeave(){



The script is named ScriptArea_1 and is correctly placed. Here's a pic:
[Image: tEjvW.jpg]
(This post was last modified: 03-10-2012 12:39 PM by Peldan.)
03-10-2012 12:37 PM
Find all posts by this user Quote this message in a reply
Stepper321 Offline
Senior Member

Posts: 263
Joined: Nov 2011
Reputation: 8
Post: #2
RE: Script area does not activate

I recommend doing everything with callback on enter Smile


PHP Code: (Select All)
void OnStart(){

}
void OnEnter()
{    
AddEntityCollideCallback("Player""ScriptArea_1""SpawnBrute"true1);
AddEntityCollideCallback("brute""BruteDeSpawn""DeSpawnBrute"true1);    
AddEntityCollideCallback("Player""brutescare""BruteWalk"true1);
}
void SpawnBrute(string &in asParentstring &in asChildint alState)
{    
AddDebugMessage("Scriptarea works"true);    
SetEntityActive("brute"true);    
PlaySoundAtEntity("""notice.snt""brute"0false);    
PlayMusic("search_brute.ogg"true0.8f00true);    
SetMessage("SetMessage""SM_Malo"0);    
AddEnemyPatrolNode("brute""PathNodeArea_1"0.1f"");    
AddEnemyPatrolNode("brute""PathNodeArea_2"0.1f"");    
AddEnemyPatrolNode("brute""PathNodeArea_3"0.1f"");    
AddEnemyPatrolNode("brute""PathNodeArea_4"0.1f"");    
AddEnemyPatrolNode("brute""PathNodeArea_5"0.1f"");    
AddEnemyPatrolNode("brute""PathNodeArea_6"0.1f"");    
AddEnemyPatrolNode("brute""PathNodeArea_7"0.1f"");    
AddEnemyPatrolNode("brute""PathNodeArea_8"0.1f"");    
AddEnemyPatrolNode("brute""PathNodeArea_9"0.1f"");    
AddEnemyPatrolNode("brute""PathNodeArea_10"0.1f"");    
AddEnemyPatrolNode("brute""PathNodeArea_11"0.1f"");
}
void DeSpawnBrute(string &in asParentstring &in asChildint alState)
{    
SetEntityActive("brute"false);    
StopMusic(1.0f0);    
SetMessage("SetMessage""SM_MaloGone"0);
}
void BruteWalk(string &in asParentstring &in asChildint alState)
{    
SetEntityActive("bruteoutside"true);    
PlaySoundAtEntity("""notice.snt""bruteoutside"0false);
PlayMusic("search_brute.ogg"true0.8f00true);    
AddEnemyPatrolNode("bruteoutside""PathNodeArea_12"0.1f"");    
AddEnemyPatrolNode("bruteoutside""PathNodeArea_13"0.1f"");    
AddEnemyPatrolNode("bruteoutside""PathNodeArea_14"0.1f"");    
AddEnemyPatrolNode("bruteoutside""PathNodeArea_15"0.1f"");    
AddEnemyPatrolNode("bruteoutside""PathNodeArea_16"0.1f"");    
AddEnemyPatrolNode("bruteoutside""PathNodeArea_17"0.1f"");
}
void OnEnter(){
}
void OnLeave(){


Signature to awesome to be displayed.
(This post was last modified: 03-10-2012 12:48 PM by Stepper321.)
03-10-2012 12:45 PM
Find all posts by this user Quote this message in a reply
ingedoom Offline
Member

Posts: 120
Joined: Feb 2012
Reputation: 0
Post: #3
RE: Script area does not activate

Have u added the brute as entity?? (under the enemy tab)


And did you rename it "brute"??

[Image: 23778.png]
03-10-2012 12:50 PM
Visit this user's website Find all posts by this user Quote this message in a reply
flamez3 Offline
Posting Freak

Posts: 1,285
Joined: Apr 2011
Reputation: 57
Post: #4
RE: Script area does not activate

Do any other scripts work?
(03-10-2012 12:45 PM)Stepper321 Wrote:  I recommend doing everything with callback on enter Smile


PHP Code: (Select All)
void OnStart(){

}
void OnEnter()
{    
AddEntityCollideCallback("Player""ScriptArea_1""SpawnBrute"true1);
AddEntityCollideCallback("brute""BruteDeSpawn""DeSpawnBrute"true1);    
AddEntityCollideCallback("Player""brutescare""BruteWalk"true1);
}
void SpawnBrute(string &in asParentstring &in asChildint alState)
{    
AddDebugMessage("Scriptarea works"true);    
SetEntityActive("brute"true);    
PlaySoundAtEntity("""notice.snt""brute"0false);    
PlayMusic("search_brute.ogg"true0.8f00true);    
SetMessage("SetMessage""SM_Malo"0);    
AddEnemyPatrolNode("brute""PathNodeArea_1"0.1f"");    
AddEnemyPatrolNode("brute""PathNodeArea_2"0.1f"");    
AddEnemyPatrolNode("brute""PathNodeArea_3"0.1f"");    
AddEnemyPatrolNode("brute""PathNodeArea_4"0.1f"");    
AddEnemyPatrolNode("brute""PathNodeArea_5"0.1f"");    
AddEnemyPatrolNode("brute""PathNodeArea_6"0.1f"");    
AddEnemyPatrolNode("brute""PathNodeArea_7"0.1f"");    
AddEnemyPatrolNode("brute""PathNodeArea_8"0.1f"");    
AddEnemyPatrolNode("brute""PathNodeArea_9"0.1f"");    
AddEnemyPatrolNode("brute""PathNodeArea_10"0.1f"");    
AddEnemyPatrolNode("brute""PathNodeArea_11"0.1f"");
}
void DeSpawnBrute(string &in asParentstring &in asChildint alState)
{    
SetEntityActive("brute"false);    
StopMusic(1.0f0);    
SetMessage("SetMessage""SM_MaloGone"0);
}
void BruteWalk(string &in asParentstring &in asChildint alState)
{    
SetEntityActive("bruteoutside"true);    
PlaySoundAtEntity("""notice.snt""bruteoutside"0false);
PlayMusic("search_brute.ogg"true0.8f00true);    
AddEnemyPatrolNode("bruteoutside""PathNodeArea_12"0.1f"");    
AddEnemyPatrolNode("bruteoutside""PathNodeArea_13"0.1f"");    
AddEnemyPatrolNode("bruteoutside""PathNodeArea_14"0.1f"");    
AddEnemyPatrolNode("bruteoutside""PathNodeArea_15"0.1f"");    
AddEnemyPatrolNode("bruteoutside""PathNodeArea_16"0.1f"");    
AddEnemyPatrolNode("bruteoutside""PathNodeArea_17"0.1f"");
}
void OnEnter(){
}
void OnLeave(){

Thast honestley, would not change a thing/

(This post was last modified: 03-10-2012 12:51 PM by flamez3.)
03-10-2012 12:51 PM
Find all posts by this user Quote this message in a reply
Peldan Offline
Junior Member

Posts: 16
Joined: Mar 2012
Reputation: 0
Post: #5
RE: Script area does not activate

(03-10-2012 12:50 PM)pingo2 Wrote:  Have u added the brute as entity?? (under the enemy tab)


And did you rename it "brute"??
Yep. Added it and placed it as inactive behind a door, and then used pathnodes. The problem isn't the enemy, though. I don't even get a debug message showing that I entered the script area.


And flamez3, let me check. I will create a new one and post again in a couple of mins.


EDIT: Nope, doesn't seem like other scripts work.
(This post was last modified: 03-10-2012 01:05 PM by Peldan.)
03-10-2012 01:01 PM
Find all posts by this user Quote this message in a reply
Stepper321 Offline
Senior Member

Posts: 263
Joined: Nov 2011
Reputation: 8
Post: #6
RE: Script area does not activate

(03-10-2012 12:51 PM)flamez3 Wrote:  Do any other scripts work?
(03-10-2012 12:45 PM)Stepper321 Wrote:  I recommend doing everything with callback on enter Smile





PHP Code: (Select All)
void OnStart(){



}

void OnEnter()

{    

AddEntityCollideCallback("Player""ScriptArea_1""SpawnBrute"true1);

AddEntityCollideCallback("brute""BruteDeSpawn""DeSpawnBrute"true1);    

AddEntityCollideCallback("Player""brutescare""BruteWalk"true1);

}

void SpawnBrute(string &in asParentstring &in asChildint alState)

{    

AddDebugMessage("Scriptarea works"true);    

SetEntityActive("brute"true);    

PlaySoundAtEntity("""notice.snt""brute"0false);    

PlayMusic("search_brute.ogg"true0.8f00true);    

SetMessage("SetMessage""SM_Malo"0);    

AddEnemyPatrolNode("brute""PathNodeArea_1"0.1f"");    

AddEnemyPatrolNode("brute""PathNodeArea_2"0.1f"");    

AddEnemyPatrolNode("brute""PathNodeArea_3"0.1f"");    

AddEnemyPatrolNode("brute""PathNodeArea_4"0.1f"");    

AddEnemyPatrolNode("brute""PathNodeArea_5"0.1f"");    

AddEnemyPatrolNode("brute""PathNodeArea_6"0.1f"");    

AddEnemyPatrolNode("brute""PathNodeArea_7"0.1f"");    

AddEnemyPatrolNode("brute""PathNodeArea_8"0.1f"");    

AddEnemyPatrolNode("brute""PathNodeArea_9"0.1f"");    

AddEnemyPatrolNode("brute""PathNodeArea_10"0.1f"");    

AddEnemyPatrolNode("brute""PathNodeArea_11"0.1f"");

}

void DeSpawnBrute(string &in asParentstring &in asChildint alState)

{    

SetEntityActive("brute"false);    

StopMusic(1.0f0);    

SetMessage("SetMessage""SM_MaloGone"0);

}

void BruteWalk(string &in asParentstring &in asChildint alState)

{    

SetEntityActive("bruteoutside"true);    

PlaySoundAtEntity("""notice.snt""bruteoutside"0false);

PlayMusic("search_brute.ogg"true0.8f00true);    

AddEnemyPatrolNode("bruteoutside""PathNodeArea_12"0.1f"");    

AddEnemyPatrolNode("bruteoutside""PathNodeArea_13"0.1f"");    

AddEnemyPatrolNode("bruteoutside""PathNodeArea_14"0.1f"");    

AddEnemyPatrolNode("bruteoutside""PathNodeArea_15"0.1f"");    

AddEnemyPatrolNode("bruteoutside""PathNodeArea_16"0.1f"");    

AddEnemyPatrolNode("bruteoutside""PathNodeArea_17"0.1f"");

}

void OnEnter(){

}

void OnLeave(){


Thast honestley, would not change a thing/
It did for me.


(03-10-2012 01:01 PM)Peldan Wrote:  
(03-10-2012 12:50 PM)pingo2 Wrote:  Have u added the brute as entity?? (under the enemy tab)


And did you rename it "brute"??
Yep. Added it and placed it as inactive behind a door, and then used pathnodes. The problem isn't the enemy, though. I don't even get a debug message showing that I entered the script area.


And flamez3, let me check. I will create a new one and post again in a couple of mins.


EDIT: Nope, doesn't seem like other scripts work.
What is the name of the map and hps?

Signature to awesome to be displayed.
03-10-2012 01:21 PM
Find all posts by this user Quote this message in a reply
Peldan Offline
Junior Member

Posts: 16
Joined: Mar 2012
Reputation: 0
Post: #7
RE: Script area does not activate

(03-10-2012 01:21 PM)Stepper321 Wrote:  What is the name of the map and hps?
second.hps and second.map
03-10-2012 01:25 PM
Find all posts by this user Quote this message in a reply
flamez3 Offline
Posting Freak

Posts: 1,285
Joined: Apr 2011
Reputation: 57
Post: #8
RE: Script area does not activate

Are you sure they are in the same folder?

03-10-2012 01:39 PM
Find all posts by this user Quote this message in a reply
Peldan Offline
Junior Member

Posts: 16
Joined: Mar 2012
Reputation: 0
Post: #9
RE: Script area does not activate

(03-10-2012 01:39 PM)flamez3 Wrote:  Are you sure they are in the same folder?
Yep.
03-10-2012 01:39 PM
Find all posts by this user Quote this message in a reply
flamez3 Offline
Posting Freak

Posts: 1,285
Joined: Apr 2011
Reputation: 57
Post: #10
RE: Script area does not activate

Can you give me the layout of your folders?

03-10-2012 01:49 PM
Find all posts by this user Quote this message in a reply
Post Reply 




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