Frictional Games Forum (read-only)
[HELP] Goddamn levers. - 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: [HELP] Goddamn levers. (/thread-11739.html)



[HELP] Goddamn levers. - Victor - 12-07-2011


I'm getting a lot of problems with this part of the script:


void chand()
{
if (GetLocalVarInt lever_small01_1 == lever_1_state)
(
CompleteQuest("PerformLeverTaskCompleted", "levertask"));
PlaySoundAtEntity("", "quest_completed.snt", "Player", 0, false);
PlaySoundAtEntity("", "general_chain.ogg", "Player", 0, false);
PlaySoundAtEntity("", "door_level_engine_open.ogg", "Player", 0, false);
SetEntityActive("sadchand", false);
SetEntityActive("happychand", true);
CheckPoint ("", "auto1", "", "", "");
SetEntityActive("block_box_3", true);
SetEntityActive("block_box_4", false);
)
}

The thing is, I pull the lever and the chandelier changes. But the crash is saying that I need to express the value of stuff, and to put some '(' in awkward places. Can you help me?


RE: [HELP] Goddamn levers. - Khyrpa - 12-07-2011


void chand()
{
if (GetLocalVarInt lever_small01_1 == lever_1_state)
{
CompleteQuest("PerformLeverTaskCompleted", "levertask"));
PlaySoundAtEntity("", "quest_completed.snt", "Player", 0, false);
PlaySoundAtEntity("", "general_chain.ogg", "Player", 0, false);
PlaySoundAtEntity("", "door_level_engine_open.ogg", "Player", 0, false);
SetEntityActive("sadchand", false);
SetEntityActive("happychand", true);
CheckPoint ("", "auto1", "", "", "");
SetEntityActive("block_box_3", true);
SetEntityActive("block_box_4", false);
}
}


I just took a quick glance, works?



RE: [HELP] Goddamn levers. - flamez3 - 12-07-2011

(12-07-2011, 01:25 PM)Victor Wrote: I'm getting a lot of problems with this part of the script:


void chand()
{
if (GetLocalVarInt lever_small01_1 == lever_1_state)
(
CompleteQuest("PerformLeverTaskCompleted", "levertask"));
PlaySoundAtEntity("", "quest_completed.snt", "Player", 0, false);
PlaySoundAtEntity("", "general_chain.ogg", "Player", 0, false);
PlaySoundAtEntity("", "door_level_engine_open.ogg", "Player", 0, false);
SetEntityActive("sadchand", false);
SetEntityActive("happychand", true);
CheckPoint ("", "auto1", "", "", "");
SetEntityActive("block_box_3", true);
SetEntityActive("block_box_4", false);
)
}

The thing is, I pull the lever and the chandelier changes. But the crash is saying that I need to express the value of stuff, and to put some '(' in awkward places. Can you help me?

Also, put quotation marks outside of lever_small01_1, that might help.




RE: [HELP] Goddamn levers. - Victor - 12-09-2011

Now it says that I need a ';' over here:

P;laySoundAtEntity("", "quest_completed.snt", "Player", 0, false);
awkward



RE: [HELP] Goddamn levers. - Obliviator27 - 12-10-2011

If you ask me, it would be easiest just to set up a connectionstatechangecallback.
In the level editor, under the entity tab for the lever, there should be a box with ConnectionStateChangeCallback (or something like that) Just type in whatever you like. As an example, I'll just do LeverPull.
Then, you can do this.
PHP Code:
void LeverPull(string &in EntityNameint alState)
{
    if(
alState == 1)
    {
       
//stuff you want done here
    
}




RE: [HELP] Goddamn levers. - Fanskapi - 12-12-2011

CompleteQuest("PerformLeverTaskCompleted", "levertask"));
PlaySoundAtEntity("", "quest_completed.snt", "Player", 0, false);

Notice the extra ) after "levertask", thats why it says that you need to put an ; there. You actually don't, just delete the ).
Download Notepad++ (or some similiar coding program), it will help you alot.