I'm trying to refresh my memory with this scripting business, but I seem to forgotten a lot more than I thought I had, I'm trying to mess around with a small room I made, adding objects and scripting different events with them (Play sound, screen shake and so on).
But I can't seem to get GivePlayerDamage right, I'm tried going by what it says on here;
http://wiki.frictionalgames.com/hpl2/amn..._functions
but it doesn't help me, I'm still struggling to understand it. I know I would be told to look at the wiki tutorials but they explain it in a way I don't understand.
I'm trying to "kill" the player when he picked up a tomb key. The only thing that confuses me is writing in these;
(string &in asParent, string &in asChild, int alState)
or
(string &in item)
I have no idea where or when to write them or what they are needed for, I'm trying to remind myself from my old script that I made when I used it for a uni project a long time but it's not helping.
Here is what I have so far;
void OnStart()
{
SetEntityPlayerInteractCallback("key_tomb_1", "DieWhenPickUp", true);
SetEntityPlayerInteractCallback("crowbar_1", "PickUpBar", true);
}
//Plays a sound and shakes the player's screen upon pick up
void PickUpBar(string &in item)
{
PlaySoundAtEntity("", "04_scream.snt", "Player", 0, false);
StartScreenShake(0.08f, 3.0f, 0.1f, 0.02f);
}
//Kills player when key is picked up
void DieWhenPickUp(string &in item)
{
GivePlayerDamage("200", "BloodSplat", "0", "01);
}
Can anyone explain this to me please? I would really appreciate it and make me stop having to run to the forum for every single script command that doesn't work.