Hello everyone:
I have a problem. In the main story, at the beggining, after reading the note from Daniel to himself, you must use a lever. That lever moves a shelf, but moves a secret door too. That secret door is just as a castle wall. I wanted to use that with a button but i don't know what could the script be. Is just different? Well, i will put the script in here, if there's something wrong.
/////////////////////////////////////////////////////////////////////////////
void OnStart ()
{
SetLocalVarInt("Var1", 0);
SetEntityPlayerInteractCallback("button_simple_1", "Secret_move", true);
SetEntityCallbackFunc("key_study_1", "Monster");
SetEntityConnectionStateChangeCallback("Lever_1", "func_shelf");
}
void Monster (string &in asEntity, string &in type)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_10", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_11", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_12", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_13", 0, "");
}
void Secret_move(string &in asEntity)
{
AddLocalVarInt("Var1", 1);
SD();
}
void func_shelf(string &in asEntity, int alState)
{
if (alState == 1)
{
SetMoveObjectState("shelf_secret_door_rot_1",1.0f);
PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false);
return;
}
}
void SD()
{
if(GetLocalVarInt("Var1") == 1)
{
SetSwingDoorLocked("prison_1", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "prison_1", 0.5f, false);
}
}
void OnEnter ()
{
}
void OnLeave ()
{
}
///////////////////////////////////////////////////////
Is simple: A button opens the secret door (yes, the script doesn't say that, i know) behind the secret door there is a lever that moves a shelf. Behind that shelf there is a corridor, you push a button and a door opens.
How i could script that? I have a limited experience (i know the basics, like triggering monsters, keys, and other things) but the secret door escapes to my understanding.
PS: My english isn't the best, but i do what i can