Frictional Games Forum (read-only)
Small script help please. - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Small script help please. (/thread-12450.html)



Small script help please. - JetlinerX - 01-08-2012

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.

Code:
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 ()
{
}



RE: Small script help please. - flamez3 - 01-08-2012

What is the error you are getting?


RE: Small script help please. - JetlinerX - 01-08-2012

No error, the script just isn't triggering.



RE: Small script help please. - flamez3 - 01-08-2012

What is your map name, aswell as your .hps file name.


RE: Small script help please. - JetlinerX - 01-08-2012

map08.map
map08.hps

NOTE: We also have a 2 maps named map08a and map08b, could that be interfering?


RE: Small script help please. - flamez3 - 01-08-2012

Are you in developer mode? If you are turn debug messages on and add this to the script:

AddDebugMessage("Itworks", true);



RE: Small script help please. - JetlinerX - 01-08-2012

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:
Code:
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 ()
{
}



RE: Small script help please. - flamez3 - 01-08-2012

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?


RE: Small script help please. - JetlinerX - 01-08-2012

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.



RE: Small script help please. - Krymtel - 01-08-2012

Never mind, wish I could delete posts Tongue