Frictional Games Forum (read-only)
Lever help - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Lever help (/thread-21356.html)

Pages: 1 2


RE: Lever help - Tomato Cat - 05-02-2013

(05-02-2013, 01:22 PM)Storfigge Wrote: No. One lever is support to tp me to another map, the second 1. Bit instead it's the first lever that tp me even though i haven't programmed it to do so.

I know, that's what the script would fix.

Or you can try JAP's fix.


RE: Lever help - Storfigge - 05-05-2013

(05-02-2013, 03:11 PM)Mr Credits Wrote:
(05-02-2013, 01:22 PM)Storfigge Wrote: No. One lever is support to tp me to another map, the second 1. Bit instead it's the first lever that tp me even though i haven't programmed it to do so.

I know, that's what the script would fix.

Or you can try JAP's fix.

Nope it doesn't work. JAP's scirpt just gives me an error while your stop the first lever from teleporting me but the second one doesn't do anything now. elevator_machine_main_lever_1 is activating the timer even though it is elevator_lever_1 that should activate it.


RE: Lever help - Tomato Cat - 05-05-2013

Did you try my fix?


RE: Lever help - Storfigge - 05-06-2013

(05-05-2013, 06:20 PM)Mr Credits Wrote: Did you try my fix?

I did try it. It stoped the first lever from activating the timer but the second lever that is suppose to activate it now do nothing at all. I can pull it but nothing happens. Why do the first lever even activate the timer, I haven't told it to do so. This is confusing Sad


RE: Lever help - PutraenusAlivius - 05-06-2013

PHP Code:
void OnStart()

{

AddEntityCollideCallback("cog_1""Cog1""Elevator_start"true1);

AddEntityCollideCallback("cog_2""Cog2""Elevator_start"true1);

AddEntityCollideCallback("cog_3""Cog3""Elevator_start"true1);

SetEntityConnectionStateChangeCallback("elevator_machine_main_lever_1""e_lever");

SetEntityConnectionStateChangeCallback("elevator_lever_1""ele_lever");

SetLocalVarInt("CogCount"0); //I added this because I found out the LocalVarInt hasn't been called yet.

SetLocalVarInt("MachineryRun"0);

}





void Elevator_start(string &in asParentstring &in asChildint alState)

{

        
AddLocalVarInt("CogCount"1);

        if (
GetLocalVarInt("CogCount")==3)

    {

        
SetLeverStuckState("elevator_machine_main_lever_1"0true);

    }

}



void e_lever(string &in asEntityint alState)

{

    
SetEntityActive("ScriptArea_1"true);    

    
SetLeverStuckState("elevator_lever_1"0true);

    
RotatePropToSpeed("elevator_machine_cog_main_1"11.5100false"");

    
RotatePropToSpeed("elevator_machine_cog_small_3"11.5100false"");

    
RotatePropToSpeed("elevator_machine_cog_small_2"11.5001false"");

    
RotatePropToSpeed("elevator_machine_cog_small_1"11.5001false"");

    
RotatePropToSpeed("cog_1"11.5001false"");

    
RotatePropToSpeed("cog_2"11.5001false"");

    
RotatePropToSpeed("cog_3"11.5001false"");

    
PlaySoundAtEntity("""13_press_done.snt""Player"0false);

    
PlaySoundAtEntity("""13_machine_run_custom.snt""elevator_machine_cog_small_2"0false);

AddLocalVarInt("MachineryRun"1);

}



void ele_lever(string &in asEntityint alState)

{

    if(
GetLocalVarInt("MachineryRun") == 1);

        {

        
PlaySoundAtEntity("""14_elevator_activate.snt""Player"0false);

    
PlaySoundAtEntity("""elevator_move_normal.snt""Player"0false);

    
AddTimer("T1"4.0f"Timer_2");

        }

}



void Timer_2(string &in asTimer)

{

    
ChangeMap("Dungeons_1.map""PlayerStartArea_1""""");

}



void OnEnter()

{

    
PlayMusic("10_amb.ogg"true220true);        

}





void OnLeave()

{


There was an extra ;. My mind is not cooperating.


RE: Lever help - Storfigge - 05-06-2013

(05-05-2013, 06:20 PM)Mr Credits Wrote: Did you try my fix?

Managed to fix it now. It was suppose to be -1 instead of 1 Tongue