Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Small script help please.
JetlinerX Offline
Senior Member

Posts: 599
Threads: 49
Joined: Jun 2011
Reputation: 19
#1
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 ()
{
}

Lead Developer of "The Attic"
~Slade Mitchell

Chapter 3 (REL)

01-08-2012, 04:28 AM
Website Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#2
RE: Small script help please.

What is the error you are getting?

01-08-2012, 04:36 AM
Find
JetlinerX Offline
Senior Member

Posts: 599
Threads: 49
Joined: Jun 2011
Reputation: 19
#3
RE: Small script help please.

No error, the script just isn't triggering.

Lead Developer of "The Attic"
~Slade Mitchell

Chapter 3 (REL)

01-08-2012, 04:43 AM
Website Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#4
RE: Small script help please.

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

01-08-2012, 04:46 AM
Find
JetlinerX Offline
Senior Member

Posts: 599
Threads: 49
Joined: Jun 2011
Reputation: 19
#5
RE: Small script help please.

map08.map
map08.hps

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

Lead Developer of "The Attic"
~Slade Mitchell

Chapter 3 (REL)

(This post was last modified: 01-08-2012, 04:53 AM by JetlinerX.)
01-08-2012, 04:49 AM
Website Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#6
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
Find
JetlinerX Offline
Senior Member

Posts: 599
Threads: 49
Joined: Jun 2011
Reputation: 19
#7
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 ()
{
}

Lead Developer of "The Attic"
~Slade Mitchell

Chapter 3 (REL)

01-08-2012, 05:22 AM
Website Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#8
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
Find
JetlinerX Offline
Senior Member

Posts: 599
Threads: 49
Joined: Jun 2011
Reputation: 19
#9
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.

Lead Developer of "The Attic"
~Slade Mitchell

Chapter 3 (REL)

(This post was last modified: 01-08-2012, 06:13 AM by JetlinerX.)
01-08-2012, 06:13 AM
Website Find
Krymtel Offline
Member

Posts: 105
Threads: 9
Joined: Oct 2011
Reputation: 3
#10
RE: Small script help please.

Never mind, wish I could delete posts Tongue

Eidolon Total Conversion (WIP)
(This post was last modified: 01-08-2012, 01:03 PM by Krymtel.)
01-08-2012, 01:03 PM
Find




Users browsing this thread: 1 Guest(s)