JetlinerX
Senior Member
Posts: 599
Threads: 49
Joined: Jun 2011
Reputation:
19
|
Small script help please.
I've been scripting for a while, and have no idea whats wrong. Am I a making a simple mistake here, and just over looking it because I am tired, or is there something wrong here? Here is my code, all areas, are named correctly.
void OnEnter ()
{
AddEntityCollideCallback("Player", "DoorsScare", "HallwayScare", true, 1);
}
void HallwayScare(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "lurker_hit_Wood", "Player", 0, false);
CreateParticleSystemAtEntity("", "ps_dust_impact", "DoorEffect1", false);
CreateParticleSystemAtEntity("", "ps_door_damage_wood", "DoorEffect1", false);
CreateParticleSystemAtEntity("", "ps_dust_impact", "DoorEffect5", false);
CreateParticleSystemAtEntity("", "ps_door_damage_wood", "DoorEffect5", false);
AddTimer("", 1, "Doors2");
}
void Doors2(string &in asTimer)
{
PlaySoundAtEntity("", "lurker_hit_Wood", "Player", 0, false);
CreateParticleSystemAtEntity("", "ps_dust_impact", "DoorEffect2", false);
CreateParticleSystemAtEntity("", "ps_door_damage_wood", "DoorEffect2", false);
CreateParticleSystemAtEntity("", "ps_dust_impact", "DoorEffect6", false);
CreateParticleSystemAtEntity("", "ps_door_damage_wood", "DoorEffect6", false);
AddTimer("", 1, "Doors3");
}
void Doors3(string &in asTimer)
{
PlaySoundAtEntity("", "lurker_hit_Wood", "Player", 0, false);
CreateParticleSystemAtEntity("", "ps_dust_impact", "DoorEffect3", false);
CreateParticleSystemAtEntity("", "ps_door_damage_wood", "DoorEffect3", false);
CreateParticleSystemAtEntity("", "ps_dust_impact", "DoorEffect7", false);
CreateParticleSystemAtEntity("", "ps_door_damage_wood", "DoorEffect7", false);
}
void OnLeave ()
{
}
|
|
01-08-2012, 04:28 AM |
|
flamez3
Posting Freak
Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation:
57
|
RE: Small script help please.
What is the error you are getting?
|
|
01-08-2012, 04:36 AM |
|
JetlinerX
Senior Member
Posts: 599
Threads: 49
Joined: Jun 2011
Reputation:
19
|
RE: Small script help please.
No error, the script just isn't triggering.
|
|
01-08-2012, 04:43 AM |
|
flamez3
Posting Freak
Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation:
57
|
RE: Small script help please.
What is your map name, aswell as your .hps file name.
|
|
01-08-2012, 04:46 AM |
|
JetlinerX
Senior Member
Posts: 599
Threads: 49
Joined: Jun 2011
Reputation:
19
|
RE: Small script help please.
map08.map
map08.hps
NOTE: We also have a 2 maps named map08a and map08b, could that be interfering?
(This post was last modified: 01-08-2012, 04:53 AM by JetlinerX.)
|
|
01-08-2012, 04:49 AM |
|
flamez3
Posting Freak
Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation:
57
|
RE: Small script help please.
Are you in developer mode? If you are turn debug messages on and add this to the script:
AddDebugMessage("Itworks", true);
|
|
01-08-2012, 05:14 AM |
|
JetlinerX
Senior Member
Posts: 599
Threads: 49
Joined: Jun 2011
Reputation:
19
|
RE: Small script help please.
I just added it to the first part of the script (below the first timer) and I dont see anything changed. I havent ever used debug messages, so what do I do?
Here is the script:
void OnEnter ()
{
AddEntityCollideCallback("Player", "DoorsScare", "HallwayScare", true, 1);
}
void HallwayScare(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "lurker_hit_Wood", "Player", 0, false);
CreateParticleSystemAtEntity("", "ps_dust_impact", "DoorEffect1", false);
CreateParticleSystemAtEntity("", "ps_door_damage_wood", "DoorEffect1", false);
CreateParticleSystemAtEntity("", "ps_dust_impact", "DoorEffect5", false);
CreateParticleSystemAtEntity("", "ps_door_damage_wood", "DoorEffect5", false);
AddTimer("", 1, "Doors2");
AddDebugMessage("Itworks", true);
}
void Doors2(string &in asTimer)
{
PlaySoundAtEntity("", "lurker_hit_Wood", "Player", 0, false);
CreateParticleSystemAtEntity("", "ps_dust_impact", "DoorEffect2", false);
CreateParticleSystemAtEntity("", "ps_door_damage_wood", "DoorEffect2", false);
CreateParticleSystemAtEntity("", "ps_dust_impact", "DoorEffect6", false);
CreateParticleSystemAtEntity("", "ps_door_damage_wood", "DoorEffect6", false);
AddTimer("", 1, "Doors3");
}
void Doors3(string &in asTimer)
{
PlaySoundAtEntity("", "lurker_hit_Wood", "Player", 0, false);
CreateParticleSystemAtEntity("", "ps_dust_impact", "DoorEffect3", false);
CreateParticleSystemAtEntity("", "ps_door_damage_wood", "DoorEffect3", false);
CreateParticleSystemAtEntity("", "ps_dust_impact", "DoorEffect7", false);
CreateParticleSystemAtEntity("", "ps_door_damage_wood", "DoorEffect7", false);
}
void OnLeave ()
{
}
|
|
01-08-2012, 05:22 AM |
|
flamez3
Posting Freak
Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation:
57
|
RE: Small script help please.
Are you in developer mode? It will come in as a message in the left corner, this means that the script is working; but the events you set up aren't. The only thing I can see wrong with the script is that you don't have a void
OnStart()
{
}
anywhere in the script. Maybe shifting AddEntityCollideCallback("Player", "DoorsScare", "HallwayScare", true, 1); into the void OnStart() block and delete the void OnEnter?
|
|
01-08-2012, 06:00 AM |
|
JetlinerX
Senior Member
Posts: 599
Threads: 49
Joined: Jun 2011
Reputation:
19
|
RE: Small script help please.
Flamez-
Sorry for wasting your time, for some reason I just restarted my Amnesia and it worked. Really sorry, not really sure what I was doing wrong but thanks for your help, and I will be giving you + feedback for your time. Thanks again, and have a good evening.
(This post was last modified: 01-08-2012, 06:13 AM by JetlinerX.)
|
|
01-08-2012, 06:13 AM |
|
Krymtel
Member
Posts: 105
Threads: 9
Joined: Oct 2011
Reputation:
3
|
RE: Small script help please.
Never mind, wish I could delete posts
(This post was last modified: 01-08-2012, 01:03 PM by Krymtel.)
|
|
01-08-2012, 01:03 PM |
|
|