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
Script Help Script won't work
i3670 Offline
Posting Freak

Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation: 36
#1
Script won't work

Workin' on a script atm. Half of the lever script works except for the "SetMoveObjectState("PORTNAME", 0);"s. But the real problem is the graveyard script and spike tunnel script neither of which will work i.e. nothing happens.

Spoiler below!

void OnStart()
{
ConnectEntities("D", "lever_simple01", "castle_portcullis_1", true, -1, "PortOpen1");
ConnectEntities("E", "lever_simple02", "castle_portcullis_2", true, -1, "PortOpen2");
ConnectEntities("F", "lever_simple03", "castle_portcullis_3", true, -1, "PortOpen3");

AddEntityCollideCallback("Player", "GraveArea_1", "Grave1", true, 1);
AddEntityCollideCallback("Player", "GraveArea_2", "Grave2", true, 1);
AddEntityCollideCallback("Player", "GraveArea_3", "Grave3", true, 1);
AddEntityCollideCallback("Player", "GraveArea_4", "Grave4", true, 1);


for(int i=1;i<=3;i++)
AddEntityCollideCallback("Player", "WhisperArea_"+i, "WhisperTunnel", true, 1);

SetEntityPlayerLookAtCallback("GraceAreaCorpse_1", "CorpseDisappear1", true);
SetEntityPlayerLookAtCallback("GraceAreaCorpse_2", "CorpseDisappear2", true);
}

///////Insanity Event///////
///Ports///
void PortOpen1(string &in asConnectionName, string &in asMainEntity, string &in asConnectEntity, int alState)
{
SetLeverStuckState(asMainEntity, -1, true);
SetMoveObjectState("castle_portcullis_1", 1);
SetMoveObjectState("castle_portcullis_2", 0);
SetMoveObjectState("castle_portcullis_3", 0);
SetLeverStuckState("lever_simple01", 0, true);
}

void PortOpen2(string &in asConnectionName, string &in asMainEntity, string &in asConnectEntity, int alState)
{
SetLeverStuckState(asMainEntity, -1, true);
SetMoveObjectState("castle_portcullis_2", 1);
SetMoveObjectState("castle_portcullis_1", 0);
SetMoveObjectState("castle_portcullis_3", 0);
SetLeverStuckState("lever_simple02", 0, true);
}

void PortOpen3(string &in asConnectionName, string &in asMainEntity, string &in asConnectEntity, int alState)
{
SetLeverStuckState(asMainEntity, -1, true);
SetMoveObjectState("castle_portcullis_3", 1);
SetMoveObjectState("castle_portcullis_2", 0);
SetMoveObjectState("castle_portcullis_1", 0);
SetLeverStuckState("lever_simple03", 0, true);
}


///Ports End///

///Graveyard///

void Grave1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("GraceAreaCorpse_1", true);

AddLocalVarInt("Var1", 1);
func5();
}

void Grave2(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("GraceAreaCorpse_2", true);

AddLocalVarInt("Var1", 1);
func5();
}

void Grave3(string &in asParent, string &in asChild, int alState)
{

AddLocalVarInt("Var1", 1);
func5();
}

void Grave4(string &in asParent, string &in asChild, int alState)
{

AddLocalVarInt("Var1", 1);
func5();
}

void func5()
{
if(GetLocalVarInt("Var1") == 4)
{
SetEntityActive("coffin_dirty_3", true);
SetEntityActive("Flask_03", true);
}
}

void CorpseDisappear1(string &in asEntity, int alState)
{
if (alState == 1)
{
SetPropActiveAndFade("graveyard_corpse03_1", false, 0.5f);
StartScreenShake(0.1f, 0, 0.1, 0.1);
PlayGuiSound("sanity_flick.snt", 0.5f);
PlayGuiSound("scare_wall_scratch_single.snt", 1);
PlayGuiSound("react_breath.snt", 1);
}
}

void CorpseDisappear2(string &in asEntity, int alState)
{
if (alState == 1)
{
SetPropActiveAndFade("graveyard_corpse02_1", false, 0.5f);
StartScreenShake(0.1f, 0, 0.1, 0.1);
PlayGuiSound("sanity_flick.snt", 0.5f);
PlayGuiSound("scare_wall_scratch_single.snt", 1);
PlayGuiSound("react_breath.snt", 1);
}
}
///Graveyard End///

///Spike Tunnel///
void WhisperTunnel(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "insanity_whisper.snt", "Player", 1.0f, false);
}

///Spike Tunnel End///

void OnEnter()
{

}

void OnLeave()
{

}


EDIT: All areas and entities have the correct names.

"What you think is irrelevant" - A character of our time

A Christmas Hunt
(This post was last modified: 07-29-2012, 02:37 PM by i3670.)
07-29-2012, 02:05 PM
Find


Messages In This Thread
Script won't work - by i3670 - 07-29-2012, 02:05 PM
RE: Script won't work - by Adny - 07-29-2012, 02:32 PM
RE: Script won't work - by i3670 - 07-29-2012, 02:42 PM
RE: Script won't work - by Adny - 07-29-2012, 02:45 PM
RE: Script won't work - by i3670 - 07-29-2012, 06:07 PM



Users browsing this thread: 1 Guest(s)