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
Having a slight problem...
TrollingForever Offline
Junior Member

Posts: 9
Threads: 2
Joined: Apr 2013
Reputation: 0
#3
RE: Having a slight problem...

(04-23-2013, 04:54 PM)Mr Credits Wrote: Try doing something like this:

PHP Code: (Select All)
OnStart()
{

//Sets up variable
SetLocalVarInt("OrbCheck",0);

}

...

void TurnRed()
{
...
//Adds local variable, checks if the other knife has been used
AddLocalVarInt("OrbCheck",1);
OrbCheckFunction();
}

void TurnRed2()
{
...
//Adds local variable, checks if other knife has been used
AddLocalVarInt("OrbCheck",1);
OrbCheckFunction();
}

void OrbCheckFunction()
{
//This function checks if both knives have been used
if(GetLocalVarInt("OrbCheck") == 2)
{
SetEntityActve("Orb",true);
}



Eh, that looks pretty rough and I haven't tested, but I hope it gives you a general idea.

Thanks for the reply! I think I did not fully understand you. Do I have to put the SetLocalVarInt in OnStart like this:

void OnStart()
{
    AddEntityCollideCallback("Player", "end_script", "FadeOut", true, 1);
    AddEntityCollideCallback("Player", "Start_lookat", "LookAtBodies", true, 1);
    AddEntityCollideCallback("Player", "Start_wakeup", "WakeDaFuckUp", true, 1);
    AddEntityCollideCallback("Player", "Start_music", "StartDaMusic", true, 1);
    AddEntityCollideCallback("Player", "Activate_Scary", "StartScary", true, 1);
    SetLocalVarInt("OrbCheck",0);    
    InteractConnectPropWithMoveObject("leverSlideDoor", "level_open_slide", "safety_normal_vert_1", true, false, 0);
}

Also, if you need it, here is my entire .hps (you can ignore the CollideCallbacks, it`s not connected to this):

////////////////////////////
// Run when the map starts
void OnStart()
{
    AddEntityCollideCallback("Player", "end_script", "FadeOut", true, 1);
    AddEntityCollideCallback("Player", "Start_lookat", "LookAtBodies", true, 1);
    AddEntityCollideCallback("Player", "Start_wakeup", "WakeDaFuckUp", true, 1);
    AddEntityCollideCallback("Player", "Start_music", "StartDaMusic", true, 1);
    AddEntityCollideCallback("Player", "Activate_Scary", "StartScary", true, 1);
    InteractConnectPropWithMoveObject("leverSlideDoor", "level_open_slide", "safety_normal_vert_1", true, false, 0);
}

void OpenWind(string &in asEntity, int alState)

{
    AddTimer("Start", 4.0f, "OpenWind2");
}

void OpenWind2(string &in asTimer)

{
if(GetSwingDoorClosed("castle_1"))  //Checks to see if the door is closed.
      {
       AddTimer("Start", 4.0f, "");
       SetSwingDoorDisableAutoClose("castle_1", true);  //This will stop the door from closing as soon as it opens.
       SetSwingDoorClosed("castle_1", false, true);  //This opens the door so that the force will do something, and not act like throwing a book at a closed door.
      
       AddPropForce("castle_1", 0, 0, 460, "world");
       CreateParticleSystemAtEntity("", "ps_dust_ghost.ps", "castle_1", false);
       }      
}

void TurnRed2(string &in asEntity)

{
    SetEntityActive("special_altar_static_knife_4", false);
    SetEntityActive("special_altar_static_knife_5", true);
    GivePlayerDamage(5.0f, "BloodSplat", false, false);
}

void TurnRed(string &in asEntity)

{
    SetEntityActive("special_altar_static_knife_2", false);
    SetEntityActive("special_altar_static_knife_3", true);
    GivePlayerDamage(5.0f, "BloodSplat", false, false);
}

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

{
    PlaySoundAtEntity("fountain", "guardian_activated.snt", "Player", 0, false);
    StartPlayerLookAt("fountain_childsnake_blood_1", 10, 15, "");
    StartScreenShake(0.5f, 3, 1, 2);    
    StopMusic(2, 3);
    StartEffectFlash(3, 1.0, 2);
    AddTimer("Stop", 5.0f, "StopLook");
    
}

void StopLook(string &in asTimer)

{  
    PlayMusic("evilpart.ogg", true, 0.8, 2.0f, 3, false);
    StopPlayerLookAt();    
}    

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

{
    PlayMusic("evilpart.ogg", true, 0.8, 2.0f, 3, false);
}

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

{
    FadePlayerRollTo(80, 500, 500);
}

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

{
    StartPlayerLookAt("hanging_prisoner_1", 2, 4, "");
    AddTimer("StopDaLookMan", 5.0f, "StopDaLook");
    PlaySoundAtEntity("", "scare_breath.snt", "Player", 0, false);
    SetPlayerMoveSpeedMul(0);
}

void StopDaLook(string &in asTimer)

{
    StopPlayerLookAt();
    SetPlayerMoveSpeedMul(1);
}

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

{
FadeOut(2);
AddTimer("", 2, "StopMusic");
AddTimer("", 5, "AddMessage");
FadeGlobalSoundVolume(0, 3);
}

void StopMusic(string &in asTimer)
{
StopMusic(1, 0);
}

void AddMessage(string &in asTimer)
{
SetMessage("Messages", "FinishStory", 10);
AddTimer("", 10, "FadeOut2");
SetPlayerActive(false);
}

void FadeOut2(string &in asTimer)
{
FadeOut(3);
AddTimer("", 3, "StartCredits");
}

void StartCredits(string &in asTimer)
{
FadeGlobalSoundVolume(100, 2);
StartCredits("end_music.ogg", false, "Ending", "MainCredits", 5);
}
////////////////////////////
// Run when entering map
void OnEnter()
{  
if(ScriptDebugOn())
    {
        AddTimer("TimerEIntro", 0.25f, "TimerEIntro");
    }
    else
    {
        AddTimer("TimerEIntro", 0.25f, "TimerEIntro");
    }
}

void TimerEIntro(string &in asTimer)
{
    int iMaxEventStep = 16;
    float fEventSpeed = 1.0f;
    string sEvent = asTimer;

    AddLocalVarInt(sEvent, 1);

    switch(GetLocalVarInt(sEvent)){
        case 1:
            FadeIn(2.0f);
            CreateParticleSystemAtEntity("dust", "ps_dust_elevator_crash.ps", "AreaDust", false);
            PlaySoundAtEntity("breath1", "react_breath_slow", "Player", 0.5f, false);
            StartPlayerLookAt("AreaLook_2", 1.2f, 1.2f, "");
            MovePlayerHeadPos(0.0f, -0.8f, 0.5f, 0.8f, 0.8f);
            FadePlayerRollTo(-30.0f, 2.0f, 2.0f);
            PlayMusic("15_event_elevator.ogg", false, 1.0f, 0.5f, 10, false);
            fEventSpeed = 1.0f;
        break;
        case 2:
            SetPlayerActive(true);
            PlaySoundAtEntity("cloth1", "player_crouch", "Player", 0.2f, false);
            SetPlayerMoveSpeedMul(0.05f);
            SetPlayerRunSpeedMul(0.05f);
            SetPlayerLookSpeedMul(0.05f);
            MovePlayerHeadPos(0.0f, -0.8f, -0.5, 1.2f, 1.2f);
            fEventSpeed = 1.0f;
        break;
        case 3:
            FadePlayerRollTo(30.0f, 6.0f, 6.0f);
            SetPlayerMoveSpeedMul(0.1f);
            SetPlayerRunSpeedMul(0.1f);
            SetPlayerLookSpeedMul(0.1f);
            StartPlayerLookAt("AreaLook_3", 0.5f, 0.5f, "");
            SetPlayerLookSpeedMul(0.2f);
            fEventSpeed = 2.0f;
        break;
        case 4:
            SetPlayerMoveSpeedMul(0.15f);
            SetPlayerRunSpeedMul(0.15f);
            SetPlayerLookSpeedMul(0.15f);
            FadeOut(5.0f);
            PlaySoundAtEntity("sight1", "react_sigh", "Player", 0.5f, false);
            StartPlayerLookAt("AreaLook_1", 0.5f, 0.5f, "");
            FadePlayerRollTo(-30.0f, 10.0f, 10.0f);
            fEventSpeed = 0.5f;
        break;
        case 5:
            PlaySoundAtEntity("cloth2", "player_climb", "Player", 0.2f, false);
            SetPlayerMoveSpeedMul(0.2f);
            SetPlayerRunSpeedMul(0.2f);
            SetPlayerLookSpeedMul(0.2f);
            MovePlayerHeadPos(0.0f, -0.5f, -0.25f, 0.5f, 0.5f);
            fEventSpeed = 0.5f;
        break;
        case 6:
            SetPlayerMoveSpeedMul(0.25f);
            SetPlayerRunSpeedMul(0.25f);
            SetPlayerLookSpeedMul(0.25f);
            FadePlayerRollTo(0.0f, 15.0f, 15.0f);
            fEventSpeed = 2.0f;
        break;
        case 7:
            PlaySoundAtEntity("sight2", "react_sigh", "Player", 0.4f, false);
            SetPlayerMoveSpeedMul(0.3f);
            SetPlayerRunSpeedMul(0.3f);
            SetPlayerLookSpeedMul(0.3f);
            FadeIn(2.0f);
            FadePlayerRollTo(30.0f, 8.0f, 8.0f);
            MovePlayerHeadPos(0.0f, -0.8f, -0.5f, 0.7f, 0.5f);
            PlaySoundAtEntity("cloth3", "player_crouch", "Player", 0.2f, false);
        break;
        case 8:
            SetPlayerMoveSpeedMul(0.35f);
            SetPlayerRunSpeedMul(0.35f);
            SetPlayerLookSpeedMul(0.35f);
            StartPlayerLookAt("AreaLook_3", 1.0f, 0.5f, "");
            fEventSpeed = 0.5f;
        break;
        case 9:
            SetPlayerMoveSpeedMul(0.4f);
            SetPlayerRunSpeedMul(0.4f);
            SetPlayerLookSpeedMul(0.4f);
            FadePlayerRollTo(-30, 30.0f, 30.0f);
            MovePlayerHeadPos(0.0f, 0.0f, 0.0f, 0.8f, 0.8f);
            PlaySoundAtEntity("cloth4", "player_stand", "Player", 0.2f, false);
            fEventSpeed = 0.5f;
        break;
        case 10:
            FadePlayerRollTo(30, 8.0f, 8.0f);
            PlaySoundAtEntity("cloth5", "player_climb", "Player", 0.5f, false);
            SetPlayerMoveSpeedMul(0.45f);
            SetPlayerRunSpeedMul(0.45f);
            SetPlayerLookSpeedMul(0.45f);
            FadeOut(4.0f);
            StartPlayerLookAt("AreaLook_2", 1.5f, 1.5f, "");
            fEventSpeed = 1.0f;
        break;
        case 11:
            FadePlayerRollTo(-30, 10.0f, 10.0f);
            fEventSpeed = 0.5f;
        break;
        case 12:
            FadePlayerRollTo(0, 8.0f, 8.0f);
            SetPlayerMoveSpeedMul(0.5f);
            SetPlayerRunSpeedMul(0.5f);
            SetPlayerLookSpeedMul(0.5f);
            FadeIn(1.0f);
            StopPlayerLookAt();
        break;
        case 13:
            SetPlayerMoveSpeedMul(0.6f);
            SetPlayerRunSpeedMul(0.6f);
            SetPlayerLookSpeedMul(0.7f);
        break;
        case 14:
            SetPlayerMoveSpeedMul(0.75f);
            SetPlayerRunSpeedMul(0.75f);
            SetPlayerLookSpeedMul(0.9f);
        break;
        case 15:
            SetPlayerMoveSpeedMul(0.85f);
            SetPlayerRunSpeedMul(0.85f);
            SetPlayerLookSpeedMul(1.0f);
        break;
        case 16:
            SetPlayerCrouchDisabled(false);
            SetPlayerJumpDisabled(false);
            SetPlayerMoveSpeedMul(1.0f);
            SetPlayerRunSpeedMul(1.0f);
            PlayMusic("15_event_elevator.ogg", true, 1.0f, 0.5f, 0, true);
        break;
    }

    if(GetLocalVarInt(sEvent) <= iMaxEventStep) AddTimer(sEvent, fEventSpeed, sEvent);
    }
////////////////////////////
// Run when leaving map
void OnLeave()
{
    StopMusic(2, 10);
    AutoSave();
}
04-23-2013, 05:07 PM
Website Find


Messages In This Thread
Having a slight problem... - by TrollingForever - 04-23-2013, 04:26 PM
RE: Having a slight problem... - by Tomato Cat - 04-23-2013, 04:54 PM
RE: Having a slight problem... - by TrollingForever - 04-23-2013, 05:07 PM
RE: Having a slight problem... - by immaturegames - 04-23-2013, 05:13 PM
RE: Having a slight problem... - by Tomato Cat - 04-23-2013, 05:16 PM
RE: Having a slight problem... - by Tomato Cat - 04-23-2013, 05:26 PM
RE: Having a slight problem... - by Tomato Cat - 04-23-2013, 05:44 PM
RE: Having a slight problem... - by Tomato Cat - 04-23-2013, 05:51 PM



Users browsing this thread: 4 Guest(s)