Aquatric
Junior Member
Posts: 7
Threads: 2
Joined: Dec 2012
Reputation:
0
|
My script doesn't work in my map.
Alright, this is the 2nd post today haha, I am a big newbie LOL. So I've tried in 2 days now to make my script to work, the 00_castle.hps. It still doesn't work. I've tried everything, I made Script Areas in the Level editor named them and everything, I copy and pasted from wiki.. Nothing happends, I can only play on the map just running around opening doors, it's no crash.
Here is my script:
Quote:void OnStart()
{
AddUseItemCallback("", "key_1", "castle_arched01_1", "UsedKeyOnDoor", true);
SetEntityPlayerInteractCallback("monster_key", "ActivateMonster", true);
AddEntityCollideCallback("Player", "push", "Push", true, 1);
AddEntityCollideCallback("Player", "door_slam", "Slam", true, 1);
AddEntityCollideCallback("Player", "explode_scare", "Explode", true, 1);
PlaySoundAtEntity("", "introvoice.ogg.snt", "introvoice", 1, false);
}
void Explode(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("pot_explode", 0);
}
void Push(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "react_pant.snt", "push", 0, false);
AddPlayerBodyForce(30000, 0, 0, false);
}
void Slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("castle_1", true, true);
SetSwingDoorLocked("castle_1", true, true);
PlaySoundAtEntity("", "00_laugh.snt", "door_scare", 0, false);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "unlock_door", asEntity, 0, false);
RemoveItem(asItem);
}
void OnEnter()
{
PlayMusic("introvoice.ogg", true, 0.9, 1.0, 1, true);
}
void OnLeave()
{
StopMusic(1 , 1);
}
Please help, I need help with the Sound and unlocking doors aswell. Both of them doesn't work. Please help!
|
|