Restore rusty valve when you die (still unsolved) - Steve - 07-31-2012
Well I don't know exactly how to explain this but I have a map where you begin running away from a "monster"(not a real monster just some timer that are breaking some doors)
and I want to when you die by this "monster" you have to begin running again. and the whole map is as it was from when you begon with the map. is this even possible I really need to know this.
thanks already
RE: Restore map when you die - Mackiiboy - 07-31-2012
There might be needed a lot of scripting to reset a whole map, depending on how many entities and script areas there are in the map. It might be more things to reset, like local variables, particle systems, sounds, lights and etc...
First of all, you will need a checkpoint. If you die, a function will be called. You should put everything that you want to be restored inside that function .
-------------------------------------------------------------
void CheckPoint (string& asName, string& asStartPos, string& asCallback , string& asDeathHintCat, string& asDeathHintEntry);
Sets a checkpoint at which the player will respawn in case he dies.
Callback syntax: void MyFunc (string &in asName, int alCount) <----- Do not forget the callback syntax
Count is 0 on the first checkpoint load!
asName - the internal name
asStartPos - the name of the StartPos in the editor
asCallback - the function to call when the player dies/respawns
asDeathHintCat - the category of the death hint message to be used in the .lang file
asDeathHintEntry - the entry in the .lang file
---------------------------------------------------------------------
Inside the function that will be called after the death, you should use ResetProp on every single entity and script area in the whole map. Then, every entity and script area will be restored.
Code:
ResetProp(string& asName);
If you have used local variables in your map, you can reset them by using SetLocalVarInt/Float and use the same value as it was in the beginning.
You can preload particle systems and sounds by using PreloadParticleSystem, PreloadSound, if you have created any particle systems or looping sounds with scripting.
Code:
SetLocalVarInt(string& asName, int alVal);
SetLocalVarFloat(string& asName, float afVal);
PreloadParticleSystem(string& asPSFile);
PreloadSound(string& asSoundFile);
You can reset many more things too, but I think everything above might be the most useful things to reset since they usually exists in stories. If you want to reset other things, search for it in the engine scripts.
. (07-31-2012, 02:57 PM) Steve Wrote: Well I don't know exactly how to explain this but I have a map where you begin running away from a "monster"(not a real monster just some timer that are breaking some doors)
and I want to when you die by this "monster" you have to begin running again. and the whole map is as it was from when you begon with the map. is this even possible I really need to know this.
thanks already
RE: Restore map when you die - Steve - 08-04-2012
okay that helped a bit the most I knew xd but still thanks
now I have a problem I have an valve_iron_rusty_breakable in my map that will break at an moment whixh works fine but when you broke it eand if you die and come near that part again the valve is still broken but not at the same place that you moved it to but another spot like it just fell.
I tried resetprop but that didn't work an idea (I hope that you get what I mean xd)
this is my code:
Spoiler below!
////////////////////////////
// Run first time starting map
void OnStart()
{
InteractConnectPropWithMoveObject("wheeltodoor2", "valve_iron_1", "safety_normal_vert_1", true, false, 0);
SetEntityInteractionDisabled("level_hub_1", true);
Anter();
PlaySoundAtEntity("cat", "react_breath_loop.snt", "soundarea", 0, false);
AddEntityCollideCallback("Player", "ScriptArea_4", "breakvalve", true, 1);
SetEntityConnectionStateChangeCallback("lever_1", "StoreCheckLeverState");
SetEntityConnectionStateChangeCallback("lever_2", "StoreCheckLeverState");
SetEntityConnectionStateChangeCallback("lever_3", "StoreCheckLeverState");
AddEntityCollideCallback("crowbar_joint_1", "ScriptArea_7", "CollideAreaBreakWall", true, 1);
}
void Anter()
{
SetPlayerActive(false);
StartPlayerLookAt("ScriptArea_1", 2.0f, 2.0f, "");
AddTimer("scare_timer", 1.0f, "scarestart");
SetMoveObjectState("safety_normal_vert_2", 1);
}
void scarestart(string &in asTimer)
{
StopPlayerLookAt();
StartPlayerLookAt("ScriptArea_2", 2.0f, 2.0f, "");
AddTimer("scere_timer", 1.0f, "scerestert");
}
void scerestert(string &in asTimer)
{
StopPlayerLookAt();
StartPlayerLookAt("ScriptArea_3", 2.0f, 2.0f, "");
AddTimer("score_timer", 1.0f, "scorestert");
}
void scorestert(string &in asTimer)
{
StopPlayerLookAt();
StartPlayerLookAt("AreaPushDownBar", 2.0f, 2.0f, "");
AddTimer("scire_timer", 1.0f, "scirestert");
}
void scirestert(string &in asTimer)
{
StopPlayerLookAt();
SetPlayerActive(true);
SetEntityPlayerInteractCallback("door_barricade_1", "Baric", true);
StopSound("cat", 2);
AddTimer("", 15.0f, "begin");
}
void Baric(string &in asEntity)
{
SetSwingDoorClosed("door_barricade_1", true, true);
AddTimer("", 0.5f, "Timer_LockBarricade");
}
void Timer_LockBarricade(string &in asTimer)
{
SetEntityInteractionDisabled("door_barricade_1", true);
SetEntityActive("door_barricade_1", false);
SetEntityActive("door_barricade_locked_1", true);
PlaySoundAtEntity("", "lock_door.snt", "Area_BarricadeLockDust", 0.0f, false);
CreateParticleSystemAtEntity("", "ps_hit_dirt.ps", "Area_BarricadeLockDust", false);
CreateParticleSystemAtEntity("", "ps_hit_metal.ps", "Area_BarricadeLockDust", false);
}
void begin(string &in asTimer)
{
CheckPoint ("RunCheckpoint", "PlayerStartArea_3", "restart", "RunAway", "Running");
PlaySoundAtEntity("", "guardian_ontop.snt", "level_hub_1", 0.0f, false);
AddTimer("", 1.6f, "TimerDeorPound");
SetMessage("Messages", "escape", 5.0f);
PlayMusic("search_brute.ogg", true, 5, 0, 0.5f, true);
PlayMusic("29_amb_end_intense.ogg", true, 5, 0, 0.5f, true);
}
void restart(string &in asName, int alCount)
{
SetEntityActive("rock_small_moveable", false);
SetEntityActive("valve_iron_rusty_breakable_1", false);
SetEntityActive("valve_iron_rusty_breakable_2", true);
SetEntityActive("rock_lock_static_1", true);
ResetProp("rock_small_moveable");
AddPropHealth("valve_iron_rusty_breakable_1", 100);
AddPropHealth("valve_iron_rusty_breakable_2", 100);
SetPropHealth("valve_iron_rusty_breakable_1", 100);
SetPropHealth("valve_iron_rusty_breakable_2", 100);
ResetProp("rock_lock_static_1");
ResetProp("valve_iron_rusty_breakable_2");
ResetProp("valve_iron_rusty_breakable_1");
AddTimer("rebeggining", 5.0f, "begin");
AddEntityCollideCallback("Player", "ScriptArea_4", "breakvalve", true, 1);
}
void TimerDeorPound(string& asTimer)
{
PlaySoundAtEntity("puund", "hit_wood", "ScriptArea_3", 0, false);
CreateParticleSystemAtEntity("puund_dust", "ps_hit_wood", "ScriptArea_3", false);
AddTimer("timer02", 1.5f, "StopLeok");
}
void StopLeok(string& asTimer)
{
PlaySoundAtEntity("puund", "hit_wood", "ScriptArea_3", 0, false);
CreateParticleSystemAtEntity("puund_dust", "ps_hit_wood", "ScriptArea_3", false);
AddTimer("timer03", 1.4f, "StopLaok");
}
void StopLaok(string& asTimer)
{
PlaySoundAtEntity("puund", "hit_wood", "ScriptArea_3", 0, false);
CreateParticleSystemAtEntity("puund_dust", "ps_hit_wood", "ScriptArea_3", false);
AddTimer("timer04", 1.3f, "StopLiok");
}
void StopLiok(string& asTimer)
{
PlaySoundAtEntity("puund", "hit_wood", "ScriptArea_3", 0, false);
CreateParticleSystemAtEntity("puund_dust", "ps_hit_wood", "ScriptArea_3", false);
AddTimer("timer05", 1.2f, "StopLuok");
}
void StopLuok(string& asTimer)
{
PlaySoundAtEntity("puund", "hit_wood", "ScriptArea_3", 0, false);
CreateParticleSystemAtEntity("puund_dust", "ps_hit_wood", "ScriptArea_3", false);
AddTimer("timer06", 1.1f, "StopLpok");
}
void StopLpok(string& asTimer)
{
PlaySoundAtEntity("puund", "hit_wood", "ScriptArea_3", 0, false);
CreateParticleSystemAtEntity("puund_dust", "ps_hit_wood", "ScriptArea_3", false);
AddTimer("timer07", 1.0f, "StopLtok");
}
void StopLtok(string& asTimer)
{
PlaySoundAtEntity("puund", "hit_wood", "ScriptArea_3", 0, false);
CreateParticleSystemAtEntity("puund_dust", "ps_hit_wood", "ScriptArea_3", false);
AddTimer("timer08", 0.9f, "StopLqok");
}
void StopLqok(string& asTimer)
{
PlaySoundAtEntity("puund", "hit_wood", "ScriptArea_3", 0, false);
CreateParticleSystemAtEntity("puund_dust", "ps_hit_wood", "ScriptArea_3", false);
AddTimer("timer09", 0.8f, "StopLkok");
}
void StopLkok(string& asTimer)
{
PlaySoundAtEntity("puund", "hit_wood", "ScriptArea_3", 0, false);
CreateParticleSystemAtEntity("puund_dust", "ps_hit_wood", "ScriptArea_3", false);
AddTimer("timer10", 0.7f, "StopLyok");
}
void StopLyok(string& asTimer)
{
PlaySoundAtEntity("puund", "hit_wood", "ScriptArea_3", 0, false);
CreateParticleSystemAtEntity("puund_dust","ps_hit_wood", "ScriptArea_3", false);
AddTimer("timer11", 0.6f, "StopLhok");
}
void StopLhok(string& asTimer)
{
PlaySoundAtEntity("puund", "hit_wood", "ScriptArea_3", 0, false);
CreateParticleSystemAtEntity("puund_dust", "ps_hit_wood", "ScriptArea_3", false);
AddTimer("timer12", 0.5f, "StopLsok");
}
void StopLsok(string& asTimer)
{
PlaySoundAtEntity("puund", "hit_wood", "ScriptArea_3", 0, false);
CreateParticleSystemAtEntity("puund_dust", "ps_hit_wood", "ScriptArea_3", false);
AddTimer("timer13", 0.4f, "StopLbok");
}
void StopLbok(string& asTimer)
{
PlaySoundAtEntity("puund", "hit_wood", "ScriptArea_3", 0, false);
CreateParticleSystemAtEntity("puund_dust", "ps_hit_wood", "ScriptArea_3", false);
AddTimer("timer14", 0.3f, "StopLgok");
}
void StopLgok(string& asTimer)
{
PlaySoundAtEntity("puund", "hit_wood", "ScriptArea_3", 0, false);
CreateParticleSystemAtEntity("puund_dust", "ps_hit_wood", "ScriptArea_3", false);
AddTimer("timer15", 0.2f, "StopLxok");
}
void StopLxok(string& asTimer)
{
PlaySoundAtEntity("puund", "hit_wood", "ScriptArea_3", 0, false);
CreateParticleSystemAtEntity("puund_dust", "ps_hit_wood", "ScriptArea_3", false);
AddTimer("timer16", 0.1f, "StopLwok");
}
void StopLwok(string& asTimer)
{
PlaySoundAtEntity("puund", "hit_wood", "ScriptArea_3", 0, false);
PlaySoundAtEntity("puund", "25_guardian_activated.snt", "ScriptArea_3", 0, false);
CreateParticleSystemAtEntity("puund_dust", "ps_hit_wood", "ScriptArea_3", false);
AddTimer("timer17", 1.0f, "daad");
}
void daad(string& asTimer)
{
CreateParticleSystemAtEntity("pind_dust", "ps_dust_falling_hole", "DA1", false);
CreateParticleSystemAtEntity("p9ind_dust", "ps_dust_falling_hole", "DA2", false);
CreateParticleSystemAtEntity("pi5nd_dust", "ps_dust_falling_hole", "DA2_1", false);
CreateParticleSystemAtEntity("pin2d_dust", "ps_dust_falling_hole", "DA2_2", false);
CreateParticleSystemAtEntity("pind1_dust", "ps_dust_falling_hole", "DA2_3", false);
CreateParticleSystemAtEntity("pind_4dust", "ps_dust_falling_hole", "DA2_4", false);
CreateParticleSystemAtEntity("pind_d4ust", "ps_dust_falling_hole", "DA2_5", false);
CreateParticleSystemAtEntity("pind_du7st", "ps_dust_falling_hole", "DA2_6", false);
CreateParticleSystemAtEntity("pind_dus3t", "ps_dust_falling_hole", "DA2_7", false);
CreateParticleSystemAtEntity("pind_dust", "ps_dust_falling_hole", "DA2_8", false);
CreateParticleSystemAtEntity("8pind_dust", "ps_dust_falling_hole", "DA2_9", false);
CreateParticleSystemAtEntity("p5ind_dust", "ps_dust_falling_hole", "DA2_10", false);
CreateParticleSystemAtEntity("pind_dust", "ps_cave_monster_scream", "ScriptArea_5", false);
PlaySoundAtEntity("papo", "explosion_rock_large.snt", "level_hub_1", 0, false);
SetPropHealth("level_hub_1", 0);
SetPropHealth("door_barricade_locked_1", 0);
CreateParticleSystemAtEntity("stuff","ps_break_wood","ScriptArea_3", false);
CreateParticleSystemAtEntity("stufo","ps_break_wood","ScriptArea_3", false);
CreateParticleSystemAtEntity("stufi","ps_break_wood","ScriptArea_3", false);
AddTimer("timerdie", 2.5f, "dead");
}
void lookatvalve(string& asTimer)
{
RemoveTimer("timerdie");
StopPlayerLookAt();
StartPlayerLookAt("rock_lock_static_1", 2.0f, 2.0f, "");
AddTimer("timer21", 0.5f, "lookatrock");
AddTimer("timer22", 0.5f, "rockbreak1");
}
void dead(string& asTimer)
{
AddTimer("", 5.0f, "govalvekill");
SetEntityActive("castle_silent_1", true);
AddEntityCollideCallback("castle_silent_1", "ScriptArea_6", "youdie", true, 1);
}
void govalvekill(string& asTimer)
{
AddTimer("", 2.0f, "valvekill");
AddTimer("", 3.9f, "valvekill");
AddTimer("", 5.7f, "valvekill");
AddTimer("", 7.5f, "valvekill");
AddTimer("", 9.3f, "valvekill");
AddTimer("", 11.0f, "valvekill");
AddTimer("", 12.5, "valvekill");
AddTimer("", 13.9f, "valvekill");
AddTimer("", 15.1f, "valvekill");
AddTimer("", 16.3f, "valvekill");
AddTimer("", 18.0f, "valvekill");
AddTimer("", 20.0f, "finalvalvekill");
}
void youdie(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("puund", "attack_claw_hit.snt", "Player", 0, false);
GivePlayerDamage(100, "Slash", true, true);
}
void breakvalve(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("ScriptArea_6", false);
SetPlayerCrouching(false);
SetPlayerActive(false);
StartPlayerLookAt("valve_iron_rusty_breakable_1", 2.0f, 2.0f, "");
StartPlayerLookAt("valve_iron_rusty_breakable_2", 2.0f, 2.0f, "");
AddTimer("timer20", 1.0f, "lookatvalve");
}
void rockbreak1(string& asTimer)
{
SetEntityActive("rock_lock_static_1", false);
SetEntityActive("rock_lock_static_2", true);
AddTimer("", 0.001f, "rockbreak2");
}
void rockbreak2(string& asTimer)
{
SetEntityActive("rock_lock_static_2", false);
SetEntityActive("rock_lock_static_3", true);
AddTimer("", 0.001f, "rockbreak3");
}
void rockbreak3(string& asTimer)
{
SetEntityActive("rock_lock_static_3", false);
SetEntityActive("rock_lock_static_4", true);
AddTimer("", 0.001f, "rockbreak4");
}
void rockbreak4(string& asTimer)
{
SetEntityActive("rock_lock_static_4", false);
SetEntityActive("rock_lock_static_5", true);
AddTimer("", 0.001f, "rockbreak5");
}
void rockbreak5(string& asTimer)
{
SetEntityActive("rock_lock_static_5", false);
SetEntityActive("rock_lock_static_6", true);
AddTimer("", 0.001f, "rockbreak6");
}
void rockbreak6(string& asTimer)
{
SetEntityActive("rock_lock_static_6", false);
SetEntityActive("rock_lock_static_7", true);
SetPropHealth("valve_iron_rusty_breakable_1", 0);
SetPropHealth("valve_iron_rusty_breakable_2", 0);
CreateParticleSystemAtEntity("stufp","ps_break_pottery","valve_iron_rusty_breakable_1", false);
CreateParticleSystemAtEntity("stufp","ps_break_pottery","valve_iron_rusty_breakable_2", false);
SetPlayerActive(true);
AddTimer("", 0.001f, "rockbreak8");
}
void lookatrock(string& asTimer)
{
StopPlayerLookAt();
StartPlayerLookAt("valve_iron_rusty_breakable_1", 1.0f, 1.0f, "");
StartPlayerLookAt("valve_iron_rusty_breakable_2", 1.0f, 1.0f, "");
AddTimer("", 1.0f, "rockbreak7");
}
void rockbreak7(string& asTimer)
{
StopPlayerLookAt();
}
void rockbreak8(string& asTimer)
{
SetEntityActive("rock_lock_static_7", false);
SetEntityActive("rock_small_moveable", true);
AddTimer("", 0.01f, "rockbreak9");
}
void rockbreak9(string& asTimer)
{
AddPropImpulse("valve_iron_rusty_breakable_1", 0, 0, -0.5f, "world");
AddPropImpulse("valve_iron_rusty_breakable_2", 0, 0, -0.5f, "world");
}
void valvekill(string& asTimer)
{
PlaySoundAtEntity("pu9nd", "hit_wood", "Player", 0, false);
CreateParticleSystemAtEntity("puund_dust", "ps_hit_wood", "ScriptArea_13", false);
CreateParticleSystemAtEntity("puund_dust", "ps_hit_wood", "ScriptArea_14", false);
CreateParticleSystemAtEntity("puund_dust", "ps_hit_wood", "ScriptArea_15", false);
CreateParticleSystemAtEntity("puund_dust", "ps_hit_wood", "ScriptArea_16", false);
CreateParticleSystemAtEntity("puund_dust", "ps_hit_wood", "ScriptArea_17", false);
AddPropImpulse("safety_normal_vert_1", -2, 0, 0, "World");
}
void finalvalvekill(string& asTimer)
{
CreateParticleSystemAtEntity("pind_dust", "ps_dust_falling_hole", "ScriptArea_13", false);
CreateParticleSystemAtEntity("p9ind_dust", "ps_dust_falling_hole", "ScriptArea_14", false);
CreateParticleSystemAtEntity("pi5nd_dust", "ps_dust_falling_hole", "ScriptArea_15", false);
CreateParticleSystemAtEntity("pin2d_dust", "ps_dust_falling_hole", "ScriptArea_16", false);
CreateParticleSystemAtEntity("pind1_dust", "ps_dust_falling_hole", "ScriptArea_17", false);
CreateParticleSystemAtEntity("pind_4dust", "ps_dust_falling_hole", "ScriptArea_18", false);
CreateParticleSystemAtEntity("pind_d4ust", "ps_dust_falling_hole", "ScriptArea_19", false);
CreateParticleSystemAtEntity("pind_du7st", "ps_dust_falling_hole", "ScriptArea_20", false);
CreateParticleSystemAtEntity("pind_dus3t", "ps_dust_falling_hole", "ScriptArea_21", false);
CreateParticleSystemAtEntity("pind_dust", "ps_dust_falling_hole", "ScriptArea_22", false);
CreateParticleSystemAtEntity("8pind_dust", "ps_dust_falling_hole", "ScriptArea_23", false);
CreateParticleSystemAtEntity("p5ind_dust", "ps_dust_falling_hole", "ScriptArea_24", false);
CreateParticleSystemAtEntity("p5ind_dust", "ps_dust_falling_hole", "ScriptArea_25", false);
CreateParticleSystemAtEntity("p5ind_dust", "ps_dust_falling_hole", "ScriptArea_26", false);
CreateParticleSystemAtEntity("p5ind_dust", "ps_dust_falling_hole", "ScriptArea_27", false);
CreateParticleSystemAtEntity("pind_dust", "ps_cave_monster_scream", "ScriptArea_28", false);
PlaySoundAtEntity("papo", "explosion_rock_large.snt", "Player", 0, false);
SetPropHealth("safety_normal_vert_1", 0);
CreateParticleSystemAtEntity("stuff","ps_break_wood","ScriptArea_13", false);
CreateParticleSystemAtEntity("stufo","ps_break_wood","ScriptArea_13", false);
CreateParticleSystemAtEntity("stufi","ps_break_wood","ScriptArea_13", false);
SetEntityActive("castle_silent_2", true);
AddEntityCollideCallback("castle_silent_2", "ScriptArea_11", "valvedie", true, 1);
}
void valvedie(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("puund", "attack_claw_hit.snt", "Player", 0, false);
GivePlayerDamage(100, "Slash", true, true);
}
void CheckLeverStates()
{
if (GetLocalVarInt("lever_1") == 1
&& GetLocalVarInt("lever_2") == -1
&& GetLocalVarInt("lever_3") == 1)
{
PerformLeverTaskCompleted();
}
}
void StoreCheckLeverState(string &in entity, int state)
{
SetEntityActive("ScriptArea_11", false);
SetLocalVarInt(entity, state);
CheckLeverStates();
}
void PerformLeverTaskCompleted()
{
SetMoveObjectState("safety_normal_vert_2", 0);
}
void CollideAreaBreakWall(string &in asParent, string &in asChild, int alState)
{
StopMusic(3.0, 0.5f);
StartScreenShake(0.20f, 5.0f, 1.0f, 5.0f);
SetPlayerActive(false);
AddPlayerSanity(25);
SetLocalVarInt("Door", 1);
AddTimer("", 3.0f, "WallCrash");
}
void WallCrash(string& asTimer)
{
SetEntityActive("rock_debris01_1", true);
SetEntityActive("rock_debris01_2", true);
SetEntityActive("rock_debris01_3", true);
PlaySoundAtEntity("cave", "29_cave_in.snt", "ScriptArea_10", 0, false);
StartPlayerLookAt("ScriptArea_9", 1.0f, 1.0f, "");
CreateParticleSystemAtEntity("stufp","ps_dust_drilling", "ScriptArea_9", false);
CreateParticleSystemAtEntity("stufp","ps_dust_drilling", "ScriptArea_8", false);
AddTimer("", 3.0f, "WallCrish");
AddTimer("", 1.0f, "WallCresh");
AddTimer("", 2.0f, "WallCrush");
}
void WallCresh(string& asTimer)
{
SetEntityActive("rock_debris03_2", true);
SetEntityActive("rock_debris01_4", true);
PlaySoundAtEntity("ceve", "29_cave_in.snt", "ScriptArea_8", 0, true);
}
void WallCrush(string& asTimer)
{
SetEntityActive("rock_debris03_3", true);
SetEntityActive("rock_debris01_5", true);
PlaySoundAtEntity("cive", "29_cave_in.snt", "ScriptArea_9", 0, true);
}
void WallCrish(string& asTimer)
{
SetEntityActive("rock_debris_brown02_1", true);
SetEntityActive("rock_debris02_1", true);
StopPlayerLookAt();
StartPlayerLookAt("ScriptArea_8", 1.0f, 1.0f, "");
AddTimer("", 3.0f, "WallCrpsh");
}
void WallCrpsh(string& asTimer)
{
SetEntityActive("rock_debris03_1", true);
SetEntityActive("rock_debris_brown02_2", true);
StopPlayerLookAt();
StartPlayerLookAt("ScriptArea_10", 1.0f, 1.0f, "");
FadeOut(1.0f);
SetEntityActive("crowbar_joint_1", false);
StopSound("cave", 3.0f);
StopSound("cive", 3.0f);
StopSound("ceve", 3.0f);
PlaySoundAtEntity("crve", "explosion_rock_large.snt", "ScriptArea_9", 0, true);
AddTimer("", 3.0f, "WallCrqsh");
}
void WallCrqsh(string& asTimer)
{
StopPlayerLookAt();
TeleportPlayer("StartCrash");
SetEntityActive("cave_in_1", true);
FadeIn(5.0f);
AddTimer("", 3.0f, "WallCrgsh");
SetEntityActive("crowbar_1", true);
}
void WallCrgsh(string& asTimer)
{
SetMessage("Messages", "Escaped", 5.0f);
SetPlayerActive(true);
}
void OnLeave()
{
}
RE: Restore rusty valve when you die - Your Computer - 08-05-2012
Resetting a broken entity is futile because the way the game creates a broken entity is by replacing the original with a new entity. So calling ResetProp on the entity is simply going to reset the broken entity and not create its non-broken form.
RE: Restore rusty valve when you die - Steve - 08-05-2012
okay that's handy to know for the future, but is there a way I could replace it or something than?
RE: Restore rusty valve when you die (still unsolved) - Steve - 08-06-2012
doesn't anybody know what |I could do to restore or replace it when you die? I really want to solve this :S
RE: Restore rusty valve when you die (still unsolved) - palistov - 08-06-2012
You could have the broken version of the entity breakable, and when that one breaks make it spawn the "working" version. I was playing around with the idea of that with grab objects, but it kept shooting them out of the player's hands each time they died haha
RE: Restore rusty valve when you die (still unsolved) - Your Computer - 08-06-2012
(08-06-2012, 11:34 AM) Steve Wrote: doesn't anybody know what |I could do to restore or replace it when you die? I really want to solve this :S
Have you never heard of CreateEntityAtArea? Then study http://wiki.frictionalgames.com/hpl2/amnesia/script_functions
RE: Restore rusty valve when you die (still unsolved) - Steve - 08-14-2012
(08-06-2012, 02:43 PM) Your Computer Wrote: (08-06-2012, 11:34 AM) Steve Wrote: doesn't anybody know what |I could do to restore or replace it when you die? I really want to solve this :S
Have you never heard of CreateEntityAtArea? Then study http://wiki.frictionalgames.com/hpl2/amnesia/script_functions
okay I have looked it through but i still don't really get how I can use with my problem can you give me a little explanation? :S (I haven't been busy with my custom for ome days that's why the late reaction)
RE: Restore rusty valve when you die (still unsolved) - Theforgot3n1 - 08-14-2012
What I do for these situation is a very inefficient method, but it works.
Have maybe 20 Rusty Valves that are all inactive except one. Every time you reset, have the older Rusty Valve deactivate and the next number of Rusty Valve activate. Works for me.