Frictional Games Forum (read-only)
[SCRIPT] Something wrong ? - 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] Something wrong ? (/thread-24889.html)

Pages: 1 2


Something wrong ? - Straxedix - 03-20-2014

wtf

i wan't to make a when player pick up key monster activate

.hps

SetEntityPlayerInteractCallback("Tomby1", "ActivateMonster", true);

and

void ActivateMonster(string &in asItem, string &in asEntity)
{
SetEntityActive("Alexander1", "true");
AddEnemyPatrolNode("Alexander1", "PathNodeArea_1", 0, "idle");
AddEnemyPatrolNode("Alexander1", "PathNodeArea_2", 0, "idle");
AddEnemyPatrolNode("Alexander1", "PathNodeArea_3", 0, "idle");
}



Full .hps


void OnStart()

{
AddUseItemCallback("", "Key123", "Door123", "UseKeyOnDoor", true);
AddUseItemCallback("", "Study123", "Doors122", "UseKeyOnDoor2", true);
AddEntityCollideCallback("Player", "SoundArea", "crossarea", true, 1);
SetEntityPlayerInteractCallback("Tomby1", "ActivateMonster", true);
}

void UseKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Door123", false, true);
PlaySoundAtEntity("", "unlock_door", "Door123", 0, false);
RemoveItem("Key123");
}

void UseKeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Doors122", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "Doors122", 0, false);
RemoveItem("Study123");
}

void ActivateMonster(string &in asItem, string &in asEntity)
{
SetEntityActive("Alexander1", "true");
AddEnemyPatrolNode("Alexander1", "PathNodeArea_1", 0, "idle");
AddEnemyPatrolNode("Alexander1", "PathNodeArea_2", 0, "idle");
AddEnemyPatrolNode("Alexander1", "PathNodeArea_3", 0, "idle");
}





What is problem ?????? it says something like missing void OnLeave() can set .hps how should be please?

And yeah Alexander enemy :S Tongue


RE: Something wrong ? - Mudbill - 03-20-2014

The parameters for SetEntityPlayerInteractCallback is (string &in asEntity), not (string &in asItem,string &in asEntity) as you've put.


RE: Something wrong ? - davide32 - 03-20-2014

You putted a bool on lineSad1-1) on your file hps


RE: Something wrong ? - Straxedix - 03-21-2014

(03-20-2014, 11:53 AM)Mudbill Wrote: The parameters for SetEntityPlayerInteractCallback is (string &in asEntity), not (string &in asItem,string &in asEntity) as you've put.

Still not working


RE: Something wrong ? - davide32 - 03-21-2014

Try this:
void OnStart()
{
SetEntityPlayerInterractCallback("Tomby_1", "activemonster");
}
void activemonster(string &in asEntity)
{
SetEntityActive(asEntity, true);
}


RE: Something wrong ? - Mudbill - 03-21-2014

I don't think you can use an interact callback for picking up the item because it happens before. If you go to the entity tab of the key in the editor, put a name in the EntityCallback box (hovering over it will mention OnPickup). Then change that callback in the script from being an interaction callback to just a normal callback. I think the parameters are the same as what I posted before.


RE: Something wrong ? - davide32 - 03-21-2014

Or SetEntityCallbackFunc("tomb_1', "func");
void func(string &in asEntity, string &in type)


RE: Something wrong ? - Mudbill - 03-21-2014

^ Yes, that would do the same. The parameters are indeed those: (string &in asEntity, string &in type)


RE: Something wrong ? - Straxedix - 03-21-2014

So it looks like next:
void OnStart()
SetEntityCallbackFunc("Tomby_1', "activemonster");

void activemonster(string &in asEntity)
{
SetEntityActive(asEntity, true);
}


RE: Something wrong ? - Mudbill - 03-21-2014

Dunno why you have SetEntityActive in there when you said you wanted to activate a monster. Either way you still didn't change the parameters to what I said.