+- 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: Need help on a script ;) [solved!] (/thread-21157.html)
I wanna make if you interact something you teleport i made that.
But now i want that you need a key for it..
So if you didn't use the key on it starts SetMessage and then a text like. I'ts locked i need a key to enter. and if you interact then you teleport to the cellar.
If you don't understand what i mean i show some pictures to make it clear.
Script in spoiler
Spoiler below!
HPS.
////////////////////////////
// Run first time starting map
void OnStart()
{
//---- COLLIDE CALLBACKS ----//
AddUseItemCallback("", "Cellar_Key", "CellarDoor1", "OpenCellarDoor1", true);
<CATEGORY Name="Messages">
<Entry Name="EnteringTheCellar">This seems like a storage, Maybe i can find something useful!</Entry>
</CATEGORY>
<CATEGORY Name="Inventory">
<Entry Name="ItemDesc_Cellar_Key">It's a Rusty Key, There is marked something on it, It is very rusty and hard to read[br]F*r Ent*r*ng Th*e C*ll*r.</Entry>
<Entry Name="ItemName_Cellar_Key">Rusty Key!</Entry>
</CATEGORY>
<CATEGORY Name="Journal">
<Entry Name="Note_DiaryJane_Name">Diary Jane 1/1</Entry>
<Entry Name="Note_DiaryJane_Text">My husband Jake is a miner.[br]He works in the mine here nearby already for 15 years.[br]Still im really scared that the mine is gonna colapsed,[br]The mine has been here for centuries![br]There is still a myth going around that there are some kind of monsters in there.[br]Me and Jake dont believe in myths,[br]But...What if they are really there.[br][br]Former.[br]Jane.</Entry>
</CATEGORY>
<CATEGORY Name="Levels">
</CATEGORY>
</LANGUAGE>
Pictures!
Inside the cellar where it should go when used key and interact the door.
The Cellar entrance at the back of the house.
Hope you can help me already thanks for helping!
Cheers
(04-13-2013, 04:23 PM)Tiger Wrote: I really don't understand your question, but you have no variable that activated the 'EnterCellar'-function.
I mean i want that if you interact whitout using the key. it says you need a key to open this. something like that
After you used it you can interact and get teleported to the cellar location.
RE: Need help on a script ;) - NaxEla - 04-13-2013
Create a script area around the door and make sure that it has ItemInteraction enabled. I named the area ScriptArea_1 in the script. You'll also need the change the entry name for the message.
PHP Code:
//////////////////////////// // Run first time starting map void OnStart() { SetLocalVarInt("CellarDoorOpen", 0);
(04-13-2013, 05:34 PM)NaxEla Wrote: Create a script area around the door and make sure that it has ItemInteraction enabled. I named the area ScriptArea_1 in the script. You'll also need the change the entry name for the message.
PHP Code:
//////////////////////////// // Run first time starting map void OnStart() { SetLocalVarInt("CellarDoorOpen", 0);
//////////////////////////// // Run when entering map void OnEnter() { AutoSave(); }
//////////////////////////// // Run when leaving map void OnLeave() {
}
Not working 100% like i want to but thx anyway.
Really nice that the text shown when i interact but.
When i use the key its open but the text is still getting shown.
And also if i interact it again i don't teleport to the cellar
RE: Need help on a script ;) [not solved!] - NaxEla - 04-13-2013
That's strange :\ When I tested it, it worked perfectly
Here's the exact script I used to test it. I also made it so that the text will only show up the first time the player enters the cellar. You'll need to change the names teleport areas and .lang entries.
PHP Code:
//////////////////////////// // Run first time starting map void OnStart() { SetLocalVarInt("CellarDoorOpen", 0); SetLocalVarInt("FirstTimeCellar", 1);
(04-13-2013, 10:44 PM)NaxEla Wrote: That's strange :\ When I tested it, it worked perfectly
Here's the exact script I used to test it. I also made it so that the text will only show up the first time the player enters the cellar. You'll need to change the names teleport areas and .lang entries.
PHP Code:
//////////////////////////// // Run first time starting map void OnStart() { SetLocalVarInt("CellarDoorOpen", 0); SetLocalVarInt("FirstTimeCellar", 1);
//////////////////////////// // Run when entering map void OnEnter() { AutoSave(); }
//////////////////////////// // Run when leaving map void OnLeave() {
}
I have to add the script area at the door right or hatched whatever its called ;D
Well it works almost the only thing is i cant use the key on it.
Never mind working you just got + repp'd thanks allot