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
#1
How to resumer everything when dying?

Aaahh fuck me, so wow just wow. Another problem just occured in my life after I solved the area colliding issue.

After I die by an area, When respawning back I find myself inactive like I can't move at all.

It might be because of the area still active, the death areas but how do I reset everything in the event like the areas and everything, how do I reset all of that?

Cause when the player dies, I wanna make him try this event a couple of times. Ask me in details pls. I feel so noobish all of a sudden :p Cause my friend's couldn't solve it.

Thnx

(This post was last modified: 09-18-2014, 06:30 PM by Radical Batz.)
09-18-2014, 06:28 PM
Find
DnALANGE Offline
Banned

Posts: 1,549
Threads: 73
Joined: Jan 2012
#2
RE: How to resumer everything when dying?

Look in Premonition..
check the map called pig,factory,streets... some like that..
then look for the code,script checkpoint.
try learn how it works. Not copy paste....
good luck.
09-18-2014, 06:52 PM
Find
Radical Batz Offline
Posting Freak

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

(09-18-2014, 06:52 PM)DnALANGE Wrote: Look in Premonition..
check the map called pig,factory,streets... some like that..
then look for the code,script checkpoint.
try learn how it works. Not copy paste....
good luck.

Thank you, right now I have another new problem that started to occur after I fixed some of it.

So theere's an area in the lvl editor that si active, you are suppose to collide with it and stuff is suppsoed to happen etc..etc...

When dying it goes inactive so I made this in the resume timer(string &in asName, int alCount) thingy
PHP Code: (Select All)
    SetEntityActive("bitchfuckingrun"true); 

which doesn't seem to go active when respawning, anybody knows what's causing this at all??

09-18-2014, 07:08 PM
Find
TheGreatCthulhu Offline
Member

Posts: 213
Threads: 10
Joined: Oct 2010
Reputation: 32
#4
RE: How to resumer everything when dying?

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.
(This post was last modified: 09-18-2014, 08:11 PM by TheGreatCthulhu.)
09-18-2014, 08:10 PM
Find
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
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#6
RE: How to resumer everything when dying?

https://wiki.frictionalgames.com/hpl2/tu...riptarea_s

A tutorial on how to make checkpoints Smile

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
(This post was last modified: 09-18-2014, 08:42 PM by The chaser.)
09-18-2014, 08:41 PM
Find
Radical Batz Offline
Posting Freak

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

(09-18-2014, 08:41 PM)The chaser Wrote: https://wiki.frictionalgames.com/hpl2/tu...riptarea_s

A tutorial on how to make checkpoints Smile

This is not what I'm talking about, I already know how to use checkpoints but the problem is an area won't go active after dying, I want it to resume itself, I tried using a reset functuion but didn't do the trick.

09-19-2014, 11:45 AM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#8
RE: How to resumer everything when dying?

Did you add another callback? If the first one is removed on execution, it won't happen again even if the area is active.

(This post was last modified: 09-19-2014, 11:47 AM by Mudbill.)
09-19-2014, 11:47 AM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#9
RE: How to resumer everything when dying?

We fixed it Smile

He had 'true' in AddEntityCollideCallback, meaning it would just delete itself the first time.

We handled this by making it 'false', and then making the function so that the area would set itself inactive. This way it would not call the exact same function again if he collided with it.
But it will still be set active again, if the player dies.

Trying is the first step to success.
09-19-2014, 12:01 PM
Find
Radical Batz Offline
Posting Freak

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

So guess what? I got it solved by the easiest problem in the world XD
All I had to do is just Make the addentity collide callback false instead of true and set it to false when the function starts then set it to true in the respawn function Smile_

Help from Flawless! Sorry guys for wasting your time by the easiest problem out there.

You can lock this thread Kreek!

09-19-2014, 12:04 PM
Find




Users browsing this thread: 3 Guest(s)