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
Amnesia script help!
theodorg Offline
Junior Member

Posts: 44
Threads: 11
Joined: Aug 2013
Reputation: 0
#1
Amnesia script help!

Hello im trying to make a key open a door in amnesia.
Heres my script:
////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "Awesome_key", "Awesome_door", "ABC", true);
}

void ABC(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "unlock_door", asEntity, 0, false);
RemoveItem("Awesome_key");
}



////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}
08-21-2013, 07:03 PM
Find
Traggey Offline
is mildly amused

Posts: 3,257
Threads: 74
Joined: Feb 2012
Reputation: 185
#2
RE: Amnesia script help!

Wrong section, moved.
08-21-2013, 07:42 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#3
RE: Amnesia script help!

(08-21-2013, 07:03 PM)theodorg Wrote: Hello im trying to make a key open a door in amnesia.
Heres my script:
////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "Awesome_key", "Awesome_door", "ABC", true);
}

void ABC(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "unlock_door", asEntity, 0, false);
RemoveItem("Awesome_key");
}



////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}
////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "Awesome_key", "Awesome_door", "ABC", true);
}

void ABC(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked( "Awesome_door", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "Awesome_door", 0, false);
RemoveItem("Awesome_key");
}



////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}

Check that the names match and delete .map_cache if there's any.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
08-21-2013, 07:49 PM
Find
theodorg Offline
Junior Member

Posts: 44
Threads: 11
Joined: Aug 2013
Reputation: 0
#4
RE: Amnesia script help!

(08-21-2013, 07:49 PM)The chaser Wrote:
(08-21-2013, 07:03 PM)theodorg Wrote: Hello im trying to make a key open a door in amnesia.
Heres my script:
////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "Awesome_key", "Awesome_door", "ABC", true);
}

void ABC(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "unlock_door", asEntity, 0, false);
RemoveItem("Awesome_key");
}



////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}
////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "Awesome_key", "Awesome_door", "ABC", true);
}

void ABC(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked( "Awesome_door", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "Awesome_door", 0, false);
RemoveItem("Awesome_key");
}



////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}

Check that the names match and delete .map_cache if there's any.

I dont see a map cache and i have the correct names that im sure of i followed a guide doing this u can check it out here http://wiki.frictionalgames.com/hpl2/tut...cks_a_door

If u see any problems pls help im new to this!

(08-21-2013, 07:49 PM)The chaser Wrote:
(08-21-2013, 07:03 PM)theodorg Wrote: Hello im trying to make a key open a door in amnesia.
Heres my script:
////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "Awesome_key", "Awesome_door", "ABC", true);
}

void ABC(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "unlock_door", asEntity, 0, false);
RemoveItem("Awesome_key");
}



////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}
////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "Awesome_key", "Awesome_door", "ABC", true);
}

void ABC(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked( "Awesome_door", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "Awesome_door", 0, false);
RemoveItem("Awesome_key");
}



////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}

Check that the names match and delete .map_cache if there's any.
Also i can get ingame but when i try to open the door with the key it just sais i cant use the item that way.
(This post was last modified: 08-21-2013, 08:27 PM by theodorg.)
08-21-2013, 08:23 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#5
RE: Amnesia script help!

The script is completely fine, I repeat: Names won't change unless you hit Enter when you write them in Level Ed.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
08-21-2013, 10:24 PM
Find
theodorg Offline
Junior Member

Posts: 44
Threads: 11
Joined: Aug 2013
Reputation: 0
#6
RE: Amnesia script help!

(08-21-2013, 10:24 PM)The chaser Wrote: The script is completely fine, I repeat: Names won't change unless you hit Enter when you write them in Level Ed.

what do u mean with level e.d?
08-22-2013, 03:38 PM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#7
RE: Amnesia script help!

(08-22-2013, 03:38 PM)theodorg Wrote:
(08-21-2013, 10:24 PM)The chaser Wrote: The script is completely fine, I repeat: Names won't change unless you hit Enter when you write them in Level Ed.

what do u mean with level e.d?

Level Editor.

"Veni, vidi, vici."
"I came, I saw, I conquered."
08-22-2013, 04:12 PM
Find
theodorg Offline
Junior Member

Posts: 44
Threads: 11
Joined: Aug 2013
Reputation: 0
#8
RE: Amnesia script help!

haha thank you so much it seamed as the name changed everytime i tried to swave my map so i pressed enter as u said and it worked. You have my gratitude!
08-22-2013, 06:09 PM
Find
theodorg Offline
Junior Member

Posts: 44
Threads: 11
Joined: Aug 2013
Reputation: 0
#9
Amnesia script help!

Hello im trying to make an amnesia custom story scare by spawning the monster when the player touches an area. Something is wrong with the script i named MonsterFunction. Pls help!
My script:

////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "Awesome_key", "Awesome_door", "ABC", true);
}

{
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
}

void ABC(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked( "Awesome_door", false, true);
PlaySoundAtEntity("", "unlock_door", "Awesome_door", 0, false);
RemoveItem("Awesome_key");
}

void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", true);
}
08-23-2013, 03:49 PM
Find
Neelke Offline
Senior Member

Posts: 668
Threads: 82
Joined: Apr 2013
Reputation: 26
#10
RE: Amnesia script help!

(08-23-2013, 03:49 PM)theodorg Wrote: Hello im trying to make an amnesia custom story scare by spawning the monster when the player touches an area. Something is wrong with the script i named MonsterFunction. Pls help!
My script:

////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "Awesome_key", "Awesome_door", "ABC", true);
}

{
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
}

void ABC(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked( "Awesome_door", false, true);
PlaySoundAtEntity("", "unlock_door", "Awesome_door", 0, false);
RemoveItem("Awesome_key");
}

void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", true);
}

////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "Awesome_key", "Awesome_door", "ABC", true);
}

{
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
}

void ABC(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Awesome_door", false, true);
PlaySoundAtEntity("", "unlock_door", "Awesome_door", 0, false);
RemoveItem("Awesome_key");
}

void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", true);
}

I think that was the problem, it seemed to be good otherwise. Also might be a good idea telling what happens when you try to start the level.
08-23-2013, 04:06 PM
Find




Users browsing this thread: 1 Guest(s)