(03-21-2012, 06:01 PM)Fozzarn Wrote: Hi, so i saw the Activate Enemy on Item Pickup guide, but i wonder can u activate props? like statues? I tried , and no error is given when launching Amnesia, but when i pick up the key nothing happens...
I do have lots of other scripts working, so i know that i placed SetEntity, void OnPickup and dat shit on the right place. below is NOT my whole hps file, only the lines needed. I am also sure dat my key name is "key4"
Heres my Hps:
SetEntityCallbackFunc("key_4", "OnPickup");
void OnPickup(string &in asEntity, string &in type)
{
SetEntityActive("ac1", true);
SetEntityActive("ac2", true);
SetEntityActive("ac3", true);
SetEntityActive("ac4", true);
SetEntityActive("ac5", true);
SetEntityActive("ac6", true);
SetEntityActive("ac7", true);
SetEntityActive("ac8", true);
SetEntityActive("bt1", true);
SetEntityActive("bt2", true);
SetEntityActive("bt3", true);
SetEntityActive("bt4", true);
GiveSanityDamage(10.0f, true);
PlaySoundAtEntity("", "00_laugh.snt", "Player", 0, false);
}
this is just a wild guess... really i,ve never tried it myself.
but you could try to replace the " SetEntityCallbackFunc " with "SetEntityPlayerInteractCallback"
here is what the engine scripts page says about that
void SetEntityPlayerInteractCallback(string& asName, string& asCallback, bool abRemoveOnInteraction);
Calls a function when the player interacts with a certain entity.
Callback
syntax:
void MyFunc(string &in asEntity)
asName - internal name
asCallback - function to
call
abRemoveOnInteraction - determines whether the callback should
be removed when the player interacts with the entity
good luck