Frictional Games Forum (read-only)

Full Version: Amnesia script help!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
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()
{

}
Wrong section, moved.
(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.
(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.
The script is completely fine, I repeat: Names won't change unless you hit Enter when you write them in Level Ed.
(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)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.
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!
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)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.
Pages: 1 2 3 4