Frictional Games Forum (read-only)
AddEntityCollideCallBack(): Support Needed! - 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: AddEntityCollideCallBack(): Support Needed! (/thread-16298.html)



AddEntityCollideCallBack(): Support Needed! - Watskeeee - 06-19-2012

void OnStart()
{
AddUseItemCallback("", "key01", "doorroom01", "KeyOnDoor", true);
AddUseItemCallback("", "key02", "doorroom02", "KeyOnDoor", true);
AddEntityCollideCallback("Player","RoomofSecretsArea","CollideRoomTwo","true", 1);
}

void CollideRoomTwo(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("doorroom01", true, true);
}


void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("doorroom01", false, true);
PlaySoundAtEntity("", "unlock_door", "doorroom01", 0, false);
RemoveItem("key01");
}


void keyfunc(string &in asEntity, string &in type)
{
SetEntityActive("servant_brute_1", true);
StartPlayerLookAt("servant_brute_1", 15, 15, "");
AddTimer("monstertimer", 2, "monstertimer");
ShowEnemyPlayerPosition("servant_brute_1");

}


void monstertimer(string &in asTimer)
{
StopPlayerLookAt();
}


Trying to make the door shut behind me, yet it comes up with the error;

FATAL ERROR: Could not load script file 'custom_stories/Amnesia - Hour of Twilight/maps/00_example.hps'!
main (5,1): ERR: No matching signatures to
'AddEntityCollideCallBack(string@&, string@&, string@&,const uint)'

Tried for an hours or two to fix this and no progress has been made..


RE: AddEntityCollideCallBack(): Support Needed! - Datguy5 - 06-19-2012

make sure the hps and the map have the same name.


RE: AddEntityCollideCallBack(): Support Needed! - Watskeeee - 06-19-2012

Yep, They have the exact same name.
00_example.hps
00_example.map


RE: AddEntityCollideCallBack(): Support Needed! - Cruzore - 06-19-2012

AddEntityCollideCallback("Player","RoomofSecretsArea","CollideRoomTwo","true", 1);
true is inside ".


RE: AddEntityCollideCallBack(): Support Needed! - Rownbear - 06-19-2012

AddUseItemCallback("", "key01", "doorroom01", "KeyOnDoor", true);

AddUseItemCallback("", "key02", "doorroom02", "KeyOnDoor", true);

they both call the same function


RE: AddEntityCollideCallBack(): Support Needed! - Watskeeee - 06-19-2012

(06-19-2012, 03:32 PM)FastHunteR Wrote: AddEntityCollideCallback("Player","RoomofSecretsArea","CollideRoomTwo","true", 1);
true is inside ".
Thanks, I dunno why I didn't predict that was the problem, tried everything other than that! TongueTongue


RE: AddEntityCollideCallBack(): Support Needed! - Cruzore - 06-19-2012

(06-19-2012, 03:41 PM)Rownbear Wrote: AddUseItemCallback("", "key01", "doorroom01", "KeyOnDoor", true);

AddUseItemCallback("", "key02", "doorroom02", "KeyOnDoor", true);

they both call the same function
Many functions for keys opening doors are short because you use the same function. That ain't a problem, as long as asEntity and asItem are used, which is wrong here too.


RE: AddEntityCollideCallBack(): Support Needed! - SilentHideButFine - 06-20-2012

void OnStart()
{
AddUseItemCallback("", "key01", "doorroom01", "KeyOnDoor", true);
AddUseItemCallback("", "key02", "doorroom02", "KeyOnDoor1", true);
AddEntityCollideCallback("Player","RoomofSecretsArea","CollideRoomTwo",true, 1);
}

void CollideRoomTwo(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("doorroom01", true, true);
}


void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("doorroom01", false, true);
PlaySoundAtEntity("", "unlock_door", "doorroom01", 0, false);
RemoveItem("key01");
}


void keyfunc(string &in asEntity, string &in type)
{
SetEntityActive("servant_brute_1", true);
StartPlayerLookAt("servant_brute_1", 15, 15, "");
AddTimer("monstertimer", 2, "monstertimer");
ShowEnemyPlayerPosition("servant_brute_1");

}


void monstertimer(string &in asTimer)
{
StopPlayerLookAt();
}


RE: AddEntityCollideCallBack(): Support Needed! - Stepper321 - 06-20-2012

No, you are doing it wrong again. Just. Put the same functions of Key 1 and Key 2.
But then, instead of "doorroom01" put in asEntity.
And at PlaySound instead of "doorroom01" you do asEntity
and at RemoveItem asItem.
This will make it remove the item that you used. Cause that's the String that it found. And the Entity too. If you don't know what the fuck I'm saying, read trough and see what I changed in your script.
PHP Code:
void OnStart(){
AddUseItemCallback("""key01""doorroom01""KeyOnDoor"true);
AddUseItemCallback("""key02""doorroom02""KeyOnDoor"true);
AddEntityCollideCallback("Player","RoomofSecretsArea","CollideRoomTwo",true1);
}

void CollideRoomTwo(string &in asParentstring &in asChildint alState
{
SetSwingDoorClosed("doorroom01"truetrue);
}


void KeyOnDoor(string &in asItemstring &in asEntity)
{
SetSwingDoorLocked(asEntityfalsetrue);
PlaySoundAtEntity("""unlock_door"asEntity 0false);
RemoveItem(asItem);
}


void keyfunc(string &in asEntitystring &in type)
{
SetEntityActive("servant_brute_1"true);
StartPlayerLookAt("servant_brute_1"1515"");
AddTimer(""2"monstertimer");
ShowEnemyPlayerPosition("servant_brute_1");

}


void monstertimer(string &in asTimer)
{
StopPlayerLookAt();