The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
The secret door
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#1
The secret door

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 Undecided

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
08-07-2012, 12:23 PM
Find


Messages In This Thread
The secret door - by The chaser - 08-07-2012, 12:23 PM
RE: The secret door - by The Shanus - 08-07-2012, 05:10 PM
RE: The secret door - by Adny - 08-07-2012, 05:26 PM



Users browsing this thread: 1 Guest(s)