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


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

(08-16-2012, 11:53 AM)elbichopt Wrote:
(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?

I'm almost done Big Grin Hmm,write fresh_one into CustomSubItemTypeName box..I think that this is problem..
Also use my second script what I've written Big Grin


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

(08-16-2012, 12:00 PM)fuytko Wrote:
(08-16-2012, 11:53 AM)elbichopt Wrote:
(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?

I'm almost done Big Grin Hmm,write fresh_one into CustomSubItemName box..I think that this is problem..
[Image: 35wut3.jpg]
LOL Didn't work. This engine has to be trolling me!


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

(08-16-2012, 12:05 PM)elbichopt Wrote:
(08-16-2012, 12:00 PM)fuytko Wrote:
(08-16-2012, 11:53 AM)elbichopt Wrote:
(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?



I'm almost done Big Grin Hmm,write fresh_one into CustomSubItemName box..I think that this is problem..
[Image: 35wut3.jpg]

LOL Didn't work. This engine has to be trolling me!



Angry I'm angry too,going to try that on test custom story,wait..


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

Roger that :\


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

[Image: script-problem.jpg]


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

It's working,download and check this out.


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

(08-16-2012, 12:20 PM)fuytko Wrote: It's working,download and check this out.
Wow yeah that map works but I don't know why, mine doesnt o.o
Anyways, thank you for your time! I will try to create my map around yours Tongue


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

(08-16-2012, 12:33 PM)elbichopt Wrote:
(08-16-2012, 12:20 PM)fuytko Wrote: It's working,download and check this out.

Wow yeah that map works but I don't know why, mine doesnt o.o

Anyways, thank you for your time! I will try to create my map around yours Tongue

No problem..If some problems appears,tell me then.


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

Sorry to bother you again, but what if I want to call more grunts?
I added more fresh meats and made this code. But only the one you made works xD

Spoiler below!
Code:
///////////////////////////
//Run when entering map

void OnStart()
{
SetEntityPlayerInteractCallback("fresh_one", "ActivateMonster", true);
SetEntityPlayerInteractCallback("fresh_two", "ActivateMonster_2", true);
SetEntityPlayerInteractCallback("fresh_three", "ActivateMonster_3", true);
SetEntityPlayerInteractCallback("fresh_four", "ActivateMonster_4", true);
}

void ActivateMonster(string &in asEntity)
{
SetEntityActive("grunt", true);
AddEnemyPatrolNode("grunt", "PathNodeArea_1", 0.0f, "");
AddEnemyPatrolNode("grunt", "PathNodeArea_2", 0.0f, "");
AddEnemyPatrolNode("grunt", "PathNodeArea_3", 6.0f, "");
}

  void ActivateMonster_2(string &in asEntity)
{
SetEntityActive("grunt_2", true);
AddEnemyPatrolNode("grunt_2", "PathNodeArea_1", 0.0f, "");
AddEnemyPatrolNode("grunt_2", "PathNodeArea_2", 0.0f, "");
AddEnemyPatrolNode("grunt_2", "PathNodeArea_3", 6.0f, "");
}

   void ActivateMonster_3(string &in asEntity)
{
SetEntityActive("grunt_3", true);
AddEnemyPatrolNode("grunt_3", "PathNodeArea_1", 0.0f, "");
AddEnemyPatrolNode("grunt_3", "PathNodeArea_2", 0.0f, "");
AddEnemyPatrolNode("grunt_3", "PathNodeArea_3", 6.0f, "");
}

   void ActivateMonster_4(string &in asEntity)
{
SetEntityActive("grunt_4", true);
AddEnemyPatrolNode("grunt_4", "PathNodeArea_1", 0.0f, "");
AddEnemyPatrolNode("grunt_4", "PathNodeArea_2", 0.0f, "");
AddEnemyPatrolNode("grunt_4", "PathNodeArea_3", 6.0f, "");
}




Screenshot:

Spoiler below!
[Image: 11207641.png]



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

Also, is there a way to make the enemy bigger? I tried to change the scale but when I enter the map it is on its normal size.