Frictional Games Forum (read-only)
[SCRIPT] My script doesn't work? - 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: [SCRIPT] My script doesn't work? (/thread-17789.html)

Pages: 1 2 3


My script doesn't work? - elbichopt - 08-15-2012

I've started making my custom story in a while and I have faced some errors, which I always found a way to solve every single one of them. Until now.
I made a script in which it makes the grunt active when I pickup fresh meat. I start the game normally, no errors, but when I pick up the freash meat, nothing happens... The monster option: "Active" is not ticked. I've checked the names of the entities and yet... nothing... Help?

The code:

Spoiler below!
Code:
///////////////////////////
//Run when entering map
void OnStart()
{
  SetEntityPlayerInteractCallback("fresh_one", "ActivateMonster", true);
}

void ActivateMonster(string &in item)
{
    SetEntityActive("grunt", true);
    AddEnemyPatrolNode("grunt", "PathNodeArea_1", 0, "Idle");
    AddEnemyPatrolNode("grunt", "PathNodeArea_2", 0, "Idle");
    PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
  }

/////////////////////////////
// Run when leaving map
void OnLeave()
{

}


Screenshot:
Spoiler below!
[Image: 81913888.jpg]



RE: My script doesn't work? - Steve - 08-15-2012

the code seems to be alright could you send some screen shots of your meat's and grunt's settings?


RE: My script doesn't work? - elbichopt - 08-15-2012

(08-15-2012, 09:01 PM)Steve Wrote: the code seems to be alright could you send some screen shots of your meat's and grunt's settings?
Thank you for replying!

Sure do:

Grunt:
Spoiler below!
[Image: grunt1.png]
Spoiler below!
[Image: grunt2.png]

Meat:
Spoiler below!
[Image: meat1.png]
Spoiler below!
[Image: meat2.png]



RE: My script doesn't work? - Adny - 08-15-2012

Make sure the name of the map and hps files are exactly the same, and they're in the same folder. In addition, make sure your hps is actually a c++ file, and not just a text file.


RE: My script doesn't work? - elbichopt - 08-15-2012

(08-15-2012, 10:14 PM)andyrockin123 Wrote: Make sure the name of the map and hps files are exactly the same, and they're in the same folder. In addition, make sure your hps is actually a c++ file, and not just a text file.
The hps file was edited with Notepad++ and has the same name as the corresponding map.

Thank you for replying though!


RE: My script doesn't work? - elbichopt - 08-16-2012

Help? :\


RE: My script doesn't work? - fuytko - 08-16-2012

Try this!

Code:
///////////////////////////
//Run when entering map
void OnStart()
{
   SetEntityPlayerInteractCallback("fresh_one", "ActivateMonster", true);
}

void ActivateMonster(string &in asEntity)
{
     SetEntityActive("grunt", true);
     AddEnemyPatrolNode("grunt", "PathNodeArea_1", 0, "Idle");
     AddEnemyPatrolNode("grunt", "PathNodeArea_2", 0, "Idle");
     PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
}

/////////////////////////////
// Run when leaving map
void OnLeave()
{

}



RE: My script doesn't work? - elbichopt - 08-16-2012

(08-16-2012, 11:31 AM)fuytko Wrote: Try this!

Code:
///////////////////////////
//Run when entering map
void OnStart()
{
   SetEntityPlayerInteractCallback("fresh_one", "ActivateMonster", true);
}

void ActivateMonster(string &in asEntity)
{
     SetEntityActive("grunt", true);
     AddEnemyPatrolNode("grunt", "PathNodeArea_1", 0, "Idle");
     AddEnemyPatrolNode("grunt", "PathNodeArea_2", 0, "Idle");
     PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
}

/////////////////////////////
// Run when leaving map
void OnLeave()
{

}
Nothing :\
Thank you for your time though...


RE: My script doesn't work? - fuytko - 08-16-2012

Code:
///////////////////////////
//Run when entering map
void OnStart()
{
SetEntityPlayerInteractCallback("fresh_one", "ActivateMonster", true);
}

void ActivateMonster(string &in asEntity)
{
SetEntityActive("grunt", true);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
AddEnemyPatrolNode("grunt", "PathNodeArea_1", 0.0f, "");
AddEnemyPatrolNode("grunt", "PathNodeArea_2", 0.0f, "");
}

/////////////////////////////
// Run when leaving map
void OnLeave()
{

}

This one must work!


RE: My script doesn't work? - elbichopt - 08-16-2012

(08-16-2012, 11:51 AM)fuytko Wrote:
Code:
///////////////////////////
//Run when entering map
void OnStart()
{
SetEntityPlayerInteractCallback("fresh_one", "ActivateMonster", true);
}

void ActivateMonster(string &in asEntity)
{
SetEntityActive("grunt", true);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
AddEnemyPatrolNode("grunt", "PathNodeArea_1", 0.0f, "");
AddEnemyPatrolNode("grunt", "PathNodeArea_2", 0.0f, "");
}

/////////////////////////////
// Run when leaving map
void OnLeave()
{

}

This one must work!
I'm raging out here! LOL It didn't work...

Can it be because of the light?