clock123
Member
Posts: 76
Threads: 18
Joined: Jul 2011
Reputation:
0
RE: Paper Blow
Wait.... What I have to write in what?, Here's the things I did in pictures, and the script.:
The pictures :
http://imageshack.us/g/11/bhhghg.png/
The script:
Spoiler below!
void OnStart()
{
AddEntityCollideCallback("Player", "AreaActivate", "CollideAreaActivate", true, 1);
SetEntityConnectionStateChangeCallback("Lever1", "func_shelf");
AddUseItemCallback("", "Key1", "Door1", "KeyOnDoor", true);
AddUseItemCallback("", "Key2", "Door2", "KeyOnDoor2", true);
}
void func_shelf(string &in asEntity, int alState)
{
if (alState == 1)
{
SetMoveObjectState("Shelf1",1.0f);
PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false);
return;
}
}
void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Door1", false, true);
PlaySoundAtEntity("", "unlock_door", "Door1", 0, false);
RemoveItem("Key1");
}
void KeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Door2", false, true);
PlaySoundAtEntity("", "unlock_door", "door2", 0, false);
RemoveItem("Key2");
}
void CollideAreaActivate(string &in asParent, string &in asChild, int alState)
{
AddTimer("blowpaper", 1.0f, "TimerPaperBlow"); //Without a timer the sound wouldn't fit.
PlaySoundAtEntity("windsound", "scare_wind_reverse", "AreaBlow", 1.0f, false);
}
void TimerPaperBlow(string &in asTimer)
{
CreateParticleSystemAtEntity("paper", "ps_paper_blow.ps", "AreaBlow", false);
}
I know I need to put the script in the hps file, but I just dont know what to do with what, I mean, what name's to input in what, etc'. if someone can just help me about this I will thank him