Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with hps script! (OnPickup)
pandasFTW Offline
Member

Posts: 71
Threads: 21
Joined: Feb 2012
Reputation: 2
#3
RE: Help with hps script! (OnPickup)

(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 Smile

03-21-2012, 06:17 PM
Find


Messages In This Thread
Help with hps script! (OnPickup) - by Fozzarn - 03-21-2012, 06:01 PM
RE: Help with hps script! (OnPickup) - by Statyk - 03-21-2012, 06:07 PM
RE: Help with hps script! (OnPickup) - by pandasFTW - 03-21-2012, 06:17 PM
RE: Help with hps script! (OnPickup) - by Fozzarn - 03-21-2012, 06:29 PM
RE: Help with hps script! (OnPickup) - by Fozzarn - 03-21-2012, 06:37 PM



Users browsing this thread: 1 Guest(s)