The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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
What is wrong with this script! (SOLVED)
Henriksen Offline
Senior Member

Posts: 308
Threads: 71
Joined: Dec 2010
Reputation: 2
#1
Question  What is wrong with this script! (SOLVED)

Hi.

Im trying to get the player look at something when he enters a specific area.
But the problem is that im a totally noob at scripting so could somebody see what is wrong with my script?

If you find out whats wrong could you please post the entire fixed script?

Here is the full script:

////////////////////////////
// Run first time start[/color]ing map
void OnStart()
{
AddEntityCollideCallback("Player", "Scare1", "LookAtDoor", true, 0);
AddUseItemCallback("", "Key1", "Unlock1", "UsedKeyOnDoor1", true);
FadeOut(0);
FadeIn(20);
FadeImageTrailTo(2, 2);
FadeSepiaColorTo(100, 4);
SetPlayerActive(false);
FadePlayerRollTo(50, 220, 220);
FadeRadialBlurTo(0.15, 2);
SetPlayerCrouching(true);
AddTimer("trig1", 11.0f, "beginStory");
}

void beginStory(string &in asTimer)
{
ChangePlayerStateToNormal();
SetPlayerActive(true);
FadePlayerRollTo(0, 33, 33);
FadeRadialBlurTo(0.0, 1);
FadeSepiaColorTo(0, 4);
SetPlayerCrouching(false);
FadeImageTrailTo(0,1);
}

void UsedKeyOnDoor1(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Unlock1", false, true);
PlaySoundAtEntity("", "unlock_door", "Unlock1", 0, false);
RemoveItem("Key1");
PlayMusic("02_puzzle.ogg", false, 0.7, 0.1, 10, true);
RemoveItem("Key1");
GiveSanityBoost();
}

void Lookatdoor(string &in asTimer)
{
if(asTimer == "Lookatdoor_01")
{
StartPlayerLookAt("castle_1",2.0f,5.0f,"");
AddTimer("Lookatdoor_02",1.5f,"Lookatdoor");
}

if(asTimer == "Lookatdoor_02")
{
StopPlayerLookAt();
}
}

// Run when entering map
void OnEnter()
{
PlayMusic("27_paper_daniel01.ogg", true, 1.0f, 0, 0, true);
}


////////////////////////////
// Run when leaving map
void OnLeave()
{

}
(This post was last modified: 02-13-2011, 02:42 PM by Henriksen.)
02-12-2011, 04:54 PM
Find


Messages In This Thread
What is wrong with this script! (SOLVED) - by Henriksen - 02-12-2011, 04:54 PM
RE: What is wrong with this script! - by Akasu - 02-12-2011, 07:38 PM
RE: What is wrong with this script! - by Akasu - 02-12-2011, 11:05 PM



Users browsing this thread: 1 Guest(s)