Radical Batz
Posting Freak
Posts: 953
Threads: 145
Joined: Dec 2013
Reputation:
25
|
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 |
|
DnALANGE
Banned
Posts: 1,549
Threads: 73
Joined: Jan 2012
|
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 |
|
Radical Batz
Posting Freak
Posts: 953
Threads: 145
Joined: Dec 2013
Reputation:
25
|
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 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 |
|
TheGreatCthulhu
Member
Posts: 213
Threads: 10
Joined: Oct 2010
Reputation:
32
|
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.
|
|
09-18-2014, 08:10 PM |
|
Radical Batz
Posting Freak
Posts: 953
Threads: 145
Joined: Dec 2013
Reputation:
25
|
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
void Igotabadfeeling(string &in asTimer) { AddEffectVoice("voices", "i got a bad feeling about this.ogg", "Voice", "feeling", false, "Player", 1, 1); }
void playscarymusic(string &in asTimer) { PlayMusic("music_mansion_lanternpickup.ogg", false, 0.7, 0.1, 1, true); }
void collideACID(string &in asParent, string &in asChild, int alState) { AddEffectVoice("voices", "crap that's acid.ogg", "Voice", "acid", false, "Player", 1, 1); }
void collideomfgitsabaggg(string &in asParent, string &in asChild, int alState) { AddEffectVoice("voices", "crap that's acid.ogg", "Voice", "acid", false, "Player", 1, 1); StartPlayerLookAt("backpack_1", 2, 1, ""); 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.0f, false); SetPlayerActive(true); }
void collideDIE(string &in asParent, string &in asChild, int alState) { PlaySoundAtEntity("DIIIIIIIIE", "fire_damage_custom", "Player", 0.5, false); AddTimer("" ,1,"damage"); GivePlayerDamage(20, "", true, true); CheckPoint ("", "PlayerStartArea_2", "Checkpoint01", "Hints", "death"); AddDebugMessage("SOMETHING SOMETHING", false); }
void damage(string &in asTimer) { GivePlayerDamage(560, "", true, true); PlaySoundAtEntity("DIIIIIIIIE", "fire_damage_custom", "Player", 0.1, false); AddDebugMessage("SOMETHING SOMETHING", false); }
void poordog(string &in asEntity) { AddEffectVoice("voices", "poor dog.ogg", "Voice", "poordog", false, "Player", 1, 1); }
void TimerAreaSpider(string &in asTimer) { int iRand = RandInt(1, 6);
PlaySoundAtEntity(asTimer+iRand, "horror_spider_attack.snt", asTimer+iRand, 1, false); AddTimer("EndRadial", 4.0f, "TimerEndRadial"); AddTimer(asTimer, RandFloat(15.0f, 30.0f), "TimerAreaSpider"); }
void TimerAreaStep(string &in asTimer) { int iRand = RandInt(1, 6);
PlaySoundAtEntity(asTimer+iRand, "09_spiders.snt", asTimer+iRand, 1, false); AddTimer("EndRadial", 4.0f, "TimerEndRadial"); AddTimer(asTimer, RandFloat(15.0f, 30.0f), "TimerAreaStep"); }
void Boo(string &in asParent, string &in asChild, int alState) { TeleportPlayer("Boo"); SetPlayerActive(false); AddTimer("flash", 2, "flash"); }
void flash(string &in asTimer) { StartEffectFlash(0.15f, 0.8f, 0.12f); FadePlayerAspectMulTo(0.3f, 4.0f); PlayMusic("afx_tesla_teleport2.ogg", false, 0.7f, 0, 15, false); AddTimer("stop", 0.3, "stop"); } void stop(string &in asTimer) { TeleportPlayer("PlayerStartArea_3"); FadePlayerAspectMulTo(1, 2.2f); SetPlayerActive(true); }
void OnStart() { AddTimer("" ,1,"Igotabadfeeling"); SetEntityCustomFocusCrossHair("ScriptArea_3", "Pick"); AddEntityCollideCallback("Player", "ACID", "collideACID", true, 1); AddEntityCollideCallback("Player", "omfgitsabaggg", "collideomfgitsabaggg", true, 1); AddEntityCollideCallback("Player", "bitchfuckingrun", "bitchfuckingrun", true, 1); AddEntityCollideCallback("Player", "Flawless", "Boo", true, 1); AddEntityCollideCallback("Player", "Move_box_1", "Diecollide", false, 1); AddEntityCollideCallback("Player", "DIE", "collideDIE", false, 1); for(int i=1; i<=28; ++i) AddEntityCollideCallback("Player", "ScriptArea_"+i, "RUN", false, 1); for(int i=1; i<=28; i++) AddEntityCollideCallback("ScriptArea_"+i, "Player", "Diecollide", false, 1); AddEntityCollideCallback("Player", "crude_man_chains_statue_ghost_2", "Diecollide", false, 1); AddEntityCollideCallback("Player", "crude_man_chains_statue_ghost_2", "Diecollide", false, 1); AddEntityCollideCallback("Player", "Die", "Diecollide", false, 1); AddEntityCollideCallback("Player", "Die1", "Diecollide", false, 1); AddEntityCollideCallback("Player", "Die2", "Diecollide", false, 1); AddEntityCollideCallback("Player", "Die3", "Diecollide", false, 1); AddEntityCollideCallback("Player", "Die4", "Diecollide", false, 1); AddEntityCollideCallback("Player", "Die5", "Diecollide", false, 1); AddEntityCollideCallback("Player", "Die6", "Diecollide", false, 1); AddEntityCollideCallback("Player", "Die7", "Diecollide", false, 1); AddEntityCollideCallback("Player", "Die8", "Diecollide", false, 1); AddEntityCollideCallback("Player", "Die9", "Diecollide", false, 1); AddEntityCollideCallback("Player", "Die10", "Diecollide", false, 1); AddEntityCollideCallback("Player", "Die11", "Diecollide", false, 1); AddEntityCollideCallback("Player", "Die12", "Diecollide", false, 1); AddEntityCollideCallback("Player", "Die13", "Diecollide", false, 1); AddEntityCollideCallback("Player", "Die14", "Diecollide", false, 1); AddEntityCollideCallback("Player", "Die01", "Diecollide", false, 1); AddEntityCollideCallback("Player", "Die02", "Diecollide", false, 1); AddEntityCollideCallback("Player", "Die03", "Diecollide", false, 1); 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,5, 2.0f, 0, true); SetSanityDrainDisabled(true); SetMapDisplayNameEntry("Grandfather's Mines"); AutoSave(); }
void Diecollide(string &in asParent, string &in asChild, int alState) { AddPlayerHealth(-200); }
void bitchfuckingrun(string &in asParent, string &in asChild, int alState) { StartPlayerLookAt("PENIS", 3, 2, ""); CheckPoint ("", "PlayerStartArea_4", "respawn", "Hints", "death"); PlaySoundAtEntity("boo", "sanity_damage", "Player", 0.1, false); AddTimer("RUN", 2, "RUN"); SetPlayerActive(false); StopMusic(1, 0); }
void RUN(string &in asTimer) { AddEffectVoice("voices", "oh god 2.ogg", "Voice", "feeling", false, "Player", 1, 1); AddTimer("BeginRun", 3, "BeginRun"); }
void BeginRun(string &in asTimer) { PlayMusic("Psycho1.ogg", true,1, 0.1, 0, false); SetEntityActive("crude_man_chains_statue_ghost_2", true); SetEntityActive("Die", true); AddEntityCollideCallback("Player", "ScriptArea_4", "Diecollide", false, 1); StopPlayerLookAt(); PlaySoundAtEntity("boo", "sanity_damage", "Player", 0.1, false); 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.1, false); 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.1, false); 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.1, false); 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.1, false); 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.1, false); 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.1, false); 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.1, false); 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.1, false); 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.1, false); 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.1, false); 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.1, false); 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.1, false); 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.1, false); 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.1, false); 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.1, false); 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.1, false); 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.1, false); 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.1, false); 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.1, false); 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.1, false); AddTimer("RUN22", 0.4, "RUN22"); }
void Getout(string &in asEntity) { ChangeMap("CrystalCave", "PlayerStartArea_1", "large_dungeon_door_opening", ""); }
void respawn(string &in asName, int 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 |
|
The chaser
Posting Freak
Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation:
113
|
RE: How to resumer everything when dying?
THE OTHERWORLD (WIP)
Aculy iz dolan.
(This post was last modified: 09-18-2014, 08:42 PM by The chaser.)
|
|
09-18-2014, 08:41 PM |
|
Radical Batz
Posting Freak
Posts: 953
Threads: 145
Joined: Dec 2013
Reputation:
25
|
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
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 |
|
Mudbill
Muderator
Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation:
179
|
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 |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
RE: How to resumer everything when dying?
We fixed it
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 |
|
Radical Batz
Posting Freak
Posts: 953
Threads: 145
Joined: Dec 2013
Reputation:
25
|
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 _
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 |
|
|