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
Need help making the character look at a door and sanity goes down.
ZxBrad Offline
Member

Posts: 140
Threads: 29
Joined: Mar 2011
Reputation: 0
#1
Need help making the character look at a door and sanity goes down.

I just want my character to spin around and look at the door. I already got that but i want him to get scared and have a little bit of sanity go down. Also i need to know how to make him stop focusing on the door after he spins around.


Spoiler below!
////////////////////////////
// Run first time starting map
void OnStart()

{
SetMessage("Journal", "start", 8.0f);
AddUseItemCallback("", "doorkey_1", "castle_1", "UsedKeyOnDoor", true);
AddUseItemCallback("", "exitkey_1", "metal_1", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player" , "ScriptArea_1" , "MonsterFunc1" , true , 1);
AddEntityCollideCallback("Player", "doorslam", "Collidedoorslam", true, 1);
}

void Collidedoorslam(string &in asParent, string &in asChild, int alState)

{
StartPlayerLookAt("castle_2", 6, 8, "");
SetSwingDoorClosed("castle_2", true, true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)

{
SetSwingDoorLocked("castle_1", false, true);
PlaySoundAtEntity("", "unlock_door", "castle_1", 0, false);
RemoveItem("doorkey_1");
SetSwingDoorLocked("metal_1", false, true);
PlaySoundAtEntity("", "unlock_door", "metal_1", 0, false);
RemoveItem("exitkey_1");
}

void MonsterFunc1(string &in asParent , string &in asChild , int alState)

{
SetEntityActive("servant_grunt_1" , true);
}



WARNING: Noob Doesn't Know How To Script.
[Image: xcn384.gif]

04-12-2011, 09:25 PM
Find
Dalroc Offline
Member

Posts: 57
Threads: 2
Joined: Mar 2011
Reputation: 0
#2
RE: Need help making the character look at a door and sanity goes down.

Add a PlaySoundAtEntity to Collidedoorslam to make the Player gasp, then add a GiveSanityDamage to remove some sanity.
Then use AddTimer to call a function that includes a StopPlayerLookAt.
04-12-2011, 09:38 PM
Find
ZxBrad Offline
Member

Posts: 140
Threads: 29
Joined: Mar 2011
Reputation: 0
#3
RE: Need help making the character look at a door and sanity goes down.

(04-12-2011, 09:38 PM)Dalroc Wrote: Add a PlaySoundAtEntity to Collidedoorslam to make the Player gasp, then add a GiveSanityDamage to remove some sanity.
Then use AddTimer to call a function that includes a StopPlayerLookAt.

o.....ok. Thx but wat would i write for the timer mijigger and the stop playerlookat.

WARNING: Noob Doesn't Know How To Script.
[Image: xcn384.gif]

04-12-2011, 09:50 PM
Find




Users browsing this thread: 1 Guest(s)