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
Why doesn't this script work? plz help
pdkgaming Offline
Junior Member

Posts: 16
Threads: 3
Joined: Jun 2012
Reputation: 0
#1
Why doesn't this script work? plz help

Hi all,

I'm kinda stuck at a part of scripting.. again >.<
I've made another thread but I don't think that one is needed anymore..
So the problem is.. I want the player to look at 3 entities when you enter an area. When it enters the area though, it only looks at one entity (first one in script) and keeps staring at it.. Does anybody see the problem?
And is my script even right? In theory it should work (I think).

Here's my script part:


void LookAt(string &in asTimer)
{
AddTimer("LookAt1", 2, "Sanity");
}

void Sanity(string &in asTimer)
{
if (LookAt1 == 2);
{
StartPlayerLookAt("corpse_male_torso_1", 100, 100, ""};
}
if (LookAt1 == 6);
{
StartPlayerLookAt("chest_of_drawers_nice_broken_1", 100, 100, "");
}
if (LookAt1 == 4);
{
StartPlayerLookAt("painting03_1", 100, 100, "");
}
if (LookAt1 == 0);
{
SetPlayerSanity(0);
}
}

THANKS Big Grin

Map tester
CS creator (beginner)
Youtube:
http://www.youtube.com/pdkgaming
06-18-2012, 09:30 PM
Website Find
Rownbear Offline
Member

Posts: 157
Threads: 13
Joined: Apr 2011
Reputation: 2
#2
RE: Why doesn't this script work? plz help

I have no idea what you were scripting there but I would have had the player look at the 1st item, then 2nd and last by using timers over again something like

void LookAt(string &in asTimer)
{
AddTimer("LookAt1", 2, "Sanity");
}

void Sanity(string &in asTimer)
{
StartPlayerLookAt("corpse_male_torso_1", 100, 100, ""};
AddTimer("LookAt2", 2, "Sanity2");
}

void Sanity2(string &in asTimer)
{
StartPlayerLookAt("chest_of_drawers_nice_broken_1", 100, 100, "");
AddTimer("LookAt3", 2, "Sanity3");
}

void Sanity3(string &in asTimer)
{
StartPlayerLookAt("painting03_1", 100, 100, "");
AddTimer("Timer", 0.5, "StopLookAt1");
}

void StopLookAt1(string&in asTimer)
{
StopPlayerLookAt();
}

06-18-2012, 10:07 PM
Find
pdkgaming Offline
Junior Member

Posts: 16
Threads: 3
Joined: Jun 2012
Reputation: 0
#3
RE: Why doesn't this script work? plz help

(06-18-2012, 10:07 PM)Rownbear Wrote: I have no idea what you were scripting there but I would have had the player look at the 1st item, then 2nd and last by using timers over again something like

void LookAt(string &in asTimer)
{
AddTimer("LookAt1", 2, "Sanity");
}

void Sanity(string &in asTimer)
{
StartPlayerLookAt("corpse_male_torso_1", 100, 100, ""};
AddTimer("LookAt2", 2, "Sanity2");
}

void Sanity2(string &in asTimer)
{
StartPlayerLookAt("chest_of_drawers_nice_broken_1", 100, 100, "");
AddTimer("LookAt3", 2, "Sanity3");
}

void Sanity3(string &in asTimer)
{
StartPlayerLookAt("painting03_1", 100, 100, "");
AddTimer("Timer", 0.5, "StopLookAt1");
}

void StopLookAt1(string&in asTimer)
{
StopPlayerLookAt();
}
Didn't work for me.. got a big load of errors.. I'll try figuring it out tomorrow. Thanks Smile

Map tester
CS creator (beginner)
Youtube:
http://www.youtube.com/pdkgaming
06-18-2012, 10:13 PM
Website Find




Users browsing this thread: 1 Guest(s)