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
How to resumer everything when dying?
Radical Batz Offline
Posting Freak

Posts: 953
Threads: 145
Joined: Dec 2013
Reputation: 25
#5
RE: How to resumer everything when dying?

(09-18-2014, 08:10 PM)TheGreatCthulhu Wrote: Well, it's hard to tell without seeing the rest of the code, but it could be that the timer doesn't actually get called (if you've set it up in OnStart, remember that OnStart only get's called once - the first time the player enters the level; on the other hand, OnEnter is called every time).

Also, is there something in the script that is causing the area to go inactive in the first place - maybe you should try fixing that instead.

Hmm putting it onEnter doesn't do anything, if you wanna see my whole script here it is, I appreciate it if this would be fixed even if it was easy much and I'm just dumb :p

PHP Code: (Select All)
void Igotabadfeeling(string &in asTimer)
{
    
AddEffectVoice("voices""i got a bad feeling about this.ogg""Voice""feeling",
false"Player"11);
}

void playscarymusic(string &in asTimer)
{
    
PlayMusic("music_mansion_lanternpickup.ogg"false0.70.11true);
}

void collideACID(string &in asParentstring &in asChildint alState
{
    
AddEffectVoice("voices""crap that's acid.ogg""Voice""acid",
false"Player"11);
}

void collideomfgitsabaggg(string &in asParentstring &in asChildint alState
{
    
AddEffectVoice("voices""crap that's acid.ogg""Voice""acid",
false"Player"11);
StartPlayerLookAt("backpack_1"21"");
SetPlayerActive(false);
AddTimer("staph"4"staphit");
}

void staphit(string &in asTimer)
{
    
StopPlayerLookAt();
    
AddTimer("crouch"0.1"pickmeupbeforeyougogo");
}

void pickmeupbeforeyougogo(string &in asTimer)
{
        
SetPlayerCrouching(true);
    
AddTimer("pick"0.3"pick");
    
}

void pick(string &in asTimer)
{
    
SetEntityActive("backpack_1"false); 
        
SetEntityActive("block_box_3"false);
    
PlayGuiSound("pick_bag1"1);
    
SetInventoryDisabled(false);
    
AddTimer("standup"0.5"standup");
}

void standup(string &in asTimer)
{
    
SetPlayerCrouching(false);
     
PlaySoundAtEntity("stand""player_stand""Player"0.0ffalse);
     
SetPlayerActive(true);
}

void collideDIE(string &in asParentstring &in asChildint alState
{
    
PlaySoundAtEntity("DIIIIIIIIE""fire_damage_custom""Player"0.5false);
    
AddTimer("" ,1,"damage");
    
GivePlayerDamage(20""truetrue);
    
CheckPoint ("""PlayerStartArea_2""Checkpoint01""Hints""death");
    
AddDebugMessage("SOMETHING SOMETHING"false);


void damage(string &in asTimer)
{
    
GivePlayerDamage(560""truetrue);
    
PlaySoundAtEntity("DIIIIIIIIE""fire_damage_custom""Player"0.1false);
    
AddDebugMessage("SOMETHING SOMETHING"false);
}

void poordog(string &in asEntity)
{
    
AddEffectVoice("voices""poor dog.ogg""Voice""poordog",
false"Player"11);
}

void TimerAreaSpider(string &in asTimer)
{
    
int iRand RandInt(16);

    
PlaySoundAtEntity(asTimer+iRand"horror_spider_attack.snt"asTimer+iRand1false);
    
AddTimer("EndRadial"4.0f"TimerEndRadial");
    
AddTimer(asTimerRandFloat(15.0f30.0f), "TimerAreaSpider");
}

void TimerAreaStep(string &in asTimer)
{
    
int iRand RandInt(16);

    
PlaySoundAtEntity(asTimer+iRand"09_spiders.snt"asTimer+iRand1false);
    
AddTimer("EndRadial"4.0f"TimerEndRadial");
    
AddTimer(asTimerRandFloat(15.0f30.0f), "TimerAreaStep");
}

void Boo(string &in asParentstring &in asChildint alState
{
    
TeleportPlayer("Boo");
    
SetPlayerActive(false);
    
AddTimer("flash"2"flash");
}

void flash(string &in asTimer)
{
    
StartEffectFlash(0.15f0.8f0.12f);
        
FadePlayerAspectMulTo(0.3f4.0f);
            
PlayMusic("afx_tesla_teleport2.ogg"false0.7f015false);
        
AddTimer("stop"0.3"stop");
}
void stop(string &in asTimer)
{
    
TeleportPlayer("PlayerStartArea_3");
    
FadePlayerAspectMulTo(12.2f);
    
SetPlayerActive(true);
}

void OnStart()
{
    
AddTimer("" ,1,"Igotabadfeeling");
    
SetEntityCustomFocusCrossHair("ScriptArea_3""Pick");
    
AddEntityCollideCallback("Player""ACID""collideACID"true1);
    
AddEntityCollideCallback("Player""omfgitsabaggg""collideomfgitsabaggg"true1);
    
AddEntityCollideCallback("Player""bitchfuckingrun""bitchfuckingrun"true1);
    
AddEntityCollideCallback("Player""Flawless""Boo"true1);
    
AddEntityCollideCallback("Player""Move_box_1""Diecollide"false1);
    
AddEntityCollideCallback("Player""DIE""collideDIE"false1);
    for(
int i=1i<=28; ++iAddEntityCollideCallback("Player""ScriptArea_"+i"RUN"false1); 
    for(
int i=1i<=28i++) AddEntityCollideCallback("ScriptArea_"+i"Player""Diecollide"false1);
    
AddEntityCollideCallback("Player""crude_man_chains_statue_ghost_2""Diecollide"false1); 
    
AddEntityCollideCallback("Player""crude_man_chains_statue_ghost_2""Diecollide"false1);
    
AddEntityCollideCallback("Player""Die""Diecollide"false1);
    
AddEntityCollideCallback("Player""Die1""Diecollide"false1);
    
AddEntityCollideCallback("Player""Die2""Diecollide"false1);
    
AddEntityCollideCallback("Player""Die3""Diecollide"false1);
    
AddEntityCollideCallback("Player""Die4""Diecollide"false1);
    
AddEntityCollideCallback("Player""Die5""Diecollide"false1);
    
AddEntityCollideCallback("Player""Die6""Diecollide"false1);
    
AddEntityCollideCallback("Player""Die7""Diecollide"false1);
    
AddEntityCollideCallback("Player""Die8""Diecollide"false1);
    
AddEntityCollideCallback("Player""Die9""Diecollide"false1);
    
AddEntityCollideCallback("Player""Die10""Diecollide"false1);
    
AddEntityCollideCallback("Player""Die11""Diecollide"false1);
    
AddEntityCollideCallback("Player""Die12""Diecollide"false1);
    
AddEntityCollideCallback("Player""Die13""Diecollide"false1);
    
AddEntityCollideCallback("Player""Die14""Diecollide"false1);
    
AddEntityCollideCallback("Player""Die01""Diecollide"false1);
    
AddEntityCollideCallback("Player""Die02""Diecollide"false1);
    
AddEntityCollideCallback("Player""Die03""Diecollide"false1);
    
    
AddTimer("AreaSpider_"RandFloat(3.0f,10.f), "TimerAreaSpider");
    
AddTimer("AreaStep_"RandFloat(3.0f,10.f), "TimerAreaStep");
    
SetEntityCustomFocusCrossHair("GetOut""leveldoor");
}

void OnEnter()
{
    
PlayMusic("penumbra_music_E1_A5.ogg"true,52.0f0true);
    
SetSanityDrainDisabled(true);
    
SetMapDisplayNameEntry("Grandfather's Mines");
    
AutoSave();
}

void Diecollide(string &in asParentstring &in asChildint alState
{    
    
AddPlayerHealth(-200);
}

void bitchfuckingrun(string &in asParentstring &in asChildint alState
{
    
StartPlayerLookAt("PENIS"32"");
    
CheckPoint ("""PlayerStartArea_4""respawn""Hints""death");
    
PlaySoundAtEntity("boo""sanity_damage""Player"0.1false);
    
AddTimer("RUN"2"RUN");
    
SetPlayerActive(false);
    
StopMusic(10);
}

void RUN(string &in asTimer)
{
    
AddEffectVoice("voices""oh god 2.ogg""Voice""feeling",
false"Player"11);
    
AddTimer("BeginRun"3"BeginRun");
    
}

void BeginRun(string &in asTimer)
{
    
PlayMusic("Psycho1.ogg"true,10.10false);
    
SetEntityActive("crude_man_chains_statue_ghost_2"true);
    
SetEntityActive("Die"true);
    
AddEntityCollideCallback("Player""ScriptArea_4""Diecollide"false1);
    
StopPlayerLookAt();
    
PlaySoundAtEntity("boo""sanity_damage""Player"0.1false);
    
AddTimer("RUN2"0.4"RUN2");
    
}

void RUN2(string &in asTimer)
{
    
SetEntityActive("crude_man_chains_statue_ghost_2"false);
    
SetEntityActive("crude_man_chains_statue_ghost_3"true);
    
SetEntityActive("Die2"true);
    
SetPlayerActive(true);
    
PlaySoundAtEntity("boo""sanity_damage""Player"0.1false);
    
AddTimer("RUN3"0.4"RUN3");
    
}

void RUN3(string &in asTimer)
{
    
SetEntityActive("crude_man_chains_statue_ghost_3"false);
    
SetEntityActive("crude_man_chains_statue_ghost_4"true);
    
SetEntityActive("Die01"true);
    
PlaySoundAtEntity("boo""sanity_damage""Player"0.1false);
    
AddTimer("RUN4"0.4"RUN4");
    
}

void RUN4(string &in asTimer)
{
    
SetEntityActive("crude_man_chains_statue_ghost_4"false);
    
SetEntityActive("crude_man_chains_statue_ghost_5"true);
    
SetEntityActive("Die02"true);
    
PlaySoundAtEntity("boo""sanity_damage""Player"0.1false);
    
AddTimer("RUN5"0.4"RUN5");
    
}

void RUN5(string &in asTimer)
{
    
SetEntityActive("crude_man_chains_statue_ghost_5"false);
    
SetEntityActive("crude_man_chains_statue_ghost_6"true);
    
SetEntityActive("Die3"true);
    
PlaySoundAtEntity("boo""sanity_damage""Player"0.1false);
    
AddTimer("RUN6"0.4"RUN6");
    
}

void RUN6(string &in asTimer)
{
    
SetEntityActive("crude_man_chains_statue_ghost_6"false);
    
SetEntityActive("crude_man_chains_statue_ghost_7"true);
    
SetEntityActive("Die03"true);
    
PlaySoundAtEntity("boo""sanity_damage""Player"0.1false);
    
AddTimer("RUN7"0.4"RUN7");
    
}

void RUN7(string &in asTimer)
{
    
SetEntityActive("crude_man_chains_statue_ghost_7"false);
    
SetEntityActive("crude_man_chains_statue_ghost_8"true);
    
SetEntityActive("Die4"true);
    
PlaySoundAtEntity("boo""sanity_damage""Player"0.1false);
    
AddTimer("RUN8"0.4"RUN8");
    
}

void RUN8(string &in asTimer)
{
    
SetEntityActive("crude_man_chains_statue_ghost_8"false);
    
SetEntityActive("crude_man_chains_statue_ghost_9"true);
    
SetEntityActive("Die5"true);
    
PlaySoundAtEntity("boo""sanity_damage""Player"0.1false);
    
AddTimer("RUN9"0.4"RUN9");
    
}

void RUN9(string &in asTimer)
{
    
SetEntityActive("crude_man_chains_statue_ghost_9"false);
    
SetEntityActive("crude_man_chains_statue_ghost_10"true);
    
SetEntityActive("Die6"true);
    
PlaySoundAtEntity("boo""sanity_damage""Player"0.1false);
    
AddTimer("RUN10"0.4"RUN10");
}

void RUN10(string &in asTimer)
{
    
SetEntityActive("crude_man_chains_statue_ghost_10"false);
    
SetEntityActive("crude_man_chains_statue_ghost_11"true);
    
SetEntityActive("Die7"true);
    
PlaySoundAtEntity("boo""sanity_damage""Player"0.1false);
    
AddTimer("RUN11"0.4"RUN11");
}

void RUN11(string &in asTimer)
{
    
SetEntityActive("crude_man_chains_statue_ghost_11"false);
    
SetEntityActive("crude_man_chains_statue_ghost_12"true);
    
SetEntityActive("Die8"true);
    
PlaySoundAtEntity("boo""sanity_damage""Player"0.1false);
    
AddTimer("RUN12"0.4"RUN12");
}

void RUN12(string &in asTimer)
{
    
SetEntityActive("crude_man_chains_statue_ghost_12"false);
    
SetEntityActive("crude_man_chains_statue_ghost_13"true);
    
SetEntityActive("Die9"true);
    
PlaySoundAtEntity("boo""sanity_damage""Player"0.1false);
    
AddTimer("RUN13"0.4"RUN13");
}

void RUN13(string &in asTimer)
{
    
SetEntityActive("crude_man_chains_statue_ghost_13"false);
    
SetEntityActive("crude_man_chains_statue_ghost_14"true);
    
SetEntityActive("Die10"true);
    
PlaySoundAtEntity("boo""sanity_damage""Player"0.1false);
    
AddTimer("RUN14"0.4"RUN14");
}

void RUN14(string &in asTimer)
{
    
SetEntityActive("crude_man_chains_statue_ghost_14"false);
    
SetEntityActive("crude_man_chains_statue_ghost_15"true);
    
SetEntityActive("ScriptArea_11"true);
    
PlaySoundAtEntity("boo""sanity_damage""Player"0.1false);
    
AddTimer("RUN15"0.4"RUN15");
}

void RUN15(string &in asTimer)
{
    
SetEntityActive("crude_man_chains_statue_ghost_15"false);
    
SetEntityActive("crude_man_chains_statue_ghost_16"true);
    
SetEntityActive("Die12"true);
    
PlaySoundAtEntity("boo""sanity_damage""Player"0.1false);
    
AddTimer("RUN16"0.4"RUN16");
}

void RUN16(string &in asTimer)
{
    
SetEntityActive("crude_man_chains_statue_ghost_16"false);
    
SetEntityActive("crude_man_chains_statue_ghost_17"true);
    
SetEntityActive("ScriptArea_13"true);
    
PlaySoundAtEntity("boo""sanity_damage""Player"0.1false);
    
AddTimer("RUN17"0.4"RUN17");
}

void RUN17(string &in asTimer)
{
    
SetEntityActive("crude_man_chains_statue_ghost_17"false);
    
SetEntityActive("crude_man_chains_statue_ghost_18"true);
    
SetEntityActive("Die14"true);
    
PlaySoundAtEntity("boo""sanity_damage""Player"0.1false);
    
AddTimer("RUN18"0.4"RUN18");
}

void RUN18(string &in asTimer)
{
    
SetEntityActive("crude_man_chains_statue_ghost_18"false);
    
SetEntityActive("crude_man_chains_statue_ghost_19"true);
    
SetEntityActive("ScriptArea_21"true);
    
PlaySoundAtEntity("boo""sanity_damage""Player"0.1false);
    
AddTimer("RUN19"0.4"RUN19");
}

void RUN19(string &in asTimer)
{
    
SetEntityActive("crude_man_chains_statue_ghost_19"false);
    
SetEntityActive("crude_man_chains_statue_ghost_20"true);
    
SetEntityActive("ScriptArea_22"true);
    
PlaySoundAtEntity("boo""sanity_damage""Player"0.1false);
    
AddTimer("RUN20"0.4"RUN20");
}

void RUN20(string &in asTimer)
{
    
SetEntityActive("crude_man_chains_statue_ghost_20"false);
    
SetEntityActive("crude_man_chains_statue_ghost_21"true);
    
SetEntityActive("ScriptArea_23"true);
    
PlaySoundAtEntity("boo""sanity_damage""Player"0.1false);
    
AddTimer("RUN21"0.4"RUN21");
}

void RUN21(string &in asTimer)
{
    
SetEntityActive("crude_man_chains_statue_ghost_21"false);
    
SetEntityActive("crude_man_chains_statue_ghost_22"true);
    
SetEntityActive("ScriptArea_24"true);
    
PlaySoundAtEntity("boo""sanity_damage""Player"0.1false);
    
AddTimer("RUN22"0.4"RUN22");
}

void Getout(string &in asEntity)
{
    
ChangeMap("CrystalCave""PlayerStartArea_1""large_dungeon_door_opening""");
}

void respawn(string &in asNameint alCount)
{
    
SetEntityActive("Die1"false);
    
SetEntityActive("Die2"false);
    
SetEntityActive("Die3"false);
    
SetEntityActive("Die4"false);
    
SetEntityActive("Die5"false);
    
SetEntityActive("Die6"false);
    
SetEntityActive("Die7"false);
    
SetEntityActive("Die8"false);
    
SetEntityActive("Die9"false);
    
SetEntityActive("Die10"false);
    
SetEntityActive("Die11"false);
    
SetEntityActive("Die12"false);
    
SetEntityActive("Die13"false);
    
SetEntityActive("Die14"false);
    
SetEntityActive("Die01"false);
    
SetEntityActive("Die02"false);
    
SetEntityActive("Die03"false);
    
    
}

void OnLeave()
{
    
SetupLoadScreen(""""1"DOnxZ9q");


So the area that you collide with is called "bitchfuckingrun" jsut as the script ofc

09-18-2014, 08:21 PM
Find


Messages In This Thread
RE: How to resumer everything when dying? - by Radical Batz - 09-18-2014, 08:21 PM



Users browsing this thread: 1 Guest(s)