Frictional Games Forum (read-only)

Full Version: My script doesn't work?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
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]
the code seems to be alright could you send some screen shots of your meat's and grunt's settings?
(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]
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.
(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!
Help? :\
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()
{

}
(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...
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!
(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?
Pages: 1 2 3