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
Scripting Problems !
Itskody Offline
Member

Posts: 100
Threads: 30
Joined: Mar 2011
Reputation: 1
#3
RE: Scripting Problems !

in your hps file you have to have this


void UsedKeyOnDoorOne(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("name of door", false, true);
PlaySoundAtEntity("", "unlock_door", "name of door", 0, false);
RemoveItem("name of key");
}

The names you put there are the names of the key/door in the map editor. so the door would be like mansion_1 and the key would be like key_study_1... Get it?

and if you want to add sanity damage to your character(along with the effects) when a door is slammed or at ANY time, do this..

void ONStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "Scare", true, 1);

}

// Now add a script area in your map editor and where is says "ScriptArea_1" ABOVE, that is the name of the script in the map editor( such as key_study_1, or mansion_1). And where is says "Open" that is what YOU are choosing to call the function that will occur. You can name it what ever you want.

Now that you have the entity collide function you have to add effects to what happends when you collide with that function.

so then in your hps file you add(NOT IN THE OnStart BRACKETS BUT BELOW IT):


void Scare(string &in asParent, string &in asChild, int alState)
{
GiveSanityDamage(10, true);
}

Now this function is boring. You spice it up a bit add some noises so lets add some monster/ and player noises(some *gasps* obviously or moans from monsters.)

so add:

PlayGuiSound("amb_alert.snt", 0.5f);


and

PlayGuiSound("react_scare.snt", 0.5f);


into the function so now you have




void Scare(string &in asParent, string &in asChild, int alState)
{
GiveSanityDamage(10, true);
PlayGuiSound("amb_alert.snt", 0.5f);

PlayGuiSound("react_scare.snt", 0.5f);
}

If you have any more questions then just ask.
Hope this helped and this function is only good for when you walk through the script created on the hps map editor. if you want to know how to make effects when touching something or when a monster touches something or anything then just ask.
09-12-2011, 06:04 PM
Find


Messages In This Thread
Scripting Problems ! - by AmnesiaIsScary :S - 09-12-2011, 02:39 PM
RE: Scripting Problems ! - by Obliviator27 - 09-12-2011, 05:52 PM
RE: Scripting Problems ! - by Itskody - 09-12-2011, 06:04 PM
RE: Scripting Problems ! - by AmnesiaIsScary :S - 09-13-2011, 07:40 PM
RE: Scripting Problems ! - by Itskody - 09-13-2011, 08:02 PM
RE: Scripting Problems ! - by AmnesiaIsScary :S - 09-13-2011, 08:19 PM
RE: Scripting Problems ! - by Itskody - 09-14-2011, 12:35 AM
RE: Scripting Problems ! - by AmnesiaIsScary :S - 09-14-2011, 05:52 AM
RE: Scripting Problems ! - by AmnesiaIsScary :S - 09-14-2011, 04:10 PM
RE: Scripting Problems ! - by Your Computer - 09-14-2011, 04:24 PM
RE: Scripting Problems ! - by AmnesiaIsScary :S - 09-14-2011, 05:16 PM
RE: Scripting Problems ! - by Your Computer - 09-14-2011, 05:22 PM
RE: Scripting Problems ! - by AmnesiaIsScary :S - 09-14-2011, 05:25 PM



Users browsing this thread: 3 Guest(s)