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
Script Help Functions aren't functioning properly
Kazakarumariou Away
An angry man.

Posts: 283
Threads: 8
Joined: Jul 2012
Reputation: 14
#7
RE: Functions aren't functioning properly

(07-07-2012, 10:41 PM)Your Computer Wrote: For starters, it's OnStart, not Start. Secondly, the Creep function has a syntax for collision callbacks, but i couldn't find AddEntityCollideCallback anywhere in your script.
I must have confused you with the lack of script.
I'll post my entire script so far.

-----------------

void OnStart()
{
AddEntityCollideCallback("Player", "Creep", "Creep", true, 1);
AddEntityCollideCallback("Player", "Start", "Start", true, 1);
SetEntityPlayerInteractCallback("castle_gate_arched01_1", "Open", true);
SetPlayerHealth(30);
}


void Start(string &in asParent, string &in asChild, int alState)
{
PlayMusic("16_amb.ogg", true, 1, 4, 0, true);
SetEntityPlayerInteractCallback("Open", "Change", true);
SetPlayerCrouching(true);
SetPlayerActive(false);
FadeOut(0.0f);
FadeIn(12.0f);
FadeImageTrailTo(1, 2);
StartPlayerLookAt("tree_pine_59", 10, 120, "");
FadeRadialBlurTo(0.10, 2);
FadeRadialBlurTo(0.10, 2);
AddTimer("1", 3, "BeginTimer");
AddTimer("2", 4.5f, "BeginTimer");
AddTimer("3", 6.5f, "BeginTimer");
AddTimer("4", 9, "BeginTimer");
AddTimer("5", 11, "BeginTimer");
AddTimer("6", 14, "BeginTimer");
}

void BeginTimer(string &in asTimer)
{
if(asTimer == "1"){
PlayGuiSound("player_cough.snt", 0.7f);
StopPlayerLookAt();
}
else if(asTimer == "2"){
FadePlayerRollTo(85, 1, 1);
SetPlayerCrouching(true);
}
else if(asTimer == "3"){
StartPlayerLookAt("tree_pine_47", 1, 2.0f, "");
AddEffectVoice("Chat2.ogg", "", "Subtitles", "Chat2", false, "Player", 0, 0);
}
else if(asTimer == "4"){
StopPlayerLookAt();
StartPlayerLookAt("tree_pine_24", 1, 2.0f, "");
PlayGuiSound("react_breath_slow.snt", 0.7f);
}
else if(asTimer == "5"){
StopPlayerLookAt();
StartPlayerLookAt("foliage_grass01_6", 1, 2.0f, "");
}
else if(asTimer == "6"){
StopPlayerLookAt();
FadeImageTrailTo(0, 1.0f);
FadePlayerRollTo(0, 33, 33);
FadeRadialBlurTo(0.0, 1);
PlayGuiSound("react_breath_slow.snt", 0.5f);
SetPlayerActive(true);
AddEffectVoice("Chat1.ogg", "", "Subtitles", "Chat1", false, "Player", 0, 0);
SetPlayerCrouching(false);
}
}

void ScareTimer(string &in asTimer)
{
if(asTimer == "1"){
SetEntityActive("servant_brute_run_1", false);
GiveSanityDamage(5, true);
StopPlayerLookAt();
SetPlayerActive(true);
AddEffectVoice("Chat3.ogg", "", "Subtitles", "Chat3", false, "Player", 0, 0);
}
}

void Creep(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "scare_wind.snt", "Player", 0, false);
SetPlayerActive(false);
StartPlayerLookAt("tree_pine_50", 1, 252.0f, "");
SetEntityActive("servant_brute_run_1", true);
AddTimer("1", 4, "ScareTimer");
AddEnemyPatrolNode("servant_brute_run_1", "PathNodeArea_1", 1, "");
}

void Change(string& asName)
{
FadeOut(1);
CreateParticleSystemAtEntity("ParticleSystem_1", "ps_break_mansionbase_wall.ps", "Open", false);
SetEntityActive("castle_gate_arched01_1", false);
AddTimer("1", 1, "ExitTimer");
PlayGuiSound("react_breath_slow.snt", 0.7f);
}

void ExitTimer(string &in asTimer)
{
if(asTimer == "1"){
ChangeMap("02_map","Map2Start", "door_level_cistern_open.snt", "door_level_engine_close.snt");
}
}

void OnEnter()
{

}


void OnLeave()
{
SetupLoadScreen("LoadText", "01_mapLoadText", 0, "Leave1.jpg");
}


-------------------
Edit :: Oh god it looks like such a mess without the spacing.
(This post was last modified: 07-07-2012, 11:02 PM by Kazakarumariou.)
07-07-2012, 11:01 PM
Find


Messages In This Thread
RE: Loading screen text? - by Statyk - 07-06-2012, 05:09 PM
RE: Loading screen text? - by Kazakarumariou - 07-06-2012, 05:22 PM
RE: Loading screen text? - by Statyk - 07-06-2012, 05:31 PM
RE: Functions aren't functioning properly - by Kazakarumariou - 07-07-2012, 11:01 PM



Users browsing this thread: 2 Guest(s)