elbichopt
Junior Member
Posts: 14
Threads: 2
Joined: Aug 2012
Reputation:
0
My script doesn't work?
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!
///////////////////////////
//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:
(This post was last modified: 08-15-2012, 10:18 PM by elbichopt .)
08-15-2012, 06:09 PM
Steve
Member
Posts: 178
Threads: 17
Joined: Jun 2012
Reputation:
7
RE: My script doesn't work?
the code seems to be alright could you send some screen shots of your meat's and grunt's settings?
CURRENTLY WORKING ON:
Final Light = 40%
Need of voice actors.
08-15-2012, 09:01 PM
elbichopt
Junior Member
Posts: 14
Threads: 2
Joined: Aug 2012
Reputation:
0
RE: My script doesn't work?
(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:
Meat:
08-15-2012, 10:10 PM
Adny
Posting Freak
Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation:
173
RE: My script doesn't work?
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.
I rate it 3 memes.
08-15-2012, 10:14 PM
elbichopt
Junior Member
Posts: 14
Threads: 2
Joined: Aug 2012
Reputation:
0
RE: My script doesn't work?
(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!
08-15-2012, 10:17 PM
elbichopt
Junior Member
Posts: 14
Threads: 2
Joined: Aug 2012
Reputation:
0
RE: My script doesn't work?
Help? :\
08-16-2012, 10:35 AM
fuytko
Junior Member
Posts: 41
Threads: 6
Joined: Jun 2011
Reputation:
1
RE: My script doesn't work?
Try this!
///////////////////////////
//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()
{
}
(This post was last modified: 08-16-2012, 11:32 AM by fuytko .)
08-16-2012, 11:31 AM
elbichopt
Junior Member
Posts: 14
Threads: 2
Joined: Aug 2012
Reputation:
0
RE: My script doesn't work?
(08-16-2012, 11:31 AM) fuytko Wrote: Try this!
///////////////////////////
//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...
08-16-2012, 11:42 AM
fuytko
Junior Member
Posts: 41
Threads: 6
Joined: Jun 2011
Reputation:
1
RE: My script doesn't work?
///////////////////////////
//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
elbichopt
Junior Member
Posts: 14
Threads: 2
Joined: Aug 2012
Reputation:
0
RE: My script doesn't work?
(08-16-2012, 11:51 AM) fuytko Wrote: ///////////////////////////
//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?
(This post was last modified: 08-16-2012, 11:54 AM by elbichopt .)
08-16-2012, 11:53 AM